-
Notifications
You must be signed in to change notification settings - Fork 64
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
vcenter_vmtemplate_libraryitems: clone VM Template incomplete example and no cloud-init example #471
Comments
@ephracis This should be given some attention, cloning from a VM Template is a critical functionality any administrator would expect |
Hm… I could take some of the code I wrote for my current customer and use it as an example. But they don’t use cloud init (unfortunately, if you ask me) so I don’t have a working example of that. I’ll try to get something up next week, but I can’t promise anything since my main work is consulting and not maintaining this module. But for you I’ll make an effort. |
@ephracis Appreciated greatly 🙂 Is there nobody from Broadcom that is looking at this Ansible Module too? The "VMware VM Guest OS Customization with cloud-init" execution is very fragile from my testing experience, I could never get 'userdata' to work 100% of the time. It would need an expert to debug why the 'userdata' does not always execute. |
Maybe @goneri has a contact in Broadcom who could assist the cloud-init 'userdata' debugging? |
I just checked and the code I wrote for the customer is pretty much the same as the last three tasks in the example (get items, find template, deploy VM). So my code will not add much to the existing example. |
@GomathiselviS @alinabuzachis @jillr @hakbailey @gravesm Who is the owner of this Ansible Collection and responsible for testing in collaboration with VMware? It's not right to have the Ansible Collection failing when used with cloud-init and with so many outdated examples in the documentation; the end-user should expect such functionality to work and documentation to be accurate. |
Hi @sean-freeman This collection is developed by the Ansible Content Engineering organization, there is no one from Broadcom/VMware involved in this collection. Thank you for the bug report and contributing to the improvement of this collection. |
@jillr In order to solve the poor documentation and debug the |
Code has been taken from this GH Issue and added into the Ansible Collection via PR #534 , even though the procedure is still broken for cloud-init and all end-users will suffer failures. |
SUMMARY
Documentation of
vcenter_vmtemplate_libraryitems
contains incomplete example, and no cloud-init exampleIt should be expected if automation is used, that a clear example of a VM Template clone is provided in the documentation (especially given
vcenter_vm
Ansible Module can only use source as Instance Clone or Clone of a VM, and can not use a VM Template).ISSUE TYPE
COMPONENT NAME
vcenter_vmtemplate_libraryitems
ANSIBLE VERSION
PROPOSED SOLUTION
The following is a working example, although the cloud-init via configuration specification does not appear to work (even though it follows the REST API Specification, as shown with code comments).
The VM Template must be prepared with cloud-init:
/etc/cloud/cloud.cfg
with data source for VMware (and not OVF).vmware-toolbox-cmd config set deployPkg enable-custom-scripts true
vmware-toolbox-cmd config set deployPkg wait-cloudinit-timeout 60
sudo cloud-init clean --seed --logs
to remove cloud-init logs, remove cloud-init seed directory /var/lib/cloud/seed.--machine-id
parameter.--machine-id
parameter which removes/etc/machine-id
may on first reboot cause the OS Network Interfaces to beDOWN
which causes the DHCP Request to silently error.Ansible Playbook example:
The text was updated successfully, but these errors were encountered: