HA Storage VMs in front of FC/iSCSI/NVMe-oF SAN

alma21

Member
May 4, 2024
85
44
23
Hi,

the idea is to have 2 Storage VMs in a dedicated pacemaker/corosync cluster which re-exports the SAN block storage via NFS, ZFS over iSCSI or LVMThin over iSCSI back to the PVE cluster nodes

why ? - beside cluster file systems like GFS2/OCFS2 there are imho not many working open source solutions which support thin provisioning, snapshots and HA on SANs in a storage vendor agnostic / PVE (host) centric way

Please correct me if I'm wrong in the following statements/configs ! this is a draft/evaluation - don't run in production !


sample setup:
- 2 PVE node cluster + qdevice - existing storage: iSCSI SAN
- 2 x 25Gbit per PVE node via DAC connected - switchless (for frontend protocol traffic)
- for more then 2 PVE nodes in a cluster -> 10Gbit/25Gbit switch
- Storage VM corosync on the same link(s) as for PVE corosync + the same qdevice can be used/configured as for the PVE cluster
- 2 (e.g.) Debian/Ubuntu Storage VMs running on 2 PVE nodes - only one Storage VM may run on 1 PVE node at any time
- the Storage VMs get access to the shared SAN LUN(s) - there are multiple access possibilities at least for iscsi backend -> tbd: direct LUN access, LUN(scsi) passthru, shared thick LV + multipath
- pacemaker/corosync Storage VM cluster configured


front end protocol to the PVE nodes:

Concept 1 - NFS (kernel) server within Storage VM HA cluster

pros:
- already existing PVE NFS client/plugin
- together with qcow2 file format it provides thin provisioning and snapshots
- easy to setup and configure with pacemaker for HA
- fast cluster failover possible (within seconds - depending on workload and for v3 only)
- good documentation especially in combination with pacemaker clusters
- works with nearly every Linux filesystem

cons:
- only working in active/passive mode ... it's not possible to run 2 or more NFS (kernel) instances on one node (without special configs and containers) -> ev. solution: NFS Ganesha (user space) for active/active instances/storage pools
- NFS v4.x not really cluster/failover friendly (see grace/lease periods) - so focus on "legacy" NFSv3 and therefore no session trunking and other new v4.x features available
- bridging/converting a block storage protocol to NFS can maybe slower then iscsi <-> iscsi ... tbc
- internal qcow2 snapshots can freeze VMs during snapshot creation/deletion but with snapshots as volume chains this should be solved
- only sync option is save - which costs performance




Concept 2 - ZFS over iSCSI server within Storage VM HA cluster

pros:
- nearly all the power and features of ZFS but in a shared HA storage config .... thin provisioning, performant snapshots, compression - you name it ....
- iSCSI as front-end protocol - ev. more performant then NFS ... but with ZFS as file backend and sync=always not the case anymore ?!
- already existing/integrated PVE plugin
- multiple ZFS over iSCSI instances / Pools possible ("active/active")

neutral:
- ZFS over iSCSI works currently only with LIO as (Linux) iSCSI backend ... all other backends are obsolete .. SPDK or SCST would be interesting extensions to the plugin

cons:
- you have to run ZFS inside the VM .... at least from a performance view it needs more resources then other filesystems
- the ZFS over iSCSI "SSH API" is not compatible with the way pacemaker handles LIO configuration via resource agents - it's resolvable but needs more investigation
- not a real API existing ... ssh via root + shell commands to the VM Storage server(s)
- no multipathing in the QEMU iscsi initiator available
- imho would only make sense with dedicated NVMe/SSD SLOGs on the SAN -> sync=always necessary
- ZFS can detect but cannot automatically heal corrupted file blocks without ZFS mirror or parity disks/LUNs




Concept 3 - LVMThin over iSCSI server within Storage VM HA cluster

pros:
- the lightweight and maybe more performant version to ZFS over iSCSI

cons:
- less features then ZFS but extendable with different dm-targets
- no PVE Storage plugin exists currently - feature request sent - could work similiar as ZFS over iSCSI plugin with LIO and LVM(thin)
- see also the other cons on ZFS over iSCSI (multipath, ssh API)
 
Last edited:
the idea is to have 2 Storage VMs in a dedicated pacemaker/corosync cluster which re-exports the SAN block storage via NFS, ZFS over iSCSI or LVMThin over iSCSI back to the PVE cluster nodes
Hey @alma21,

If you think it will work for your use case, go for it. Once you've worked through all the edge cases, perhaps it will be useful to someone else as well. I see the main applicability being in an advanced home-lab environment where there are no strict production requirements. The reason is simple: you're effectively running a cluster inside a cluster.

