I wanted to give an update to this with a fix for anyone else that runs into my particular issue. The first was that using `virt-customize` install `qemu-guest-agent` was setting `/etc/machine-id`. This caused dnsmasq to assign the same CLID to each VM. I assume that means it thought all the VM's were the same machine, requesting an IP on different interfaces. The way to fix that was to truncate the file after installation with
```
sudo virt-customize -a https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img --truncate /etc/machine-id
```
With that sorted out, I was also able to use nocloud to set the hostname properly on boot. I used the method of setting the SMBIOS serial. In terraform I was able to specify this as QEMU args like so
```
args = "-smbios type=1,serial=ds=nocloud-net;h=${var.name}"
```
where `var.name` was the hostname.
I wanted to give an update to this with a fix for anyone else that runs into my particular issue. The first was that using `virt-customize` install `qemu-guest-agent` was setting `/etc/machine-id`. This caused dnsmasq to assign the same CLID to each VM. I assume that means it thought all the VM's were the same machine, requesting an IP on different interfaces. The way to fix that was to truncate the file after installation with /cloud- images. ubuntu. com/focal/ current/ focal-server- cloudimg- amd64.img --truncate /etc/machine-id
```
sudo virt-customize -a https:/
```
With that sorted out, I was also able to use nocloud to set the hostname properly on boot. I used the method of setting the SMBIOS serial. In terraform I was able to specify this as QEMU args like so serial= ds=nocloud- net;h=$ {var.name} "
```
args = "-smbios type=1,
```
where `var.name` was the hostname.