Moving VM zVols to Datasets with Different Volblocksizes by Changing Storage Location within Proxmox: Effect?

Sep 1, 2022
240
46
33
40
Please forgive me if I don't use quite the right wording on this.

Setup:
  1. I've got a few different ZFS storages defined at the Datacenter level for storing VM disks, which are stored as zVols with a volblocksize property matching the "Block Size" set in the ZFS storage options within the Datacenter --> Storage panel.
  2. I created a VM, and gave it virtualdisk.zVol in zfsStore1, which has volblocksize A.
Question:

So, what happens if I move virtualdisk.zVol to zfsStore2, which has volblocksize B?

[I'm probably about to use the wrong terminology.]
I assume the zVol is actually copied to zfsStore2, so that the disk is recreated and uses volblocksize B. This would make the most sense to me, as it would allow for easy A/B performance tuning/testing (to try different volblocksizes for your workload).

Or, does something else happen? Does the zVol suddenly have two volbocksizes after it's moved?

I've not moved a working VM before, which is why I'm asking. I only have experience with restoring from vzDump backups, where the restored VM picks up the volblocksize of the place you restore it to.
 
Or, does something else happen? Does the zVol suddenly have two volbocksizes after it's moved?
Volblocksize is defined at time of creation and can not be changed later. So a single zvol can't mix two volblocksizes.
A restore will create a new zvol from scratch so the volblocksize of the storage you restore it on will be used.
When using replication it should keep the existing volblocksize. So the question would be if moving a disk will use ZFS replication or something not ZFS native to copy the content.
You should simply test it. Restore a VM using a new VMID to storage A. Run zfs get volblocksize to check the volblocksize. Use webUI to move virtual disk to storage B. Run zfs get volblocksize again and compare. Destroy the VM.
I'm quite sure (but didn't verified that yet) that the "move disk" is storage agnostic so the volblocksize of the target storage should be used.
 
Last edited:
  • Like
Reactions: SInisterPisces
Volblocksize is defined at time of creation and can not be changed later. So a single zvol can't mix two volblocksizes.
A restore will create a new zvol from scratch so the volblocksize of the storage you restore it on will be used.
When using replication it should keep the existing volblocksize. So the question would be if moving a disk will use ZFS replication or something not ZFS native to copy the content.
You should simply test it. Restore a VM using a new VMID to storage A. Run zfs get volblocksize to check the volblocksize. Use webUI to move virtual disk to storage B. Run zfs get volblocksize again and compare. Destroy the VM.
I'm quite sure (but didn't verified that yet) that the "move disk" is storage agnostic so the volblocksize of the target storage should be used.
Awesome summary. Thanks!

I'll definitely test it. For now I'm only interested in the "move disk" function (no need for restores yet). Just thought I'd pop in and make a thread later for anyone to find who is as easily confused as I am. :)
 

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!