Can't deploy image-based hosts on vSphere

Posted on

So the title is a half truth... I can deploy images using a VMware template through Satellite. However, this only just creates a new VM based on the template without any modifications.

The correct method would be to use the CloudInit default and UserData open-vm-tools provisioning templates to them modify the image using the VMware tools customizations so that the resulting hosts actually have a new hostname and network config, but this is where things are falling down. I've followed the Satellite docs on provisioning VMware instances with userdata, but nothing seems to be working.

My process for template creation:

  • PXE provision a new VM from Satellite onto vSphere
  • Run an Ansible playbook that does all of the tasks listed in the docs e.g. installing required packages, modifying configs, removing files, unregistering from Satellite
  • Power down the VM and convert to a template

After that I create an image in my vSphere compute resource using this template, and provide the automation user info made during the initial provisioning (has both ssh-key access and password access). When I try to use this to provision a new host, I run into the following error:

Failed to create a compute vSphere (VMware) instance newvm.corp.net:
  InvalidRequest: Required property ipAddress is missing from data object of type CustomizationFixedIp
    while parsing serialized DataObject of type vim.vm.customization.FixedIp at line 1, column 4895
      while parsing property "ip" of static type CustomizationIpGenerator
    while parsing serialized DataObject of type vim.vm.customization.IPSettings at line 1, column 4851
      while parsing property "adapter" of static type CustomizationIPSettings
    while parsing serialized DataObject of type vim.vm.customization.AdapterMapping at line 1, column 4797
      while parsing property "nicSettingMap" of static type ArrayOfCustomizationAdapterMapping
    while parsing serialized DataObject of type vim.vm.customization.Specification at line 1, column 4325
      while parsing property "customization" of static type CustomizationSpec
    while parsing serialized DataObject of type vim.vm.CloneSpec at line 1, column 321
      while parsing call information for method CloneVM_Task at line 1, column 177
      while parsing SOAP body at line 1, column 167 while parsing SOAP envelope at line 1, column 0
      while parsing HTTP request for method clone on object of type vim.VirtualMachine at line 1, column 0

I've been banging my head against the wall with this, and the only thing I can think of is that the subnet I'm using for the system uses "Boot mode = DHCP" rather than static. I tried flipping that over and manually providing an IP address to the network interface and that worked in deploying the image, but obviously didn't really work as the VM uses DHCP and doesn't seem to get any of the cloud-init/VMware customizations info.

Is there something I'm missing in how this is all supposed to work?

Responses