To be direct, this approach has been tried before. Perhaps something along these lines already exists in some form of completeness on GitHub, so this isn't exactly a novel concept.

That said, it sounds like a good exercise in learning more about storage, networking, and clustering. Go for it.

Cheers.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Concept 1 is possible (even active active using NFS-Ganesha.) The trouble is NFS is... touchy in pve use, but that could have been due to the storage choices I implemented when coming to that conclusion.

for concept 2 you'd need a way to cluster your zfs front ends to avoid clobbering. NOT TRIVIAL; I have given up trying this many years ago.

for concept 3- see https://forum.proxmox.com/threads/c...shared-disk-filesystem-for-proxmox-ve.187212/
They're probably further ahead in this wheel reinvention.

No matter which approach you do take, please post. it will undoubtedly be interesting.
 
For concept two, there are/were at least two projects, one opensource and one paid that claim them solved this. They showed up on my radar over the years and someone from the paid one presented it here on the forums a few years back. I have no idea how mature those are or what type of enterprise support each of them provides.
 
Hi,

the idea is to have 2 Storage VMs in a dedicated pacemaker/corosync cluster which re-exports the SAN block storage via NFS, ZFS over iSCSI or LVMThin over iSCSI back to the PVE cluster nodes

why ? - beside cluster file systems like GFS2/OCFS2 there are imho not many working open source solutions which support thin provisioning, snapshots and HA on SANs in a storage vendor agnostic / PVE (host) centric way

Please correct me if I'm wrong in the following statements/configs ! this is a draft/evaluation - don't run in production !


sample setup:
- 2 PVE node cluster + qdevice - existing storage: iSCSI SAN
- 2 x 25Gbit per PVE node via DAC connected - switchless (for frontend protocol traffic)
- for more then 2 PVE nodes in a cluster -> 10Gbit/25Gbit switch
- Storage VM corosync on the same link(s) as for PVE corosync + the same qdevice can be used/configured as for the PVE cluster
- 2 (e.g.) Debian/Ubuntu Storage VMs running on 2 PVE nodes - only one Storage VM may run on 1 PVE node at any time
- the Storage VMs get access to the shared SAN LUN(s) - there are multiple access possibilities at least for iscsi backend -> tbd: direct LUN access, LUN(scsi) passthru, shared thick LV + multipath
- pacemaker/corosync Storage VM cluster configured


front end protocol to the PVE nodes:

Concept 1 - NFS (kernel) server within Storage VM HA cluster

pros:
- already existing PVE NFS client/plugin
- together with qcow2 file format it provides thin provisioning and snapshots
- easy to setup and configure with pacemaker for HA
- fast cluster failover possible (within seconds - depending on workload and for v3 only)
- good documentation especially in combination with pacemaker clusters
- works with nearly every Linux filesystem

cons:
- only working in active/passive mode ... it's not possible to run 2 or more NFS (kernel) instances on one node (without special configs and containers) -> ev. solution: NFS Ganesha (user space) for active/active instances/storage pools
- NFS v4.x not really cluster/failover friendly (see grace/lease periods) - so focus on "legacy" NFSv3 and therefore no session trunking and other new v4.x features available
- bridging/converting a block storage protocol to NFS can maybe slower then iscsi <-> iscsi ... tbc
- internal qcow2 snapshots can freeze VMs during snapshot creation/deletion but with snapshots as volume chains this should be solved
- only sync option is save - which costs performance




Concept 2 - ZFS over iSCSI server within Storage VM HA cluster

pros:
- nearly all the power and features of ZFS but in a shared HA storage config .... thin provisioning, performant snapshots, compression - you name it ....
- iSCSI as front-end protocol - ev. more performant then NFS ... but with ZFS as file backend and sync=always not the case anymore ?!
- already existing/integrated PVE plugin
- multiple ZFS over iSCSI instances / Pools possible ("active/active")

neutral:
- ZFS over iSCSI works currently only with LIO as (Linux) iSCSI backend ... all other backends are obsolete .. SPDK or SCST would be interesting extensions to the plugin

cons:
- you have to run ZFS inside the VM .... at least from a performance view it needs more resources then other filesystems
- the ZFS over iSCSI "SSH API" is not compatible with the way pacemaker handles LIO configuration via resource agents - it's resolvable but needs more investigation
- not a real API existing ... ssh via root + shell commands to the VM Storage server(s)
- no multipathing in the QEMU iscsi initiator available
- imho would only make sense with dedicated NVMe/SSD SLOGs on the SAN -> sync=always necessary
- ZFS can detect but cannot automatically heal corrupted file blocks without ZFS mirror or parity disks/LUNs




