How do I manually move VM disks (zvols) from one pool to another and update them in Proxmox?

Replicant

Member
May 31, 2021
11
4
8
42
I have two pools, pool1 and pool2 and proxmox sees them as ZFS storages. I have previously used the GUI to transfer vm disks between these pools. Currently vm disks are on pool2.

I need to destroy pool2 and recreate it because it was made with incorrect properties. Therefore I need to transfer vm disks elsewhere. Although I can transfer them to pool1 temporarily, it is over 80% full and I read that ZFS starts exhibiting performance degradations once over certain capacities. Although I can guarantee the pool will not be written to until the zvols are copied to it then removed from it, not knowing how ZFS works, I don't want to "taint" it somehow by doing this.

Since pool2 is ZFS RAID10, I was considering breaking it apart into one existing ZFS RAID0 and a new RAID0, do the juggling between these, destroy the old RAID0, then reattach the disks to become a RAID10 again.

I would like to know which commands that PVE GUI uses internally to move zvols between pools, and which files to update to point to the new vm disks.
 
Last edited:
Seems like you are overthinking this a bit. Why not just backup the VMs on pool2 to separate storage / PBS, rebuild pool2 with proper settings, and restore the VMs? If you're worried about downtime, downgrading to a RAID0 is going to leave you at risk.
 
  • Like
Reactions: justinclift
@Replicant Are you ok with turning off the VM's while you're doing any moving? ie they don't need to remain on meanwhile

If you are, then the easiest approach would be to use the zfs send and zfs recv commands to copy each VM disk between the pools.

For example, lets say you have a VM numbered 400 with only a single disk, first shut it down (to keep things simple) then:

1. Create a brand new ZFS snapshot of the VM disk

Bash:
# zfs snapshot pool2/data/vm-400-disk-0@snap1

Note - the snapshot creation is only needed for the copy (send/recv), and can be removed after the copy is finished.

2. Copy the VMs disk from pool2 to pool1

Bash:
# zfs send -R pool2/data/vm-400-disk-0@snap1 | zfs recv pool1/data/vm-400-disk-0

3. (Optionally) Delete the 'snap1' snapshot, which isn't needed any more

Bash:
# zfs destroy pool1/data/vm-400-disk-0@snap1

You now have a bit perfect copy of that volume on pool1, including any snapshots that you've created of it.

If you want to verify the copy is good, you can directly edit the text file with the VM definition (/etc/pve/qemu-server/400.conf), changing all of the 'pool2' references to 'pool1' then start the VM. Of course, make a backup of that text file first, just to be super safe. :)

The above commands only work on a single disk volume at a time though. So for multiple VMs and disks, you'll need to do each of them one at a time. It works reliably though.
 
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!