Proposal/Discussion: Pure Storage ActiveDR / ActiveCluster integration with Site Recovery
I wanted to throw an idea out there and get some feedback on whether this fits with the direction of PegaProx Site Recovery and the plugin system.
Today I use PegaProx to manage multiple Proxmox clusters, and our primary storage is Pure FlashArray using the third-party Pure Storage plugin for Proxmox.
I've been thinking about building an integration/companion plugin that would allow PegaProx Site Recovery to understand storage replication that is already being handled by Pure Storage, specifically ActiveDR and ActiveCluster.
I haven't decided yet whether our eventual DR architecture will use ActiveDR, ActiveCluster, or potentially a combination depending on workload, so ideally I would like the design to accommodate both.
The general architecture would look something like:
PVE Cluster A PVE Cluster B
| |
Pure FlashArray A ================= Pure FlashArray B
| |
Pure PVE Plugin Pure PVE Plugin
ActiveDR or ActiveCluster
PegaProx
|
Site Recovery
With the Pure Proxmox plugin, each Proxmox VM disk is normally its own Pure volume, for example:
vm-107-disk-0
vm-107-disk-1
vm-108-disk-0
Pure can already handle replication of those volumes independently of Proxmox.
With ActiveDR, the volumes can be asynchronously replicated to the FlashArray at the recovery site.
With ActiveCluster, the volumes can be synchronously stretched between the two FlashArrays and potentially be available to Proxmox hosts at either site.
The missing piece is really the compute/orchestration layer.
The destination Proxmox cluster does not inherently know that a Pure volume on its array represents a disk belonging to a VM on another independent Proxmox cluster. The VM configuration itself also isn't replicated by the storage array.
My thought is that PegaProx could act as that missing orchestration layer.
Rather than PegaProx performing the actual VM disk replication, a Site Recovery plan could use an external/storage replication provider, with Pure Storage being one implementation.
Conceptually:
PegaProx Site Recovery
Replication Provider:
Pure Storage
Mode:
ActiveDR
or
ActiveCluster
PegaProx could maintain the pieces that the storage array doesn't know about:
- Source and destination Proxmox clusters
- Source and destination storage mappings
- VM configuration
- VM disk mappings
- Network mappings
- Boot groups/order
- VMID mapping/reservation
- Replication status
- Storage availability
- Recovery readiness
- Failover/failback state
For example:
VM 107
Source:
Cluster: PVE-PROD
Storage: pure-prod
Target:
Cluster: PVE-DR
Storage: pure-dr
Disks:
scsi0:
source: pure-prod:vm-107-disk-0
target: pure-dr:vm-107-disk-0
scsi1:
source: pure-prod:vm-107-disk-1
target: pure-dr:vm-107-disk-1
Replication Provider:
Pure Storage
Replication Mode:
ActiveDR
Status:
Healthy
RPO / replication lag:
...
The major advantage is that no VM disk data would need to pass through Proxmox or PegaProx during a recovery event.
The FlashArrays have already handled the data movement.
PegaProx would essentially manage the VM blueprint and recovery orchestration, while Pure manages the storage.
ActiveDR
ActiveDR seems like the simpler initial implementation because there is a very clear source and destination relationship.
A planned failover could theoretically look something like:
PegaProx readiness check
|
v
Verify Pure replication health
|
v
Shutdown VM on source PVE cluster
|
v
Ensure final replication is complete
|
v
Promote ActiveDR destination
|
v
Register/create VM configuration
on destination PVE cluster
|
v
Attach existing replicated Pure volumes
|
v
Apply network mappings
|
v
Start according to recovery plan
There would be no storage migration, restore, qemu-img copy, etc.
The target disks already exist.
This could potentially work very nicely with PegaProx test failover as well.
PegaProx could bring up the replicated VM at the DR site with disconnected NICs or mapped to an isolated test network, allowing a recovery plan to actually be tested without interfering with production.
ActiveCluster
ActiveCluster is potentially even more interesting to me and may ultimately be the architecture I use.
Something like:
PVE Cluster A PVE Cluster B
| |
Pure A ======== ActiveCluster ======== Pure B
| |
VM running here VM could recover here
Unlike a stretched Proxmox cluster, these would still be two independent Proxmox clusters.
Pure would synchronously maintain the VM storage, while PegaProx would understand which Proxmox cluster currently owns/runs the VM.
A planned migration/failover could potentially be:
VM 107 running on Cluster A
|
v
PegaProx shuts down VM 107
|
v
Verify source VM is stopped
and storage ownership is safe
|
v
Register/create VM 107
on Cluster B
|
v
Attach the existing ActiveCluster volumes
|
v
Apply network mapping
|
v
Start VM 107
Since the storage is synchronously replicated/stretched, there would effectively be zero disk copy during the recovery operation.
The biggest concern here is obviously fencing/split-brain.
Because Cluster A and Cluster B are independent Proxmox clusters, neither cluster's locking or HA system knows anything about the other one.
PegaProx, or the Pure integration, would therefore need a very strong concept of VM/storage ownership.
For example:
VM 107 ownership
Current owner:
PVE-PROD
Destination:
PVE-DR
PVE-DR activation:
BLOCKED
During a planned failover:
Verify VM stopped on PVE-PROD
|
v
Release/transfer ownership
|
v
Allow activation on PVE-DR
For an emergency failover, there would need to be stronger fencing/readiness checks before allowing the destination VM to start.
I would absolutely not want to simply have the same VM permanently registered and startable on both Proxmox clusters.
Instead I imagine PegaProx maintaining the VM configuration and only registering/activating it on the recovery cluster when a recovery operation is actually initiated.
Where I think the Pure Proxmox plugin fits
I don't think the Pure Proxmox storage plugin itself should become responsible for Site Recovery.
Ideally it continues doing what it does well:
Proxmox
|
Pure Storage Plugin
|
FlashArray
and handles things such as:
- Volume discovery
- iSCSI presentation
- Host/volume connections
- Multipath
- Volume activation/deactivation
- Pure pod-aware volume naming
There may be some additional primitives or safety mechanisms needed in the Pure plugin for this use case.
For example, a replicated volume at the recovery site should probably be protected from accidentally being destroyed by the destination Proxmox cluster.
There may also be value in being able to explicitly identify a volume as externally/replication managed.
But I would prefer for the actual DR state machine and orchestration to live within PegaProx rather than turning the storage plugin into a DR manager.
Potential generic provider model
Although Pure is the use case I want to build and test, I wonder if the underlying PegaProx architecture could be generic.
For example:
Site Recovery
Replication Provider:
- PegaProx/native replication
- External storage replication
- Pure ActiveDR
- Pure ActiveCluster
- future storage integrations
An external provider could potentially expose things like:
Get replication status
Get recovery point / RPO
Perform readiness check
Prepare destination
Promote destination
Demote source
Test recovery
Failback
Verify storage ownership
while PegaProx continues handling:
VM configuration
Proxmox API interaction
Storage mappings
Network mappings
Boot ordering
Recovery plans
Recovery history/auditing
I'm interested in prototyping this myself and would be happy to contribute the work upstream if this fits the project.
I also have access to actual Pure FlashArrays and Proxmox clusters, so I can test the workflow against real ActiveDR/ActiveCluster configurations rather than developing it purely against mocked APIs.
Before I get too far into building it, I'd mainly like some feedback from the PegaProx team on where you think this should live architecturally.
Would an external/storage replication provider fit naturally into the existing Site Recovery/plugin model?
Or would supporting something like Pure ActiveDR/ActiveCluster require changes to the core Site Recovery architecture?
I'm happy to start with a proof of concept once I understand where you would prefer that integration boundary to be.
This is a really well-framed proposal — thanks for drawing it out in that much detail.
The good news is it lines up closely with how Site Recovery already works under the hood, so it's a natural fit rather than a fight against the grain:
- Site Recovery doesn't move the disk bytes itself in the DR case. The emergency/auto-failover path assumes the VM's data is already present on the target — seeded ahead of time — and just handles the orchestration: powering the replica up on the target cluster, applying the storage/network mappings, honoring boot groups/order, and tracking failover/failback state. That "PegaProx owns the blueprint + orchestration, something else owns the data" split is exactly your model — ActiveDR/ActiveCluster would just be that something else.
- So conceptually the missing piece is a way to tell a plan "these VMs are replicated by an external provider, not by PegaProx," so failover uses the assume-present path and readiness/RPO reads the provider's status instead of a PegaProx replication job.
Where the two pieces would live:
- The Pure-specific part → a plugin. PegaProx has a plugin system (
plugins/with amanifest.json+ aregister(app)entry point;plugins/hello_worldis the minimal example, plus a background-task hook and per-plugin config). That's the right home for the FlashArray REST client, the array credentials, a poller for ActiveDR/ActiveCluster state, and any array-side ops — vendor code stays cleanly separated and independently shippable. - A small, vendor-neutral seam in Site Recovery core. Today the failover logic hardwires two branches (live-migrate vs. start-already-replicated). The clean change is a
replication_providerfield on the plan/VM plus a small dispatch so an "external" provider routes to the start-already-replicated path and feeds status in — via a neutralReplicationProvidercontract (replication state, last-sync/lag, RPO, storage availability, failover state) so Pure is one implementation and the door stays open for other arrays. There's a good in-tree template for the typed-config + dispatch shape already, and the existing rbd/zfs replication split is basically the same idea waiting to be formalized.
A couple of honest caveats worth scoping up front:
- ActiveDR maps cleanly onto the existing assume-present path — I'd start there.
- ActiveCluster is trickier: a synchronously stretched volume live at both sites changes the failover semantics (less "start the replica," more "it's already there on both," plus VMID/lock coordination across two clusters seeing the same storage). Very doable, but a good second phase rather than landing both at once.
- PegaProx has no model of array-side volume identity (LUN/serial/WWN) today — it thinks in Proxmox storages and
vm-<id>-disk-N. Mapping a Proxmox disk to its Pure volume is part of what the plugin would own.
If you're up for building it, this is exactly the kind of contribution we'd be glad to take — I'd suggest a plugin plus a small core PR for the provider seam, scoped to ActiveDR for a first cut. Happy to sanity-check the seam design here on the issue before you go deep so it lands mergeably.
@mkellermann97 Thanks — that lines up with how I was hoping to approach it. Before I dig into a Pure POC, here's a concrete seam proposal for sanity-check so the core PR stays small and mergeable.
Scope for v1
- ActiveDR only (async pod replication, clear source → destination)
- Pure-specific code lives in a plugin
- Core only adds a vendor-neutral provider seam + dispatch in Site Recovery
- ActiveCluster / fencing / dual-ownership deferred to a later phase
Plan / VM fields
Minimal additive schema — keep existing xcrepl path as the default:
site_recovery_plans
replication_provider—'native'(default, current xcrepl) |'external'provider_id— plugin/provider key, e.g.'pure'(nullable when native)
site_recovery_vms (for external provider VMs)
- keep
replication_job_idfor native - add
provider_ref(JSON or TEXT) — opaque provider-owned identity, e.g. Pure pod / volume map / protection group - optional
target_vmidremains useful for reservation
Example provider_ref shape (owned/interpreted by the plugin, not core):
{
"mode": "activedr",
"pod": "vm-107-adr",
"disks": {
"scsi0": {
"source_volume": "vm-107-disk-0",
"target_volume": "vm-107-disk-0"
}
}
}
Storage/network mappings on the plan stay as they are for Proxmox-side attach/start; volume↔array identity stays in the plugin via provider_ref.
ReplicationProvider contract
Rough Python shape — inspired by the alert-handler registration pattern (_notification_handlers / register_alert_handler):
class ReplicationProvider(Protocol):
provider_id: str # e.g. "pure"
# Health / readiness (feeds SR readiness, auto-failover, DR drill)
def get_status(self, vm_ref: dict) -> ReplicationStatus:
"""healthy|degraded|unhealthy, rpo_seconds, last_sync, detail"""
def readiness_check(self, plan_ctx: dict, vms: list[dict]) -> list[Issue]:
"""Provider-specific preflight issues (lag, link down, wrong role, etc.)"""
# Lifecycle
def prepare_failover(self, plan_ctx: dict, vm_ref: dict, mode: str) -> None:
"""mode: planned|emergency|test — quiesce/final sync/pre-promote checks"""
def promote(self, plan_ctx: dict, vm_ref: dict, mode: str) -> PromoteResult:
"""Make destination storage writable / available for attach"""
def ensure_target_vm(self, plan_ctx: dict, vm_ref: dict, mode: str) -> EnsureVmResult:
"""
Guarantee a VM config exists on the target cluster and disks are attached.
For Pure this may mean: register/import config + attach existing volumes
(no disk copy). For native xcrepl this can be a no-op if replica VM exists.
"""
def reprotect_or_failback(self, plan_ctx: dict, vm_ref: dict) -> None:
"""Reverse direction / re-establish protection after failback"""
def test_prepare(self, plan_ctx: dict, vm_ref: dict) -> TestHandle:
"""Optional snapshot/clone/test-promote for isolated test failover"""
def test_cleanup(self, handle: TestHandle) -> None:
...
Registration (plugin side), analogous to notifications:
# in plugin register(app)
from pegaprox.site_recovery.providers import register_replication_provider
register_replication_provider(PureActiveDRProvider(...))
Core keeps owning:
- plan/VM CRUD, boot groups/order, network mappings
- Proxmox API start/stop/config
- events / webhooks / RBAC / drill framework shell
- dispatch into provider methods instead of assuming
cross_cluster_replications
Failover dispatch (ActiveDR)
Today planned = remote_migrate, emergency = start existing replica. For replication_provider == 'external':
Planned
- readiness_check
- shutdown source VM
- prepare_failover(planned)
- promote
- ensure_target_vm (config + attach existing volumes)
- apply network mappings / start by boot group
Emergency
- readiness_check (best-effort; source may be down)
- prepare_failover(emergency) / promote
- ensure_target_vm
- start by boot group
(no assumption that a full PVE replica VM was already seeded by xcrepl)
Test
- test_prepare → ensure_target_vm on isolated/test net (NICs disconnected or mapped)
- start
- test_cleanup on user request
Failback
- reverse of planned via reprotect_or_failback + ensure on original source
Native/xcrepl keeps current behavior unchanged when replication_provider == 'native'.
What stays in the Pure plugin
- FlashArray REST auth + config
- ActiveDR pod/volume discovery and status polling
- Mapping Proxmox
vm-*-disk-*↔ Pure volumes - promote / demote / reprotect calls
- any “externally managed / do not destroy” safety flags coordinated with the Pure PVE storage plugin
What does not live in the Pure Proxmox storage plugin: the DR state machine.
Questions before I prototype
- Prefer
replication_provideron the plan (all VMs same backend) or per-VM (mixed native + external in one plan)? - Is a Protocol +
register_replication_provider()acceptable for the first core PR, or would you rather start even smaller (e.g. just a provider string + callbacks dict)? - For
ensure_target_vm: OK for v1 that the plugin/PegaProx regenerates config from the last known source config (cached by PegaProx), rather than requiring a permanently registered dual-cluster VM? - Anything you want explicitly out of v1 besides ActiveCluster?
Happy to adjust the shape to whatever you’ll actually merge — once this looks right I’ll open a small core seam PR and a Pure ActiveDR plugin POC against real arrays.
@brngates98 This is a genuinely well-thought-out seam — and it lines up with the code, which is the part that matters. Confirmations:
- Scope is right. ActiveDR-first, Pure in a plugin, core gets only a vendor-neutral provider seam + dispatch — that keeps the core PR small and mergeable.
- Schema shape works.
replication_provider(native|external) +provider_idon the plan, plus a plugin-owned opaqueprovider_refon the VM whilereplication_job_idstays for the native path — additive, and it leaves the existing xcrepl flow untouched. Keeping volume↔array identity inside the plugin rather than core is the right call. - Where it dispatches. The natural seam is the failover branch: the current emergency path already assumes the data is pre-seeded on the target and just orchestrates power-on + storage/network mappings + boot order — that's exactly where an
externalprovider slots in (plugin does promote/quiesce, core does the Proxmox-side attach/start). Yourget_status/readiness_checkmap cleanly onto the existing Site Recovery readiness check, the DR drill, and the auto-failover health gate. - Registration. Mirroring the alert-handler pattern is fine for load-time registration; you'll also want the plan to resolve a provider by
provider_idfrom a small registry so dispatch can find it.
Net: I'd take a core PR along these lines. One thing before you sink time into the Pure POC — Nico owns Site Recovery's core, so let me get his eyes on the exact field/seam schema so it lands first-try rather than round-tripping on the PR. I'll loop him in and follow up here. Really nice work scoping this down.
— Marcus
@mkellermann97 Following up on the seam above (same proposal, posting from bgatestmg). I went ahead and prototyped against the contract you accepted, locally, so the open choices are concrete rather than another sketch. No PR yet. This is the thing I'd like Nico's eyes on before splitting it into a core PR and a plugin PR.
Choices taken from the questions on the table
- Provider is on the plan, not the VM. One backend for every guest in the plan.
replication_job_idis left for native and is not required whenreplication_providerisexternal. - Registry, not a
typing.Protocol.pegaprox.core.replication_providersexposesregister_replication_provider/unregister_replication_provider/provider_for_plan, same idea as the alert handlers. A native plan never consults it, including whenprovider_idhappens to be set. Unload of the plugin unregisters the provider. - No standing replica.
ensure_target_vmcreates the guest at failover time from the last config the plugin cached intoprovider_ref. The DR cluster does not carry that VM while production is at home. - ActiveCluster stays out. A pod with no replica link is treated as stretched and the provider refuses the guest. v1 will not start both sides.
What the prototype taught us that the sketch didn't
Deleting the DR guest through the Proxmox API deletes the FlashArray volumes. destroy-unreferenced-disks=0 only covers disks that are not in the config. Disks that are in the config go through the storage plugin's free_image, and the Kolesa Pure plugin deletes the volume. Those volumes are the replica.
Failback therefore does not call VM delete. After the original side is promoted, the DR definition is removed by deleting /etc/pve/qemu-server/<vmid>.conf (and its firewall file) over the node's existing SSH path, and only when the guest is tagged pure-external. There is no API-delete fallback. The helper is vendor-neutral (guest_adopt.unregister_qemu_keep_volumes); the tag check stays in the plugin. This is the part I most want a yes or a no on.
Creating the guest is the mirror image: the create body is posted with the existing volid (<storage>:vm-<vmid>-disk-N), so the storage plugin adopts the volume instead of allocating one. Same VMID, because that plugin binds the volume name to the VMID. An existing guest never has its volid rewritten. A volid change is what would free the Pure volume.
While a guest is failed over, both definitions exist for that window. Home is stopped. On a planned failover its onboot is cleared so a host reboot cannot start it on a demoted pod; failback restores the cached value. Emergency cannot do that, because the source is the thing we cannot reach. The DR guest is the one just created, and its onboot follows the cached source. Failback removes only the tagged DR definition and starts the original guest.
Dispatch, as built
External planned: stop the running side, prepare_failover, promote, ensure_target_vm (config + attach, network map applied in the config being written), start by boot group.
External emergency: the existing "source is visibly running" refusal still applies. Then promote, create from the cache, start. No pre-seeded PVE replica is assumed.
Test: there is nothing on the target to full-clone. test_prepare copies the target volumes to vm-<vmid+90000>-disk-N, creates an SR-TEST- guest, and core still does NIC isolation and the existing test cleanup. If the array rejects the copy because the pod is demoted, that error is returned. A test does not promote.
Failback: reprotect_or_failback (promote the original side, drop the tagged DR config without freeing volumes), ensure_target_vm on the home guest, which is a no-op when that guest is still there, then start.
Auto-failover is the same unreachable-source rule, on the HA leader only. The replication-job health gate is replaced by readiness_check. Unhealthy (no cache yet, link down, ActiveCluster, a disk that is not on the Pure storage) blocks. Lag over 300s is a warning and does not block.
What the plugin owns
provider_ref is opaque to core. The Pure plugin writes roughly:
{
"vmid": 107,
"source_storage": "pure-a",
"target_storage": "pure-b",
"pods": ["vm-107-adr"],
"disks": [{"key": "scsi0", "serial": "…", "target_volume": "vm-107-disk-0", "target_full": "vm-107-adr::vm-107-disk-0"}],
"config": {"name": "db", "memory": "4096", "net0": "…"},
"state": "healthy",
"rpo_seconds": 12,
"last_sync": "…"
}
The cache refresh runs on the leader. Array tokens live in the plugin config.json, sealed with the field key, so HA syncs ciphertext and core gains no Pure table. QEMU only for v1.
What I'd like decided before the PRs
- Is removing the qemu config file over SSH an acceptable core helper, or should "unregister this guest and keep its volumes" wait until Proxmox has a real flag for it?
- Plan-scoped provider still the one you'll merge?
- Test-by-volume-copy, with a hard error when the demoted pod refuses the copy, rather than promoting for a test?
- If those three are fine, I'll open the core seam on its own (schema, registry, dispatch, the unregister helper) and the Pure plugin as a second PR. Happy to reshape either one before that.