Hi,
I'm getting crazy to create a vm provisioned with cloud-init. Here is what i do:
The content of the /var/lib/zv/snippets/user.yaml
is
What i now expect is that the vm loads the user.yaml and setup the user/password. But nothing of this happens. I've also tried the same with ubuntu with this image.
In the "Cloud-Init" tab of the UI tells me, that no specific config is set:
while `qm config 300` looks like this:
What addition steps i have to to to get the vm provisioned as expected?
Best regards
Tina
I'm getting crazy to create a vm provisioned with cloud-init. Here is what i do:
Bash:
# create template
wget https://cloud.centos.org/centos/8/x86_64/images/CentOS-8-GenericCloud-8.2.2004-20200611.2.x86_64.qcow2
qm create 9000 --name centos-ci --memory 2048 --net0 virtio,bridge=vmbr0
qm importdisk 9000 CentOS-8-GenericCloud-8.2.2004-20200611.2.x86_64.qcow2 local-lvm
qm set 9000 --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-9000-disk-0
qm set 9000 --ide2 local-lvm:cloudinit
qm set 9000 --boot c --bootdisk scsi0
qm set 9000 --serial0 socket --vga serial0
qm template 9000
#create vm
qm clone 9000 300 --full true --name cli-test-cos --storage local-lvm
qm set 300 --cicustom user=local:snippets/user.yaml
qm start 300
The content of the /var/lib/zv/snippets/user.yaml
is
YAML:
chpasswd:
expire: False
users:
- k3s
passwd: "$5$=4096$utiyPEPcWUUEiS7O33k2tmFP55zf2rK7KEYGuZn3zf6"
sudo: "ALL=(ALL) NOPASSWD:ALL"
ssh_authorized_keys:
- "ssh-rsa AAAAB3NzaC1yc-....."
What i now expect is that the vm loads the user.yaml and setup the user/password. But nothing of this happens. I've also tried the same with ubuntu with this image.
In the "Cloud-Init" tab of the UI tells me, that no specific config is set:
while `qm config 300` looks like this:
Code:
boot: c
bootdisk: scsi0
cicustom: user=local:snippets/user.yaml
ide2: local-lvm:vm-300-cloudinit,media=cdrom,size=4M
memory: 2048
name: cli-test-cos
net0: virtio=F2:6D:2D:B3:87:C5,bridge=vmbr0
scsi0: local-lvm:vm-300-disk-0,size=10G
scsihw: virtio-scsi-pci
serial0: socket
smbios1: uuid=f7ab1f62-718c-4d70-9603-3c10858b7b6e
vga: serial0
vmgenid: a6520f50-d8ef-4ac4-8e68-ae80d48a0d6f
What addition steps i have to to to get the vm provisioned as expected?
Best regards
Tina
Last edited: