Score:0

cloud-init userdata/metadata not loaded in ESXi

cn flag

I'm using Terraform to provision virtual machines in an ESXi environment. I do this by having once manually imported the Ubuntu Focal Cloud Image as template and cloning virtual machines from it, with parameters supplied by a combination of vApp properties and extra_config:

vapp {
    properties = {
      "hostname" = "terraform-test"
      # user ubuntu
      "password"  = "xxx"
      "user-data" = base64encode(file("${path.module}/cloudinit/kickstart.yml"))
    }
  }
  extra_config = {
    "guestinfo.metadata"          = base64encode(file("${path.module}/cloudinit/metadata.yml"))
    "guestinfo.metadata.encoding" = "base64"
    "guestinfo.userdata"          = base64encode(file("${path.module}/cloudinit/userdata.yml"))
    "guestinfo.userdata.encoding" = "base64"
  }

Unfortunately, cloud-init does not apply anything from metadata/userdata.yml. The reason seems to be that while sudo DI_LOG=stderr /usr/lib/cloud-init/ds-identify --force yields Found 2 datasources found=all: OVF VMware, cloud_id only sees ovf.

The passing of the extra_config stuff works, vmware-rpctool 'info-get guestinfo.userdata'|base64 --decode yields the correct content - the issue therefore must be somewhere in cloud-init.

How do I tell cloud-init to force using solely the VMware data source?

JMHerrer avatar
us flag
Hello did you try to deploy ubuntu cloud image with metadata manually on vsphere?
cn flag
Yes, to be precise the "focal-server-cloudimg-amd64.ova" image that according to its description ("VMware/Virtualbox OVA") is specifically made for VMware.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.