How does vzdump+snapshot work with zfs storage?

dswartz

Renowned Member
Dec 13, 2010
286
9
83
So I created a storage of type 'ZFS'. I have confirmed that virtual disks created there (raw or qcow2) are being created as zvols. If I manually take a snapshot of such a guest, it creates a ZFS snapshot on that zvol. That makes sense. If I then back up this guest, and specify 'snapshot' mode, while the backup is running, 'zfs list -t snapshot' does not show any snapshots related to the backup. I understand qcow2 supports its own snapshots, but how does proxmox snapshot a raw disk on ZFS storage?
 
first:
with vzdump we do not make storage snapshots, but rely on qemus drive-backup feature, because it works on all storages

second:
what do you mean your raw/qcow2 files get created as zvols?
if you use the (correct) zfspool plugin, you cannot choose the format, because zvols are block devices and not files

qcow2 on top of zfs will severely degrade the performance
 
1. Okay, thanks.

2. I wasn't clear. I used the standard zfspool plugin, so the virtual disks are being created as zvols. I didn't intend to refer to qcow2 at all, sorry... I am in fact running raw on the zvols. I was just curious how they get snapshotted for backups.
 
Hello,

I have the same question as dswartz with vzbackup+zfs+mode: snapshot.

I managed to do atomic snapshots of virtual hard drives stored on zvol with the web GUI, tab "Snapshots", and zfs list -t snapshot shows them.

For a hard disk stored on a zvol, I understand that backup modes "Suspend" and "Stop" do the necessary to stop write operations during the backup. That sounds good but I'd like to reduce downtime.

But how is "Mode: snapshot" doing to stop write operations during the backup?
You mentioned "qemu drive-backup feature" but in my humble understanding, virtual hard disks stored on zvols are seen by qemu as raw block devices unable to self-snapshot like qcow2. I first thought that a ZFS snapshot would be taken and then backed up, but I was wrong.

Is "qemu drive-backup" feature usable without vzdump ? Is it able to keep write operations in memory during the backup, and then commit them ?

Thank you a lot for this astonishing piece of software
 
One thing that is important here is the fsfreeze. In case you installed the QEMU guest agent inside your VM and enabled it in the VMs options tab then PVE will tell the VM to do a fsfreeze where the guest will flush all caches for data consistency so async writes won't be lost. As far as I understand, PVE will then cache and hold back all new writes while backing up the virtual disks and only allow writes from cache to disk for blocks that already got backed up.
 
Last edited: