I have a question about the ‘networks’ parameter for the VMWare cloud module. How do the options in this particular parameter get passed to the operating system during the initial deployment or setup process? With the virtual machine NIC settings for any ESXi instance, there is no place to define the IP address, netmask, gateway, etc… and with Linux operating systems, I can only get around this via Kickstart. Could someone clarify how this mechanism works when setting up new VMWare vm’s using Ansible?
Hello,
Can you precise which module you are using exactly?
Hi Sebastien, apologies for the delay.
I’m using the ‘vmware_guest’ module. From the documentation I’ve been reading, it seems the ‘network’ actions have no effect on the VM itself as those have to be assigned at the OS-level, not the VM-level. I don’t understand why the authors added that as it’s confusing, but maybe it’s strictly for setting up a new ESXi instance.
Ansible creates a sysprep/linuxprep script:
https://github.com/ansible/ansible/blob/3a6f0fbb9c698b9440f1c21c973822d1b8883124/lib/ansible/modules/cloud/vmware/vmware_guest.py#L1239
I have a lab with only static IPs and the networks parameter(s) work fine for me when creating new/cloning.
Hello,
If I’m not mistaken, those parameters only work when deploying a VM from a template.
And this template needs to have VMTools (or openvmtools) installed in it.
The network parameters are part of “guest customization specifications” and those specifications are send to the VM through the VMTools.