[PVE 9.x/ZFS-backed VM storage] Support for Using RAW Files instead of zVols for VM disks?

Sep 1, 2022
521
197
53
42
Hello,

I am aware that some users prefer to use RAW files instead of zVols when setting up virtual disks for VMs. As far as I can see, PVE currently only supports using zVol-based virtual disks (which are somewhat confusingly called RAW storage compared to, e.g., qcow2 virtual disks).

Is there a supported way to use RAW files in place of zVols, or is this an unsupported configuration? (I realize there's nothing in the GUI).

If it is unsupported, are there any (even nebulous) plans to evaluate RAW file-based VM disks in the future?
 
Hello,

I am aware that some users prefer to use RAW files instead of zVols when setting up virtual disks for VMs. As far as I can see, PVE currently only supports using zVol-based virtual disks (which are somewhat confusingly called RAW storage compared to, e.g., qcow2 virtual disks).

Is there a supported way to use RAW files in place of zVols, or is this an unsupported configuration? (I realize there's nothing in the GUI).

If it is unsupported, are there any (even nebulous) plans to evaluate RAW file-based VM disks in the future?
what is the benefit ? you'll have same performance but no snapshot and no replication support.
 
  • Like
Reactions: Johannes S
I'm actually facing the same dilemma. I tried to use zvols in the past and had serious performance issues:
https://github.com/openzfs/zfs/issues/11407
Back then I worked around the issue by creating ZFS filesystems by hand and putting Directory storage on them. Consequently all VM/CT disks use this Directory backend and all disks are raw files in the zfs filesystems.

Although supposedly those issues were at least somewhat alleviated by https://github.com/openzfs/zfs/commit/6f73d02168ea4d4c27e95d3f23df7221c7321e07 which should have been in release 2.2.0, I haven't tested it since.

I currently have a PVE8 single node to which I'm adding a new node in order to replicate the existing ZFS datasets. The problem is that all the VMs and containers have disks on "Directory" storage, which isn't recognized as ZFS and so can't be replicated by PVE, so I have to use syncoid in combination with my own custom script to periodically replicate the zfs filesystems that contain the "Directory" storage to the other node.

I'm not sure how to configure the storage on the new node, as it should be a standby node that I can manually run the VMs and containers when the primary node fails, and how to tell PVE that they can run on either node, and that the underlying storage is being replicated by other means across nodes (I see there is a option to select "Shared storage" for a storage directory, maybe this?)

If there was a way to create ZFS storage in PVE and tell it to use a filesystem with raw files instead of zvols for its backend, migrating my existing disks to this new storage would be easy, as I could simply move the raw files from the old to the new storage. If I have to change all disks to zvols, I have to copy over the entire contents of each disk manually into new zvols. I don't think doing this is worth it at this time, I'll rather use manual syncoid replication and
manually manage the VM/CT failover without migration.