Comment 32 for bug 1793715

Revision history for this message
Pengpeng Sun (pengpengs) wrote :

Understood. I think you are using vSphere7, guest-customization does support netplan from vSphere 6.7U3g, so network-config can be set.
Guest-customization has 2 engines: one is perl scripts, the other is cloud-init. Unfortunately, neither of them can work with cloud-init to set userdata guest-config at the same boot.
For perl script based guest-customization, it has dependency on dbus, due to the reason in comment #28, it fails with cloud-init running.
For cloud-init based guest-customization, it uses the same cloud-init datasource OVF with ISO file, but different seed. Cloud-init can only apply either guest-customization or ISO userdata guest-config.

Good news is if you are using vSphere7, you can use customization post-customization script to finish your workflow, need below steps:

1. Power-on VM which deploy from ova.
2. Disable cloud-init by running the command “sudo touch /etc/cloud/cloud-init.disabled”
3. Enable customization script by running the command "vmware-toolbox-cmd config set deployPkg enable-custom-scripts true"
3. Power-off VM and convert it to template.
4. Create a new guest-customization specification which includes network-configs and customization script, the script looks like:
   #!/bin/sh
   if [ x$1 == x"postcustomization" ]; then
   rm /etc/cloud/cloud-init.disabled
   systemctl reboot
   fi
5. Generate the cloud-init configurations for guest-config dynamically and create a cloud-init.iso file
6. The rest steps you did

Related document and KB:
a. Create a Customization Specification for Linux https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-9A5093A5-C54F-4502-941B-3F9C0F573A39.html
b. Setting the customization script for virtual machines in vSphere 7.0
   https://kb.vmware.com/s/article/74880