Architecture
Service components and how they fit into OpenStack
This page describes the internal structure of Trilio Site Recovery for OpenStack: which processes run, how they communicate, and how the service fits into a standard OpenStack deployment. Understanding the architecture helps you plan capacity, diagnose failures, and reason about what happens during a DR operation. The service follows OpenStack conventions throughout — it registers with Keystone, enforces RBAC through oslo.policy, transports RPC messages over RabbitMQ, and stores all state in MariaDB — so operators familiar with other OpenStack services will find the patterns familiar.
Loading diagram...
protector-api
A WSGI application (served by gunicorn in production) that listens on port 8788. Every user request — from the CLI, the Horizon panel, or a direct API call — arrives here first. The API validates the caller's Keystone token, enforces RBAC policy rules (oslo.policy), and then dispatches the requested DR operation to the engine over RabbitMQ RPC. It does not execute DR workflows itself; its role is authentication, authorization, request validation, and routing.
The API is stateless: it reads and writes the MariaDB protector database for resource CRUD (sites, protection groups, members, mappings) but delegates all long-running work to the engine. This means you can scale protector-api workers independently of the engine.
The API exposes an unauthenticated health endpoint at /healthz that returns HTTP 200 when the service can serve requests and HTTP 503 when it cannot. The Kolla container health check, the installer, and peer-site reachability checks all poll this endpoint.
protector-engine
An oslo.messaging RPC server that consumes messages from RabbitMQ on the topic protector-engine. The engine executes every DR workflow: failover, failback, test failover, test cleanup, reconcile, metadata synchronization, and storage replication management. It is the only component that talks to Pure Storage FlashArrays, Nova, Cinder, and Neutron directly.
During a failover the engine on the recovery site contacts the peer site's API (protector-api on port 8788) to synchronize state and promote replicated volumes. This cross-site communication uses Keystone trust-scoped sessions — the engine creates a per-tenant Keystone trust delegating the member and dr_operator roles so it can act on the tenant's behalf on the remote site without storing user credentials.
MariaDB / MySQL (protector database)
The single source of truth for all service state. Every site registration, protection group, consistency group, member, volume record, DR operation, replication policy, tenant mapping, and resource mapping lives here. The schema is managed by Alembic migrations; the current head is 025_add_member_removing. The database name, user, and vhost all default to protector.
RabbitMQ
Provides the oslo.messaging RPC transport between protector-api and protector-engine. The engine subscribes to the topic protector-engine on the vhost protector. Because the engine is an RPC server rather than a streaming consumer, the API call returns quickly (the operation is dispatched) while the engine works asynchronously; callers poll GET /v1/{tenant_id}/operations/{id} or use --wait to block until completion.
Pure Storage FlashArray (pure driver)
The production storage backend. The engine manages Pure Protection Groups, snapshot schedules, volume replication, volume promotion, and volume import directly through the FlashArray REST API. Two replication modes are available: async (periodic snapshot replication) and active_dr (continuous asynchronous replication via pod replica links). The driver requires the python3-pure-client SDK package on every node running protector-engine.
mock storage driver
An in-memory backend that simulates replication operations without a physical array. It is the default when storage_driver = mock and stores state under /var/lib/protector. Use it for initial deployment validation and hardware-free evaluation; it is not suitable for production.
openstack dr CLI (python3-triliositerecovery)
An OpenStackClient plugin installed by the python3-triliositerecovery Debian package. All operator and admin interactions use the openstack dr subcommand family. The CLI discovers the API endpoint from the Keystone service catalog (service type disaster-recovery) and authenticates with standard OpenStack credentials — no separate configuration is required.
Horizon Dashboard plugin (python3-triliositerecovery-dashboards)
Installed by the python3-triliositerecovery-dashboards package, this adds a DR Admin panel to OpenStack Horizon via the protector_dashboards module. It communicates with protector-api over the same REST interface as the CLI. Installation and integration with the dashboard is handled by the trilio-site-recovery-for-openstack-dashboard Juju charm via the dashboard-plugin relation.
Keystone
Trilio Site Recovery registers as a first-class OpenStack service with type disaster-recovery (secondary type protector) and a service account named protector. Two custom roles — dr_operator and dr_site_admin — must exist in Keystone on both sites before the service can operate. The dr_site_admin role is cloud-wide: a holder on any project can register sites and map tenants for all projects, so it belongs on the admin project, not on individual DR projects.
The following trace follows a planned failover of a protection group from Site A to Site B, showing how control and data move through every layer.
1. The operator issues the failover command
openstack dr failover <pg-id> --failover-type planned --wait
The python3-triliositerecovery CLI plugin looks up the disaster-recovery endpoint in the Keystone catalog and sends:
POST /v1/{tenant_id}/protection-groups/{id}/action
{"failover": {"failover_type": "planned"}}
with the caller's Keystone token in X-Auth-Token.
2. protector-api authenticates and dispatches
protector-api on Site A validates the token against Keystone (:5000), checks the RBAC policy rule for the failover action (requires dr_operator or admin), and — if authorized — publishes an RPC message to RabbitMQ on the protector-engine topic. The API returns HTTP 202 immediately with an operation record; the CLI's --wait flag then polls GET /v1/{tenant_id}/operations/{id} until status reaches completed or failed, reporting progress (0–100) along the way.
3. protector-engine executes the failover workflow
The engine on Site A dequeues the RPC message and begins the failover workflow (engine/dr_operations.py):
- Preflight validation — confirms the protection group is
ACTIVE, replication is healthy, and the secondary site is reachable (polls/healthzon Site B'sprotector-api). - Quiesce — for a planned failover, signals Nova to quiesce or snapshot instances.
- Snapshot and replicate — instructs the Pure Storage FlashArray on Site A to take a crash-consistent snapshot of the Pure Protection Group covering all consistency group volumes, and waits for that snapshot to replicate to Site B's array.
- Cross-site call — the engine calls Site B's
protector-api(port 8788) using a Keystone trust-scoped session (delegatingmemberanddr_operator) to trigger the import phase on Site B.
4. Site B engine imports and recreates workloads
The engine on Site B:
- Promotes volumes — calls the Pure FlashArray B REST API to promote the replicated snapshot and import the volumes into Cinder via the volume manage API (
volume_extension:volume_manage). - Maps resources — resolves network, flavor, and floating IP mappings (using
=-separated--network-mappingvalues if supplied, or by name fallback). - Recreates instances — calls Nova on Site B to boot each protected VM from its promoted Cinder volume. Recovered instances are named
<original-name>-failover. - Updates state — writes the operation result to the
dr_operationstable on Site B, includingsource_siteandtarget_sitenames, and synchronizes the updated protection group state back to Site A.
5. The operator observes the result
openstack dr operation show <operation-id>
openstack dr replication health <pg-id>
The protection group status transitions:
ACTIVE → FAILING_OVER → FAILED_OVER
Workloads are now running on Site B. Site A's volumes are read-only. Replication direction reverses automatically for the next cycle.
Metadata synchronization
Bidirectional metadata sync (engine/bidirectional_sync.py) runs independently of failover. The engine on each site periodically calls the peer site's API to reconcile protection group membership, volume lists, and resource mappings. This keeps both sites consistent without requiring shared storage or a shared database.
Standard OpenStack service patterns
The service is built on oslo.config, oslo.policy, oslo.messaging, and keystoneauth1 — the same libraries used by Nova, Cinder, and Neutron. This was a deliberate choice: operators who know OpenStack already know how to configure, secure, and troubleshoot services built on these libraries. The trade-off is a heavier dependency footprint than a standalone service would require, but the operational familiarity outweighs that cost in environments where the service deploys alongside an existing OpenStack cluster.
Two-process architecture (api + engine)
Separating the API from the engine over RabbitMQ RPC follows the Nova and Cinder model. The API can scale horizontally (multiple protector-api workers) without touching the engine, and the engine can be restarted or upgraded independently. The RPC boundary also means the API is never blocked by a long-running DR operation — it dispatches and returns immediately, leaving callers to poll or wait.
Protection group as the unit of recovery
Cinder's native failover operates at the storage backend level and is an all-or-nothing, admin-only operation. Trilio Site Recovery introduces the protection group as a named set of VMs whose volumes are replicated together as a crash-consistent unit. This gives tenants self-service control over which workloads are protected and how, without requiring admin intervention for each failover. The protection group abstraction also enables per-group policies (RPO, snapshot retention) and per-group resource mappings (networks, flavors, floating IPs).
Keystone trust delegation for cross-site operations
Rather than storing user credentials or service passwords for the remote site, the engine creates a Keystone trust that delegates the member and dr_operator roles to the service account. This means the engine can act on the tenant's behalf on the remote site using a scoped, revocable token — no long-lived secrets cross the site boundary. The roles delegated by the trust must already exist in Keystone; trust creation fails if either role is absent, so the dr_operator role must be created on both sites before any DR operation runs.
If no tenant mapping is configured, the engine assumes the same project UUID on the peer site. This assumption holds for a shared or federated Keystone but not for two independent clusters — the deployment this product is designed for. Configure an explicit tenant mapping whenever the two sites have independent Keystones.
Pluggable storage drivers
Storage backends are pluggable via the storage_driver option. The pure driver is the production backend; the mock driver ships as the default for evaluation and integration testing without physical arrays. The drbd driver is in development and not for production use. This design means the service can be validated in a lab environment before production hardware is available.
Pure Storage replication modes
Two modes are available today, selected per protection group at create time:
async— periodic snapshot replication via Pure Protection Groups. RPO is bounded bysnapshot_interval_seconds(default 300 s) plus transfer time. Every replicated snapshot is a selectable recovery point. Requires--volume-typereferencing a Cinder volume type withreplication_enabled=True.active_dr— continuous asynchronous replication via Pure pod replica links. Typical RPO is sub-30 seconds. Recovery points are supported. Does not require--volume-type. Requires Purity//FA 6.0+ and an existing array-level replication connection.
The active_dr mode is not synchronous — that is ActiveCluster (planned, not yet shipped). Choosing between the two modes is a function of your RPO target and the available WAN bandwidth.
RBAC with two custom roles
Two roles partition access: dr_operator for tenant-level DR operations (failover, failback, protection group management) and dr_site_admin for cloud-wide administrative operations (site registration, tenant mapping, replication audit). The dr_site_admin role carries no project scoping — a holder on any project can administer sites for all projects. It belongs on the admin project. Granting it per DR project would give broader access than intended.
No oslo.messaging notifications
The service constructs a messaging notifier object internally but never calls it — no DR lifecycle events (protection_group.create, failover.start, failover.complete, and so on) are ever published to the message bus. The observability surface is entirely poll-based: use openstack dr replication health <pg>, openstack dr replication audit, openstack dr recovery point list <pg>, and openstack dr operation list to monitor state. If you are building alerting or automation that needs to react to DR events, you must poll these endpoints rather than subscribe to notifications.
Recovered instances do not return to their original names
Failover creates recovered instances as <original-name>-failover; failback creates them as <original-name>-restored. The member row preserves the original instance_name, so suffixes do not compound over a round trip, but a full failover-and-failback cycle never returns the workload to its original name. Anything outside OpenStack that is keyed on instance name — DNS records, monitoring targets, CMDBs, runbooks — must be updated after each operation.
LUKS-encrypted volumes are not supported
Adding a member whose boot or data volume is LUKS-encrypted is rejected at membership time (InvalidInput). Cinder's volume manage API cannot associate Barbican encryption keys on the DR site, so an encrypted volume could never be recovered. The supported alternative is array-side encryption (Pure data-at-rest encryption), which is transparent to the replication and import path. If your workloads use host-side LUKS, they cannot be protected by this service.
Failback detach timing
Failback must unmanage DR volumes from Cinder before destroying the DR instances. Nova does not detach volumes synchronously when a server is deleted — the Cinder attachment is released after the server is gone. The engine waits up to 120 seconds per volume for the attachment to clear before proceeding with unmanage. A site whose Nova detaches lag will show a visibly slower failback; this is the wait working, not a hang. A volume still attached at the deadline is unmanaged anyway and logged rather than raising an error, so failback is not aborted.
No estimated completion time for operations
Operation records include a progress field (0–100 integer) that the CLI renders as a percentage, but the service computes no estimated completion time. There is no ETA or projected finish time for failover, failback, or test failover. Plan your maintenance windows based on observed replication lag and historical operation durations from openstack dr operation list.
Tenant mapping is not enforced but its absence causes late failures
The engine will proceed without a tenant mapping, falling back to the assumption that the project UUID is identical on both sites. For a shared or federated Keystone this is correct; for two independent clusters it is almost always wrong. The failure surfaces not at setup time but during the first cross-site operation, making it harder to diagnose. Always configure an explicit tenant mapping when deploying against independent OpenStack clusters.
The --probe flag checks resource resolution, not storage health
openstack dr replication health <pg> --probe asks the recovery site whether the protection group's networks, security groups, and flavors resolve in the project it would recover into, using the same trust-scoped session a real recovery would use. It does not check the storage backend, replication lag, or recovery point freshness. Use it before a failover window to catch resource mapping gaps; use openstack dr replication health <pg> (without --probe) and openstack dr replication audit to assess storage replication state.
Single storage backend per protection group
Each protection group uses a single storage driver and replication type for all its members. You cannot mix async and active_dr within one group, or protect some volumes with Pure and others with the mock driver. If your workloads have heterogeneous storage requirements, they must be split across multiple protection groups.
Charm-managed configuration cannot be overridden by editing protector.conf
When deployed via the Juju charm, /etc/protector/protector.conf is rewritten on every hook run. Manual edits to the file are overwritten. For configuration options not exposed as named charm options, use the config-flags charm option:
juju config trilio-site-recovery config-flags="engine:cross_site_timeout=60"
The charm exposes 47 named options; anything not in that set must go through config-flags. Naming a key that the charm template already renders will cause the section to appear twice in the generated file, which some oslo.config parsers will reject.