Issue with "Connect on Boot" Flag Not Set During Ubuntu 24.04 VM Creation in vSphere via Terraform

Hi everyone,

I’m currently facing an issue while automating the VM creation process in vSphere using Terraform with an Ubuntu 24.04 LTS template. Despite having the “Connect on boot” flag set in the Packer template, the VMs created via Terraform do not have this flag enabled. This issue causes the provisioning process to fail at later stages.

Details:

  • VM Template: Ubuntu 24.04 LTS
  • Tools Used: vSphere, Terraform, Packer
  • Issue: “Connect on boot” flag not set on VMs created via Terraform

Process:

  1. Template Creation: I created a Packer template for Ubuntu 24.04 LTS and ensured that the “Connect on boot” flag is set.
  2. Terraform Script: Used this template in my Terraform script to automate the VM creation process.
  3. VM Creation: The VM is successfully created and booted, but the “Connect on boot” and/or “Connected” flags for the network adapter are not set.
  4. Manual Creation: If I manually create a VM from the same template in vSphere, the flags are correctly set as expected.

Problem:

When the VM is created via Terraform:

  • The “Connect on boot” and “Connected” flags for the network adapter are not set.
  • As a result, subsequent provisioning steps fail due to network connectivity issues.

Additional Information:

The exact workflow has worked flawlessly with Ubuntu 22.04 LTS and 20.04 LTS. So I am a bit confused as to why it suddenly stopped working with 24.04 LTS.