[SOLVED] qm option to reattach unused disks

Although this is an old thread, I wanted to leave this useful tidbit:

Bash:
# 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]

[edit]

This command doesn't reattach, it adds the disks to your Hardware, where you can reattach by simply double clicking and "Add"ing.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!