# qm rescan <VMID>
qm set <VMID> --scsi[n] local-zfs:vm-<VMID>-disk-[n],discard=on
This one does not work for me:# qm rescan <VMID>
This one workedThanks Dietmar,
Digging through the "qm" manual, I ended up using "qm set" instead. The "qm rescan" did not reattach the unused disk as useable again.
Code:qm set <VMID> --scsi[n] local-zfs:vm-<VMID>-disk-[n],discard=on
# The help command is informative
$ qm help rescan
USAGE: qm rescan [OPTIONS]
Rescan all storages and update disk sizes and unused disk images.
-dryrun <boolean> (default=0)
Do not actually write changes out to VM config(s).
-vmid <integer> (1 - N)
The (unique) ID of the VM.
# Using this we can construct the rescan command with a dryrun to doublecheck
$ qm rescan --vmid [id] --dryrun
VM XXX add unreferenced volume 'storage:XXX/vm-XXX-disk-0.qcow2' as 'unused0' to config
# Now the real command
$ qm rescan --vmid [id]
We use essential cookies to make this site work, and optional cookies to enhance your experience.