Concept 3 - LVMThin over iSCSI server within Storage VM HA cluster

pros:
- the lightweight and maybe more performant version to ZFS over iSCSI

cons:
- less features then ZFS but extendable with different dm-targets
- no PVE Storage plugin exists currently - feature request sent - could work similiar as ZFS over iSCSI plugin with LIO and LVM(thin)
- see also the other cons on ZFS over iSCSI (multipath, ssh API)
Hello,

Have a look at OviOS Linux, a ZFS based storage OS with tools like replication, HA cluster (active -passive) and also provides a native proxmox plugin for ZFS over iSCSI.

See automatic failover in action (video): https://www.youtube.com/watch?v=pYpLJ3tOaJk
Failover test report (3-node cluster, iSCSI/SMB/NFS): https://ovios.org/pages/report_failover.html
Technical resources: https://ovios.org/pages/resources.html
Docs: https://ovios.org/pages/docs.html
 
Last edited:
  • Like
Reactions: alma21
Hi,

the idea is to have 2 Storage VMs in a dedicated pacemaker/corosync cluster which re-exports the SAN block storage via NFS, ZFS over iSCSI or LVMThin over iSCSI back to the PVE cluster nodes

why ? - beside cluster file systems like GFS2/OCFS2 there are imho not many working open source solutions which support thin provisioning, snapshots and HA on SANs in a storage vendor agnostic / PVE (host) centric way

Please correct me if I'm wrong in the following statements/configs ! this is a draft/evaluation - don't run in production !


sample setup:
- 2 PVE node cluster + qdevice - existing storage: iSCSI SAN
- 2 x 25Gbit per PVE node via DAC connected - switchless (for frontend protocol traffic)
- for more then 2 PVE nodes in a cluster -> 10Gbit/25Gbit switch
- Storage VM corosync on the same link(s) as for PVE corosync + the same qdevice can be used/configured as for the PVE cluster
- 2 (e.g.) Debian/Ubuntu Storage VMs running on 2 PVE nodes - only one Storage VM may run on 1 PVE node at any time
- the Storage VMs get access to the shared SAN LUN(s) - there are multiple access possibilities at least for iscsi backend -> tbd: direct LUN access, LUN(scsi) passthru, shared thick LV + multipath
- pacemaker/corosync Storage VM cluster configured


front end protocol to the PVE nodes:

Concept 1 - NFS (kernel) server within Storage VM HA cluster

pros:
- already existing PVE NFS client/plugin
- together with qcow2 file format it provides thin provisioning and snapshots
- easy to setup and configure with pacemaker for HA
- fast cluster failover possible (within seconds - depending on workload and for v3 only)
- good documentation especially in combination with pacemaker clusters
- works with nearly every Linux filesystem

cons:
- only working in active/passive mode ... it's not possible to run 2 or more NFS (kernel) instances on one node (without special configs and containers) -> ev. solution: NFS Ganesha (user space) for active/active instances/storage pools
- NFS v4.x not really cluster/failover friendly (see grace/lease periods) - so focus on "legacy" NFSv3 and therefore no session trunking and other new v4.x features available
- bridging/converting a block storage protocol to NFS can maybe slower then iscsi <-> iscsi ... tbc
- internal qcow2 snapshots can freeze VMs during snapshot creation/deletion but with snapshots as volume chains this should be solved
- only sync option is save - which costs performance




Concept 2 - ZFS over iSCSI server within Storage VM HA cluster

pros:
- nearly all the power and features of ZFS but in a shared HA storage config .... thin provisioning, performant snapshots, compression - you name it ....
- iSCSI as front-end protocol - ev. more performant then NFS ... but with ZFS as file backend and sync=always not the case anymore ?!
- already existing/integrated PVE plugin
- multiple ZFS over iSCSI instances / Pools possible ("active/active")

neutral:
- ZFS over iSCSI works currently only with LIO as (Linux) iSCSI backend ... all other backends are obsolete .. SPDK or SCST would be interesting extensions to the plugin

cons:
- you have to run ZFS inside the VM .... at least from a performance view it needs more resources then other filesystems
- the ZFS over iSCSI "SSH API" is not compatible with the way pacemaker handles LIO configuration via resource agents - it's resolvable but needs more investigation
- not a real API existing ... ssh via root + shell commands to the VM Storage server(s)
- no multipathing in the QEMU iscsi initiator available
- imho would only make sense with dedicated NVMe/SSD SLOGs on the SAN -> sync=always necessary
- ZFS can detect but cannot automatically heal corrupted file blocks without ZFS mirror or parity disks/LUNs




