-
Notifications
You must be signed in to change notification settings - Fork 23.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vmware_guest: Enable setting mac address when cloning from VM or template #64511
Conversation
@wkoot, just so you are aware we have a dedicated Working Group for vmware. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the rebase, and the update of the functional tests. It looks much better. But I've a little problem with the test itself :-(.
netmask: 255.255.255.0 | ||
gateway: 192.168.10.254 | ||
mac: aa:bb:cc:dd:aa:b0 | ||
register: clone_manual_mac_address |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I get the following error :-(
fatal: [testhost]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"annotation": null,
"cdrom": [],
"cluster": null,
"convert": null,
"customization": {},
"customization_spec": null,
"customvalues": [],
"datacenter": "DC0",
"datastore": null,
"delete_from_inventory": false,
"disk": [],
"esxi_hostname": null,
"folder": "F0",
"force": false,
"guest_id": null,
"hardware": {},
"hostname": "vcenter.test",
"is_template": false,
"linked_clone": false,
"name": "test_vm1",
"name_match": "first",
"networks": [
{
"gateway": "192.168.10.254",
"ip": "192.168.10.10",
"mac": "aa:bb:cc:dd:aa:b0",
"name": "VM Network",
"netmask": "255.255.255.0",
"type": "static"
}
],
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"port": 443,
"proxy_host": null,
"proxy_port": null,
"resource_pool": null,
"snapshot_src": null,
"state": "poweredoff",
"state_change_timeout": 0,
"template": "DC0_H0_VM0",
"use_instance_uuid": false,
"username": "administrator@vsphere.local",
"uuid": null,
"validate_certs": false,
"vapp_properties": [],
"wait_for_customization": false,
"wait_for_customization_timeout": 3600,
"wait_for_ip_address": false,
"wait_for_ip_address_timeout": 300
}
},
"msg": "Failed to create a virtual machine : Customization of the guest operating system 'debian8_64Guest' is not supported in this configuration. Microsoft Vista (TM) and Linux guests with Logical Volume Manager are supported only for recent ESX host and VMware Tools versions. Refer to vCenter documentation for supported configurations."
}
clone_customize_guest_test.yml
works fine with the same configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's weird. Was the test vm not turned off when you ran the test?
Workaround: Remove network interface from vm manually before converting it to template. I am now able to clone and customize interface/mac using Ansible 2.8.1 against vSphere 6.5 spinning RHEL7.7 ... Great work you people are doing - Thanks and much appreciation. |
Hi! Thank you for your PR. Since March 2, 2020, the Ansible team does not accept any new changes on the VMware modules on the core Links:
needs_info |
@wkoot This pullrequest is waiting for your response. Please respond or the pullrequest will be closed. |
@ansibot fuck it |
SUMMARY
Rebased zeot/devel from #51368 on ansible/devel. Original summary:
The method previously used for device changes when cloning was deprecated in vCenter 6.0. Even though it still works on vCenter 6.5.0, the vcsim did not apply these changes (resolved in govmomi master now, but not released).
For future proofing and testability, the new method of implementing device changes on clone is used when applying device changes when vCenter version 6.0 or greater is detected.
Fixes #51123 and fixes #51124
ISSUE TYPE
COMPONENT NAME
lib/ansible/modules/cloud/vmware/vmware_guest.py
ADDITIONAL INFORMATION
I wasn't able to use the suggested
prepare_vmware_roles
, but tested against a local vsphere instead