Hi,
we usually don't use the cli, as automations for proxmox goes through the API.
But as it seems a reproduceable walkthrough makes sense:
1. create through GUI a vm ( all default, just click next, select "do not use any media" in OS tab )
then things might look like this:
Code:
# qm config 120
boot: order=scsi0;ide2;net0
cores: 1
ide2: none,media=cdrom
memory: 2048
meta: creation-qemu=6.2.0,ctime=1657640276
name: test
net0: virtio=42:42:20:23:00:0C,bridge=vmbr0,firewall=1
numa: 0
ostype: l26
scsi0: ceph-hdd:vm-120-disk-0,size=32G
scsihw: virtio-scsi-pci
smbios1: uuid=1208f991-992c-403c-a80b-974a3826861c
sockets: 1
vmgenid: 5a72d82b-4dd6-459f-922c-a2c5518ea1d8
2. make a snapshot ( click take snapshot, give it the name "test" )
3. click hardware -> add -> cloud init drive ( place it on any storage )
at this point things here will look like:
Code:
# qm config 120
boot: order=scsi0;ide2;net0
cores: 1
ide0: ceph-hdd:vm-120-cloudinit,media=cdrom
ide2: none,media=cdrom
memory: 2048
meta: creation-qemu=6.2.0,ctime=1657640276
name: test
net0: virtio=42:42:20:23:00:0C,bridge=vmbr0,firewall=1
numa: 0
ostype: l26
parent: test
scsi0: ceph-hdd:vm-120-disk-0,size=32G
scsihw: virtio-scsi-pci
smbios1: uuid=1208f991-992c-403c-a80b-974a3826861c
sockets: 1
vmgenid: 5a72d82b-4dd6-459f-922c-a2c5518ea1d8
while
vm-120-cloudinit
vm-120-disk-0
will be existing on the storage. So far, so good.
Now
4. roll back the snapshot
which will result in the config to look like:
Code:
boot: order=scsi0;ide2;net0
cores: 1
ide2: none,media=cdrom
memory: 2048
meta: creation-qemu=6.2.0,ctime=1657640276
name: test
net0: virtio=42:42:20:23:00:0C,bridge=vmbr0,firewall=1
numa: 0
ostype: l26
parent: test
scsi0: ceph-hdd:vm-120-disk-0,size=32G
scsihw: virtio-scsi-pci
smbios1: uuid=1208f991-992c-403c-a80b-974a3826861c
sockets: 1
vmgenid: 56e4b48c-5f3d-414e-8c21-e05a3f58d6ee
as we can see, without cloudinit drive, just like it has to be.
But on the storage, we will still have:
vm-120-cloudinit
vm-120-disk-0
So the code did not tidy up the vm-120-cloudinit image.
And even worst:
5. click hardware -> add -> cloud init drive ( place it on the _same_ storage like before)
will result in:
Code:
rbd create 'vm-120-cloudinit' error: rbd: create error: (17) File exists (500)
----------------------------
The same can be reproduced on nfs backed storage, and i guess on all other storage types aswell.
There is no start of the vm involved. Its simply create -> take snapshot -> add cloud init drive -> rollback snapshot
which will not tidy up the cloud-init file on the storage. And the code refuse to overwrite existing ones.
And thats the bug. If this can not be reproduced in CLI, then its even worst if the backend treats the same functions in a different way.
Greetings
Oliver