Is there a way to perform a "Move Disk" from the command line (Proxmox 3.4)?

Jan 12, 2015
94
2
28
I need to move the disks (on several Proxmox 3.4 hypervisors) of around 90 VMs (not containers) from local /var/lib/vz/ to a mounted iSCSI volume (/mnt/remote). I'd like to just setup a shell script as I need to move them back to /var/lib/vz after upgrading the hypervisor. Is there a command line utility to do this? Wondering if pvectl can be used for this somehow?
pvectl migrate <vmid> <target> [OPTIONS]

I can accomplish the same thing by using "Move Disk" menu under hardware, but it is cumbersome for more than a few machines. Thanks.
 
I need to move the disks (on several Proxmox 3.4 hypervisors) of around 90 VMs (not containers) from local /var/lib/vz/ to a mounted iSCSI volume (/mnt/remote). I'd like to just setup a shell script as I need to move them back to /var/lib/vz after upgrading the hypervisor. Is there a command line utility to do this? Wondering if pvectl can be used for this somehow?
pvectl migrate <vmid> <target> [OPTIONS]

I can accomplish the same thing by using "Move Disk" menu under hardware, but it is cumbersome for more than a few machines. Thanks.
use

Code:
qm move_disk <vmid> <disk> <storage> [OPTIONS]

For more details see
Code:
man qm
 
What's the best way to migrate the snapshots which accompany a VM?
Getting an error when using `-delete 1` when a VM has a snapshot:
"volume local:102/vm-102-disk-1.qcow2 have snapshots. Can't delete it"
 
delete the snapshots that reference this disk, then you can delete the disk.
 
I too was wondering if there is a way to move the disk for LXC containers via the CLI instead of the WebUI

EDIT: On Proxmox 6.2
 
Code:
man pct

-> pct move_volume
 

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!