Comment 6 for bug 1739516

Revision history for this message
Jesse R (scronkfinkle) wrote :

@Chad thanks for writing back! Attached is the collect-logs output.

For terraform, we're using a provider to hook into our proxmox infrastructure. Under the hood, proxmox is calling QEMU to manage the virtual machines. I installed `qemu-guest-agent` to the cloud-init image using `virt-customize` from the `libguestfs-tools` package.

On first boot, the hostname is successfully set, but it doesn't appear to be fast enough before networking is brought up.

To build an identical image to the one i'm using:
Download the cloudinit image
```
wget https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img
```

use `virt-customize` to install `qemu-guest-agent`
```
sudo virt-customize -a https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img --install qemu-guest-agent
```

From there, we upload it to proxmox and have it clone the image for VM's. I would imagine if one used regular Qemu or another provider with terraform the behavior would be the same.

Here's the output of `terraform apply`
```
module.greeks["attis"].proxmox_vm_qemu.basic_admin: Refreshing state... [id=aramis5/qemu/111]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # module.greeks["attis"].proxmox_vm_qemu.basic_admin will be created
  + resource "proxmox_vm_qemu" "basic_admin" {
      + additional_wait = 0
      + agent = 1
      + automatic_reboot = true
      + balloon = 0
      + bios = "seabios"
      + boot = "c"
      + bootdisk = "scsi0"
      + ciuser = "awx"
      + clone = "ubuntu-2004-cloudinit-terraform"
      + clone_wait = 0
      + cores = 4
      + cpu = "host"
      + default_ipv4_address = (known after apply)
      + define_connection_info = true
      + force_create = false
      + full_clone = true
      + guest_agent_ready_timeout = 100
      + hotplug = "network,disk,usb"
      + id = (known after apply)
      + ipconfig0 = "ip=dhcp"
      + kvm = true
      + memory = 8192
      + name = "attis"
      + nameserver = (known after apply)
      + numa = false
      + onboot = false
      + oncreate = true
      + os_type = "cloud-init"
      + preprovision = true
      + reboot_required = (known after apply)
      + scsihw = "virtio-scsi-pci"
      + searchdomain = (known after apply)
      + sockets = 1
      + ssh_host = (known after apply)
      + ssh_port = (known after apply)
      + sshkeys = "<trimmed>"
      + tablet = true
      + target_node = "aramis5"
      + unused_disk = (known after apply)
      + vcpus = 0
      + vlan = -1
      + vmid = (known after apply)

      + disk {
          + backup = 0
          + cache = "none"
          + discard = "on"
          + file = (known after apply)
          + format = (known after apply)
          + iothread = 0
          + mbps = 0
          + mbps_rd = 0
          + mbps_rd_max = 0
          + mbps_wr = 0
          + mbps_wr_max = 0
          + media = (known after apply)
          + replicate = 0
          + size = "32G"
          + slot = 0
          + ssd = 0
          + storage = "ceph-external"
          + storage_type = (known after apply)
          + type = "scsi"
          + volume = (known after apply)
        }

      + network {
          + bridge = "vmbr0"
          + firewall = false
          + link_down = false
          + macaddr = (known after apply)
          + model = "virtio"
          + queues = (known after apply)
          + rate = (known after apply)
          + tag = -1
        }
    }
```

`attis` is the desired hostname that we want for this particular machine