When creating a VM (using Clone from the GUI) it gets two DHCP-assigned IP addresses, one for `eth0` and one for an alias `enp0s18`.
The template is created from the latest Debian Cloud image (https://cloud.debian.org/images/cloud/bullseye/latest/#:~:text=debian-11-genericcloud-arm64.qcow2) to which I only added `qemu-guest-agent` using `virt-customize` and `virt-sysprep`. In the cloud-init parameters of the template created from that image I specify 'dhcp' for net0 in addition to the SSH key.
I use the following commands to create the template:
How can I get rid of this second IP address in the cloned VM's?
The template is created from the latest Debian Cloud image (https://cloud.debian.org/images/cloud/bullseye/latest/#:~:text=debian-11-genericcloud-arm64.qcow2) to which I only added `qemu-guest-agent` using `virt-customize` and `virt-sysprep`. In the cloud-init parameters of the template created from that image I specify 'dhcp' for net0 in addition to the SSH key.
I use the following commands to create the template:
Code:
qm create $VMID --name $TEMPL_NAME --memory $MEM --net0 virtio,bridge=$NET_BRIDGE
qm importdisk $VMID $IMG_NAME $DISK_STOR
qm set $VMID --scsihw virtio-scsi-pci --scsi0 $DISK_STOR:vm-$VMID-disk-0
qm set $VMID --ide2 $DISK_STOR:cloudinit
qm set $VMID --boot c --bootdisk scsi0
qm set $VMID --serial0 socket --vga serial0
qm set $VMID --ipconfig0 ip=dhcp
qm set $VMID --cores $CPU_CORES
qm resize $VMID scsi0 $DISK_SIZE
qm template $VMID
Last edited: