How do you attach a disk to a VM?

Red Squirrel

Renowned Member
May 31, 2014
50
9
73
Seems this should be something simple to do but can't seem to find the option anywhere. I want to create my disks manually so I can preallocate them as there does not seem to be an option to do that while creating the VM, but I also see no option to add the disks. Is there a way to do this?
 
Figured it out, looks like you have to edit /etc/pve/qemu-server/xxx.conf where xxx is vm number. Would be nice if there was a way through the gui to do it though.
 
you do not have to edit the file manually, you can use the api/cli

Code:
pvesm alloc <storage> <vmid> <filename> <size>

allocates a new disk

and with
Code:
qm set ID -scsiX 'storage:volumeid'

you can attach it
 
  • Like
Reactions: Spirog