qemu-img create -f qcow2 -o compression_type=zstd /path/to/new/disk.qcow2 10G
# import qcow2 disk to an existing VM on a storage
qm importdisk VMID /path/to/new/disk.qcow2 STORAGEID
# create new VM through CLI:
qm create VMID --scsi0 "STORAGEID:0,import-from=/path/to/new/disk.qcow2" # remaining options
# add the disk to an existing VM as unused if its already on the correct place on a storage
# can then be attached as used disk via GUI
qm set VMID --unused0 "STORAGEID:VMID/disk.qcow2"
# import qcow2 disk to an existing VM on a storage
qm importdisk VMID /path/to/new/disk.qcow2 STORAGEID
No, but you can pass a target format. The command name also changed a bit, albeit there's an alias for backward compatibility.would it get converted automatically to raw format by default in the quoted part?
# import qcow2 disk to an existing VM on a storage as raw
qm disk import VMID /path/to/new/disk.qcow2 STORAGEID --format raw
yes, import will default toHi @t.lamprecht , would it get converted automatically to raw format by default in the quoted part?
raw
format (or more specifically the storage's default format, which is raw
for directory storages).You would need to explicitly specifyAnd then, depending on the use case use either
Bash:# import qcow2 disk to an existing VM on a storage qm importdisk VMID /path/to/new/disk.qcow2 STORAGEID # create new VM through CLI: qm create VMID --scsi0 "STORAGEID:0,import-from=/path/to/new/disk.qcow2" # remaining options
format=qcow2
for the above two. However, that still won't help, because those commands will allocate a new qcow2 image which doesn't have the zstd compression anymore and then copy/import the data from the old one.Code:# add the disk to an existing VM as unused if its already on the correct place on a storage # can then be attached as used disk via GUI qm set VMID --unused0 "STORAGEID:VMID/disk.qcow2"
After initial import/set/create you can use the web interface again to change options.