Hi!
Learning to deploy machines with cloud init. I create the a machine with the following commands:
Everything works fine, and the template is created. Then I clone the template but:
1. The dhcp client is installed, but does not run in startup, i have to manually run it (dhclient)
2. Even when i do run it and it gets an IP, it looks like the DNS is not working (temporary failure on name resolution)
It is NOT a DHCP issue, the DHCP server runs perfectly fine for traditional, manually created virtual machines.
Am I missing something? Do i have to install additional packages on the image and enable dhclient on startup?
Thanks!
EDIT: Even more weird, resolv.conf is a symlink managed by systemd-resolved but systemd-resolved is not installed as a service...
EDIT2: I found a forum post that seemd to solve the issue...does not work for me: https://forum.proxmox.com/threads/debian-12-1-cloud-image-template-network-problem.131160/
Learning to deploy machines with cloud init. I create the a machine with the following commands:
Bash:
#!/bin/bash
# With this script we create an automated template
# Install all required tools
sudo apt update -y
sudo apt install libguestfs-tools -y
# Download image
sudo wget http://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2
# Install packages
sudo virt-customize -a debian-12-generic-amd64.qcow2 --install sudo,apt-transport-https,ca-certificates,curl,gnupg2,software-properties-common,qemu-guest-agent
# Users and changes
sudo virt-customize -a debian-12-generic-amd64.qcow2 --root-password password:superpassword
sudo virt-customize -a debian-12-generic-amd64.qcow2 --hostname phobos.lan
# Create the templates folder
sudo mkdir -p /var/lib/vz/template/qcow
sudo cp debian-12-generic-amd64.qcow2 /var/lib/vz/template/qcow/
# machine configuration
sudo qm create 9000 --name debian12-cloudinit --net0 virtio,bridge=vmbr0,tag=200 --scsihw virtio-scsi-pci
sudo qm set 9000 --scsi0 sdd-data:0,discard=on,ssd=1,format=raw,import-from=/var/lib/vz/template/qcow/debian-12-generic-amd64.qcow2
sudo qm disk resize 9000 scsi0 32G
sudo qm set 9000 --bios ovmf --efidisk0 sdd-data:1,format=raw,efitype=4m,pre-enrolled-keys=1
sudo qm set 9000 --boot c --bootdisk scsi0
sudo qm set 9000 --cpu host --cores 4 --memory 4096
sudo qm set 9000 --agent enabled=1
sudo qm set 9000 --ide2 sdd-data:cloudinit
sudo qm template 9000
Everything works fine, and the template is created. Then I clone the template but:
1. The dhcp client is installed, but does not run in startup, i have to manually run it (dhclient)
2. Even when i do run it and it gets an IP, it looks like the DNS is not working (temporary failure on name resolution)
It is NOT a DHCP issue, the DHCP server runs perfectly fine for traditional, manually created virtual machines.
Am I missing something? Do i have to install additional packages on the image and enable dhclient on startup?
Thanks!
EDIT: Even more weird, resolv.conf is a symlink managed by systemd-resolved but systemd-resolved is not installed as a service...
EDIT2: I found a forum post that seemd to solve the issue...does not work for me: https://forum.proxmox.com/threads/debian-12-1-cloud-image-template-network-problem.131160/
Last edited: