Rocky9 / esxi / terraform won't play well :(

Hi,

I’m try to setup a rocky9 vmware esxi template to use with opentofu (terraform) because we need some rapid deployments.

We could use this with ubuntu based templates at any time.

Template:
I installed a very basic rocky9 server in a VM, installed the open-vm tools + cloud-init.

But: When I try to setup a machine based on this system I get two problems:

  1. The clone won’t connect the network interface. The same code with an ubuntu template set the interface to “connect on startup”. That’s why writing here, not in VMware or Terraform forum - this problem seems to be rocky9 related.
  2. I think related to this: I never get a success message back so the opentofu fails after a while even the VM is created.

I dived into the template again, configured cloud-init that it accept the vmware-tools as config provider - this is all working now. eg, it tries to run the cloud-init data. But of course fails on package install because no network.

I tried do ensure that vmtoolsd is starting AFTER the dbus (eg, inserted into vgauthd.service a line “After=dbus.service”) - but did not help :frowning:

For testing I ran inside cloned machine

clout-init clean
reboot

and when network was connected before it did exactly what I wanted. So data from esxi daemon are read and pushed to the machine.

Question: Is there someone out got a esxi-template work? If so, how? What recommendation exists for setting up the VM in esxi (system type etc.)? Or is somewhere an OVA / image I can directly use as a template in ESXI for deployment with cloud-init/opentofu/terraform?

Thanks

How are you configuring the network for the deployed VM?

If you expect DHCP to work, then Rocky’s server role may be causing problems: it configures NetworkManager to not autoconfigure any new network interfaces. If that’s the case, you can uninstall NetworkManager-config-server on the template - that should re-enable automatic network configuration.

I think I found the reason for this behavior:

when having in block “clone.customize” a network block deployment fails … but this is no Rocky problem I think, so sorry for blaming this dist.

Removing this brings the system with connected network and response to the opentofu. But now I have other problems with cloud-init not part of this thread but your answer may be related…

Thanks