Reputation: 3900
I'm trying to spin up a pretty basic cloud-init-provisioned VM using Proxmox 7.0-8. I've written the YAML (and validated it using the cloud-init tool) to do nothing more than create a user with an SSH key associated.
I'm starting with a template (id 1000) and creating my VM as follows
root@pve:~# qm config 1000
agent: 1
boot: c
bootdisk: virtio0
cores: 2
hotplug: disk,network,usb
ide2: local-lvm:vm-1000-cloudinit,media=cdrom
memory: 4096
name: ubuntu-impish-cloudinit
net0: virtio=7A:00:B5:A4:94:F8,bridge=vmbr0
scsihw: virtio-scsi-pci
serial0: socket
smbios1: uuid=bd772092-d7eb-4ac1-b0b3-e22782c7fa5f
sockets: 1
template: 1
vcpus: 1
vga: qxl
virtio0: local-lvm:base-1000-disk-0,size=32G
vmgenid: 816cba87-f348-46a9-a85d-c0781d8b605c
root@pve:~# qm clone 1000 101 --name test
create full clone of drive ide2 (local-lvm:vm-1000-cloudinit)
Logical volume "vm-101-cloudinit" created.
create linked clone of drive virtio0 (local-lvm:base-1000-disk-0)
Logical volume "vm-101-disk-0" created.
# Ignore the name of the file - it's the eventual use case but for now only does
# very simple things
root@pve:~# qm set 101 --cicustom "user=snippets:snippets/cloud_init_k8s_worker.yml"
update VM 101: -cicustom user=snippets:snippets/cloud_init_k8s_worker.yml
# Confirm the snippet is found
root@pve:~# pvesm list snippets
Volid Format Type Size VMID
snippets:snippets/cloud_init_k8s_worker.yml snippet snippets 803
root@pve:~# qm start 101
generating cloud-init ISO
root@pve:~# qm cloudinit dump 101 user
#cloud-config
hostname: test
manage_etc_hosts: true
chpasswd:
expire: False
users:
- default
package_upgrade: true
What am I missing here? I can find no errors anywhere, but the dumped cloudinit does not match the YAML I previously passed in (and is obviously different).
Upvotes: 0
Views: 1288
Reputation: 21
sudo qm config 8011 # my setup
# boot: c
# bootdisk: scsi0
# cores: 1
# ide2: local:8011/vm-8011-cloudinit.qcow2,media=cdrom
# memory: 1024
# meta: creation-qemu=7.0.0,ctime=1674616579
# name: debian11
# net0: virtio=52:61:A8:2E:0A:31,bridge=vmbr0
# scsi0: local:8011/vm-8011-disk-0.raw,size=32G
# scsihw: virtio-scsi-pci
# serial0: socket
# smbios1: uuid=acdgdf1b-c382-46ed-afa1-3eed8701fc53
# vga: serial0
# vmgenid: 9f24af13-9122-4ddf-bc45-248b094da4fa
# vga: qxl (I not able to make spice run on cloud-init image)
qm set 1000 --serial0 socket --vga serial0
Upvotes: 0