Can I add a manually created RBD image

jschwab

Member
Jan 23, 2023
5
0
6
I have a separately managed Ceph cluster with an RBD pool pve-vmdata that I use for VM disks. If I create on the Ceph cluster an image, with e.g. rbd create --size 1024 pve-vmdata/myimg, is it possible to add the image to a VM? Can I somehow scan for/detect the new image?
 
Proxmox VE expects the disk images named in a certain format: vm-{vmid}-...
If you create it with that naming scheme, you can run qm rescan --vmid {vmid} and it will search for disk images matching the naming scheme as unused disks to the VM.

If you need to use a name other than that, you should still be able to add it. Either by editing the config file of the VM directly, or by running something like qm set {vmid} --scsi{x} {storage name}:{disk image name}
 
Thank you for the help! Though it seems that even with qm set the images need a prefix of the form vm-{vmid}-. At least I get something like:

Code:
# qm set 235 --scsi1 ceph_rbd:myimg
unable to parse rbd volume name 'myimg'

But that's not a big issue. After renaming the image (rbd mv pve-vmdata/myimg pve-vmdata/vm-235-myimg), I can add it without issues.