Concept 3 - LVMThin over iSCSI server within Storage VM HA cluster

pros:
- the lightweight and maybe more performant version to ZFS over iSCSI

cons:
- less features then ZFS but extendable with different dm-targets
- no PVE Storage plugin exists currently - feature request sent - could work similiar as ZFS over iSCSI plugin with LIO and LVM(thin)
- see also the other cons on ZFS over iSCSI (multipath, ssh API)

this is the only way I would do it for production: https://github.com/ciroiriarte/pve-FCLUPlugin

I've parked development waiting for PVE developers feedback, for the time being it's tested with Hitachi FC storage.
It's the direction major virtualization platforms have followed to consume centralized storage services: Openstack, Openshift, vSphere (until they killed VVols to push harder on VSAN)
 
Hi @alexskysilk ,

thanks for your feedback ....
Concept 1 is possible (even active active using NFS-Ganesha.) The trouble is NFS is... touchy in pve use, but that could have been due to the storage choices I implemented when coming to that conclusion.
I have only tried it (NFS kernel & xfs) in a small test environment ... it works , but not stress tested .... at least it's officially documented also on RHEL and some other distros. ...no ZFS because imho ZFS brings not much value add here without a proper PVE "ZFS over NFS" plugin which is not existing .. and running qcow2 on zfs ... not ideal
for concept 2 you'd need a way to cluster your zfs front ends to avoid clobbering. NOT TRIVIAL; I have given up trying this many years ago.
still not tested ... but not clear to me why a zpool HA cluster should be more complicated then a NFS/LVM/XFS cluster in concept1 ... there is an existing pacemaker ZFS resource agent (RA) which handles cluster wide zpool import /export / coordination .... assumed the zpool RA works as expected there is no difference as in handling other filesystems within pacemaker ....

for concept 3- see https://forum.proxmox.com/threads/c...shared-disk-filesystem-for-proxmox-ve.187212/
They're probably further ahead in this wheel reinvention.
"new" concept 4 for me ... cluster FS like ocfs2/gfs2 .. another beast
 
  • Like
Reactions: AzharAbbasPK
why ? - beside cluster file systems like GFS2/OCFS2 there are imho not many working open source solutions which support thin provisioning, snapshots and HA on SANs in a storage vendor agnostic / PVE (host) centric way

Please correct me if I'm wrong in the following statements/configs ! this is a draft/evaluation - don't run in production !

https://cetrafs.com/

I'm sure it will impress you.
Very young, but now very robust and fast.
 
  • Like
Reactions: alma21
ZFS doesnt come into play here from the host end. from the storage server end you can certainly serve nfs on zfs.
and running qcow2 on zfs ... not ideal
This is a problem that isnt unique to zfs. Many storage solutions are CoW underneath, which means qcow2 volumes will suffer from write amplification. When it doubt, just use raw.
med the zpool RA works as expected there is no difference as in handling other filesystems within pacemaker ....
The issue isnt pacemaker or quorum keeping. ZFS is a storage system, not just a simple block device. as such, you need to account for arc, and even more importantly the intent log. There is no mechanism present to keep those synchronized across multiple initiators. From a practical standpoing this is a nonstarter.
 
ZFS doesnt come into play here from the host end. from the storage server end you can certainly serve nfs on zfs.
yes correct .. maybe misunderstanding

When it doubt, just use raw.
... but then you have no snapshot and thin provisioning integration with NFS / raw / PVE
The issue isnt pacemaker or quorum keeping. ZFS is a storage system, not just a simple block device. as such, you need to account for arc, and even more importantly the intent log. There is no mechanism present to keep those synchronized across multiple initiators. From a practical standpoing this is a nonstarter.
ARC is a read cache ... you will have a performance hit (for a while) after pool failover but no data is lost.
for SLOG use a dedicated nvme volume on the shared storage or on an all flash array keep the default ZIL on the pool volume ... both can failover .... for all: sync=always is mandatory .
 
I started down the rabbit hole of explaining why the surface nuance of your conclusion is massively optimistic, but realised that it doesnt actually benefit anything, Dont let me dissuade you. There ARE companies that made this work (namely Nexenta but there are others.) Looking forward to reading of your success.
 
ARC is a read cache ... you will have a performance hit (for a while) after pool failover but no data is lost.
While data integrity is obviously the primary requirement for failover, consistent application performance is a very close second. Consider a banking system: a server failure should not cause ATM cash withdrawals to slow to a crawl simply because the storage cache needs to be rebuilt.

Cheers.


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