Moving all disks to new Storage

Younex

Well-Known Member
Jan 30, 2018
92
21
48
43
Hi,

Sometimes i need to move all disk of each VM to new storage in order to maintenance on SAN.

I do this by clicking manually trough each VM and move each disk.

Is there any command to move all existing disks on one storage to another?

Thanks!

Kind Regards
 
Last edited:
There is no single command that moves all disks of a given VM to another storage. You should write a script that utilizes either API or CLI to automate things.
A very back of the napkin example:
Code:
for vmid in 2000 2001;do for disk in $(pvesm list blockbridge1 --vmid $vmid|egrep -v Volid|awk '{print $1}');do echo qm move-disk $vmid $disk blockbridge2;done;done
qm move-disk 2000 blockbridge1:vm-2000-cloudinit blockbridge2
qm move-disk 2000 blockbridge1:vm-2000-disk-0 blockbridge2
qm move-disk 2001 blockbridge1:vm-2001-cloudinit blockbridge2
qm move-disk 2001 blockbridge1:vm-2001-disk-0 blockbridge2


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 

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!