---
title: Deployment Guide
product: trilio-site-recovery-for-openstack
doc_type: guide
version: master
source: git2docs (code-derived, validation-filtered)
canonical: https://git2docs.com/murali-balcha/docs/trilio-site-recovery-for-openstack/trilio-site-recovery-for-openstack/deployment-guide
---

# Deployment Guide

_Installation overview: prerequisites common to all distributions and choosing yours (Kolla, Juju Charms, RHOSO18)._

## Overview

This guide walks you through deploying Trilio Site Recovery for OpenStack to a production environment using the Juju charm — the only validated, customer-facing deployment method for the tech preview. You will install and configure the `protector-api` and `protector-engine` services on each OpenStack site, wire them to your existing Keystone, RabbitMQ, and MySQL infrastructure, and verify that the services are healthy before proceeding to register sites and configure Protection Groups. The Juju charm manages all systemd services, renders `protector.conf` from relation data, migrates the database schema, and registers with Keystone automatically once all required relations are satisfied.

## Prerequisites

Before deploying, ensure the following are in place on **both** sites:

**OpenStack requirements**
- OpenStack Victoria or later
- Nova, Cinder (with a volume type carrying `replication_enabled='<is> True'`), Keystone, and Neutron operational on each site
- Pure Storage FlashArray with an async replication connection between sites

**Infrastructure**
- MariaDB or MySQL ≥ 10.3 (shared with the cloud or dedicated — see topologies below)
- RabbitMQ with oslo.messaging support
- `python-openstackclient` installed **via pip** (not the snap — the snap is incompatible with the `triliositerecovery` CLI plugin)
- Juju 2.9 or 3.x with access to the target Charmed OpenStack model

**Keystone roles** — the service never creates roles, only looks them up. Both roles **must exist on both sites** before deployment:
```bash
openstack role create dr_operator
openstack role create dr_site_admin
```
Trust creation fails with `Role <name> does not exist on site <site>` if either role is absent.

**DR user grants** — on every project that will use DR:
```bash
# For each DR-enabled project on each site
openstack role add --project <project> --user <dr-user> member
openstack role add --project <project> --user <dr-user> dr_operator
```
The `protector` service account also requires `member` and `dr_operator` on each DR-enabled project on each site (not just the service project).

**Network connectivity** — bidirectional between sites on all of the following ports:

| Port | Service |
|------|---------|
| 5000 | Keystone |
| 8774 | Nova |
| 8776 | Cinder |
| 8788 | protector-api |

Port 8788 must be **bidirectional**. One-way connectivity causes tenant mapping sync failures and leaves the system in an inconsistent state.

**Charm build artefact**
```bash
bash deploy/charms/build.sh
```
The built `.charm` file is required before running the deploy script.

**Infrastructure charm revision pins** — newer revisions of these charms ship wheelhouses that fail to install on Ubuntu Jammy:
- `mysql-innodb-cluster`: use revision **164** (not 179)
- `mysql-router`: use revision **1154** (not 1178)
- `rabbitmq-server`: use revision **295**

## Configuration

All configuration is managed through `juju config`. **Never edit `/etc/protector/protector.conf` directly** — the charm renders it from relation data and config values, and overwrites any manual edits on every `config-changed` event.

Configuration option names use **hyphens** when passed to `juju config` (e.g. `pure-primary-management-ip`), which the charm translates to underscore-separated keys in `protector.conf`.

---

### Core API options (`[api]` section)

| Charm option | conf key | Default | Description |
|---|---|---|---|
| `bind-port` | `bind_port` | `8788` | TCP port `protector-api` listens on |
| `api-workers` | `workers` | `2` | Number of gunicorn workers. Note: the charm default is 2, not the oslo.config compiled-in default of 4 |

### Storage driver (`[storage]` and `[pure_storage]` sections)

The storage driver is the most critical production setting:

| Charm option | conf key | Default | Description |
|---|---|---|---|
| `storage-driver` | `storage_driver` | `mock` | `mock` (dev/test only) or `pure` (Pure Storage FlashArray) |
| `use-mock-storage` | `use_mock_storage` | `true` | Bypass real array calls. Set `false` with `storage-driver=pure` |
| `use-mock-cinder` | `use_mock_cinder` | `true` | Bypass real Cinder API calls. Set `false` for production |
| `pure-primary-management-ip` | `primary_management_ip` | — | Primary FlashArray management IP or hostname |
| `pure-primary-api-token` | `primary_api_token` | — | Primary FlashArray REST API token |
| `pure-secondary-management-ip` | `secondary_management_ip` | — | Secondary FlashArray management IP or hostname |
| `pure-secondary-api-token` | `secondary_api_token` | — | Secondary FlashArray REST API token |
| `pure-verify-ssl` | `verify_ssl` | `false` | Verify TLS certificates presented by the FlashArrays |
| `pure-default-rpo-seconds` | `default_rpo_seconds` | `900` | RPO target in seconds; used for health report warnings |
| `pure-snapshot-interval-seconds` | `snapshot_interval_seconds` | `300` | Desired replication snapshot interval in seconds |

> **Production requirement:** `storage-driver` defaults to `mock`. You must set `storage-driver=pure` and configure all `pure-*` options before the service can replicate real workloads.

### Snapshot retention (`[pure_storage]` section)

These options control how many recovery points are available on the secondary site:

| conf key | Default | Description |
|---|---|---|
| `retention_all_for_hours` | `24` | Keep every snapshot for this many hours |
| `retention_per_day` | `24` | After the all-for window, keep N snapshots per day |
| `retention_days` | `7` | Total days to retain snapshots |

Set these in `protector.conf` via `config-flags` (see below), for example:
```bash
juju config trilio-site-recovery config-flags="pure_storage:retention_all_for_hours=48,pure_storage:retention_days=14"
```

### Engine options (`[engine]` section)

| Charm option | conf key | Default | Description |
|---|---|---|---|
| `engine-topic` | `topic` | `protector-engine` | oslo.messaging RPC topic |
| `auto-create-security-groups` | `auto_create_security_groups` | `false` | Automatically create missing security groups on the DR site at member-add time |
| `recovery-point-interval-minutes` | `recovery_point_interval_minutes` | `0` | Interval between scheduled ActiveDR recovery point snapshots (0 = disabled) |
| `recovery-point-max-count` | `recovery_point_max_count` | `20` | On-demand recovery point snapshots retained per group |
| `recovery-point-ttl-hours` | `recovery_point_ttl_hours` | `24` | Age at which recovery point snapshots are deleted |

### Keystone and identity

| Charm option | Default | Description |
|---|---|---|
| `keystone-service-type` | `disaster-recovery` | Keystone service type for the main catalogue entry |
| `keystone-extra-service-types` | `protector` | Additional service types; the `openstack dr` CLI resolves the endpoint by type `protector` |
| `keystone-service-user` | `protector` | Keystone username created via the identity-credentials relation |
| `keystone-requested-roles` | `dr_site_admin` | Roles Keystone creates on behalf of this deployment |
| `deregister-on-remove` | `true` | Delete Keystone endpoints when the application is removed |
| `region` | `RegionOne` | OpenStack region for endpoint registration |

> **Use `identity-credentials`, not `identity-service`.** The `identity-service` relation only works if Keystone recognizes `protector` in its `valid_services` table, which is not the default. The `identity-credentials` relation is preferred and works out of the box.

### TLS

| Charm option | conf key | Default | Description |
|---|---|---|---|
| `ssl-ca` | — | — | Base64-encoded PEM CA for verifying OpenStack API endpoints. Overridden by the `certificates` relation to Vault |
| `verify-ssl` | — | `true` | Verify TLS for OpenStack APIs. Set `false` only in lab environments |

For cross-site TLS verification in `protector.conf`, the `[service_credentials]` section supports:
```ini
[service_credentials]
cafile = /etc/protector/ca.pem   # PEM CA bundle for cross-site calls
insecure = false                  # Set true only for dev/test
```

### Arbitrary config overrides

The `config-flags` charm option lets you set any `protector.conf` option not exposed as a dedicated charm config. Use `section:key=value` format with a colon separator (not a dot — dot separators fail silently):

```bash
juju config trilio-site-recovery \
  config-flags="engine:cross_site_timeout=60,DEFAULT:rpc_conn_pool_size=50"
```

### OpenStack origin

For air-gapped or offline sites, set:
```bash
juju config trilio-site-recovery openstack-origin=distro
```

For Ubuntu Cloud Archive pockets (match the OpenStack release of the cloud being protected):
```bash
juju config trilio-site-recovery openstack-origin=cloud:jammy-caracal
```

### Name resolution for cross-site connectivity

If the two sites cannot resolve each other's hostnames via DNS, use `extra-hosts`:
```bash
juju config trilio-site-recovery extra-hosts="
10.80.65.60  keystone.site-a.example.com
10.32.65.166 keystone.site-b.example.com"
```

This injects entries into `/etc/hosts` on the unit. Prefer fixing DNS at the infrastructure layer (MAAS upstream forwarder) for production.

## Usage

Once the services are deployed and healthy, the primary workflow is:

1. Register both sites
2. Create tenant mappings
3. Create a Protection Group
4. Add VMs to the Protection Group
5. Monitor replication health
6. Execute failover, failback, or test failover as needed

All operations use the `openstack dr` CLI. Source your OpenStack RC file before running any `openstack dr` commands.

---

### Register sites

Register the primary site (run from either site):

```bash
openstack dr site create site-a \
  --site-type PRIMARY \
  --auth-url https://keystone.site-a.example.com:5000 \
  --region RegionOne \
  --service-username protector \
  --service-password <protector-service-password> \
  --service-project-name service \
  --service-user-domain-name Default \
  --service-project-domain-name Default \
  --service-user-id <protector-user-id-on-site-a>
```

Register the secondary site:

```bash
openstack dr site create site-b \
  --site-type SECONDARY \
  --auth-url https://keystone.site-b.example.com:5000 \
  --region RegionOne \
  --service-username protector \
  --service-password <protector-service-password-on-site-b> \
  --service-project-name service \
  --service-user-domain-name Default \
  --service-project-domain-name Default \
  --service-user-id <protector-user-id-on-site-b>
```

> **Why `--service-user-id`?** Trust creation resolves the service user by ID. Without it, the first tenant mapping fails with `Cannot resolve service user ID`. Each site has its own Keystone, so read the ID from the site being registered:
> ```bash
> openstack user show protector -f value -c id
> ```

> The `--auth-url` value must match `keystone_authtoken.auth_url` in that site's `protector.conf` exactly (only trailing slash and `/v3` suffix are normalized). The engine identifies which site it is running on by comparing these as strings.

List registered sites:
```bash
openstack dr site list
```

---

### Create tenant mappings

Tenant mappings translate project UUIDs between sites (each site's Keystone assigns different UUIDs to the same tenant):

```bash
openstack dr tenant mapping create \
  --local-tenant <project-id-on-this-site> \
  --remote-site <site-b-id> \
  --remote-tenant <project-id-on-site-b>
```

Validate an existing mapping:
```bash
openstack dr tenant mapping validate <mapping-id>
```

---

### Create a Protection Group

```bash
openstack dr protection group create my-pg \
  --primary-site <site-a-id> \
  --secondary-site <site-b-id> \
  --replication-type async \
  --volume-type <replicated-volume-type-id>
```

For near-zero RPO with Pure Storage ActiveDR (requires Purity//FA 6.0+):
```bash
openstack dr protection group create my-pg \
  --primary-site <site-a-id> \
  --secondary-site <site-b-id> \
  --replication-type active_dr
```

> `--volume-type` is required for `async` replication. The volume type must have `replication_enabled='<is> True'` set as an extra-spec, or the Protection Group cannot accept members.

---

### Add VMs to a Protection Group

Pre-check a VM's eligibility without side effects:
```bash
openstack dr protection group member validate my-pg \
  --instance <nova-instance-id>
```

Add a VM:
```bash
openstack dr protection group member add my-pg \
  --instance <nova-instance-id> \
  --boot-order 1
```

> All VMs must boot from a Cinder volume (not ephemeral storage). Instances without Cinder-backed boot volumes are rejected with `InstanceNotCinderBoot` (HTTP 422). All attached volumes must use a volume type with `replication_enabled='<is> True'`; non-replicated volumes are rejected with `VolumeTypeNotReplicated` (HTTP 422).

Set boot order for sequenced startup/shutdown during failover:
```bash
openstack dr protection group member set my-pg \
  --member <member-id> \
  --boot-order 2
```

VMs sharing the same boot order value are processed in parallel; lower-numbered tiers complete before higher-numbered tiers begin.

---

### Monitor replication health

```bash
openstack dr replication health <pg-id>
```

The response includes sync state, lag, RPO compliance, failover readiness (`can_failover`), and available recovery points. Use `can_failover` as the programmatic readiness check before triggering a failover.

---

### Run a test failover (non-disruptive DR validation)

A test failover clones replicated volumes from the secondary site and boots isolated test VMs without affecting production:

```bash
# Using automatic network assignment
openstack dr test failover <pg-id> --auto-network

# Or with explicit network mapping
openstack dr test failover <pg-id> \
  --network-mapping <primary-net-id>:<secondary-test-net-id>
```

Either `--auto-network` or `--network-mapping` is required.

Clean up test resources when done:
```bash
openstack dr test failover cleanup <pg-id>
```

To clean up a specific test failover operation:
```bash
openstack dr test failover cleanup <pg-id> --operation <operation-id>
```

---

### Execute planned failover

```bash
openstack dr failover <pg-id> --failover-type planned
```

Planned failover gracefully shuts down VMs and takes a final snapshot for zero data loss.

For unplanned failover (skips shutdown, accepts data loss up to RPO):
```bash
openstack dr failover <pg-id> --failover-type unplanned
```

To block until the operation completes:
```bash
openstack dr failover <pg-id> --failover-type planned --wait
```

To restore from a specific recovery point:
```bash
openstack dr failover <pg-id> \
  --failover-type planned \
  --recovery-point <recovery-point-id>
```

---

### Execute failback

After restoring operations on the secondary site, fail back to the original primary:

```bash
openstack dr failback <pg-id>
```

---

### Track operations

Every DR action returns an operation ID. Track progress:

```bash
openstack dr operation show <operation-id>
```

List all operations for a Protection Group:
```bash
openstack dr operation list --protection-group <pg-id>
```

Cancel an in-progress operation:
```bash
openstack dr operation cancel <operation-id>
```

---

### Service management (Juju charm)

Restart services via Juju actions:
```bash
# Juju 3.x
juju run trilio-site-recovery/leader restart-services

# Juju 2.9
juju run-action trilio-site-recovery/leader restart-services --wait
```

View logs on the unit:
```bash
juju ssh trilio-site-recovery/0 -- tail -f /var/log/protector/protector-api.log
juju ssh trilio-site-recovery/0 -- tail -f /var/log/protector/protector-engine.log
```

Run a database schema sync manually (usually not required — the charm handles this):
```bash
# Juju 3.x
juju run trilio-site-recovery/leader db-sync

# Juju 2.9
juju run-action trilio-site-recovery/leader db-sync --wait
```

## Troubleshooting

### Issue: Unit stuck in `waiting` — charm never becomes active

**Symptom:** `juju status` shows the unit in `waiting/idle` indefinitely.

**Likely cause:** One or more required relations (`shared-db`, `amqp`, `identity-credentials`) are not yet established, or the related charm is not yet ready.

**Fix:**
```bash
juju status trilio-site-recovery --relations
```
Confirm all three relations show `joined`. If `identity-credentials` is missing, verify you added the relation to `keystone`, not just `identity-service`.

---

### Issue: `mysql-router` or `mysql-innodb-cluster` fails to install on Jammy

**Symptom:** The mysql-router or mysql-innodb-cluster unit enters an error state with a MarkupSafe or wheel-related Python error.

**Likely cause:** mysql-router revision 1178 or mysql-innodb-cluster revision 179 ships a broken wheelhouse for Ubuntu Jammy.

**Fix:** Pin to the tested revisions:
```bash
# In deploy.sh, use:
--router-revision 1154
--dedicated-db-revision 164
--dedicated-amqp-revision 295
```

If already deployed:
```bash
juju refresh mysql-router --revision 1154
juju refresh mysql-innodb-cluster --revision 164
```

---

### Issue: `apt.fury.io` returns 401 Unauthorized

**Symptom:** The unit enters `blocked` state with a message about the Trilio apt repository rejecting the request.

**Likely cause:** The `trilio-pkg-source` value is missing a read token for a private Gemfury repository.

**Fix:**
```bash
juju config trilio-site-recovery \
  trilio-pkg-source="deb [trusted=yes] https://<read-token>@apt.fury.io/<repo>/ /"
```

---

### Issue: `openstack dr` commands not found after installation

**Symptom:** `openstack dr --help` returns `No such command` or the `dr` namespace does not appear.

**Likely cause:** The CLI plugin (`python3-triliositerecovery`) is not installed, or you installed it via the openstackclient snap which is incompatible with the plugin.

**Fix:** Ensure the package is installed via apt or pip (not snap):
```bash
# Via apt
apt-get install python3-triliositerecovery

# Or from the repository (development)
pip install -e ./client
```

Do **not** use `pip install -e .` from the repository root — that does not install the CLI.

---

### Issue: `Role dr_operator does not exist on site <site>`

**Symptom:** Trust creation fails with this message when a tenant first attempts a DR operation.

**Likely cause:** The `dr_operator` or `dr_site_admin` Keystone role does not exist on one or both sites.

**Fix:** Create both roles on **both** sites:
```bash
openstack role create dr_operator
openstack role create dr_site_admin
```

Then grant them to DR users:
```bash
openstack role add --project <project> --user <dr-user> member
openstack role add --project <project> --user <dr-user> dr_operator
```

---

### Issue: `InstanceNotCinderBoot` when adding a VM

**Symptom:** `openstack dr protection group member add` returns HTTP 422 with `InstanceNotCinderBoot`.

**Likely cause:** The Nova instance uses ephemeral storage for its boot disk rather than a Cinder volume.

**Fix:** The instance cannot be protected until it is rebuilt with a Cinder-backed boot volume. Use `openstack dr protection group member validate` to pre-check eligibility:
```bash
openstack dr protection group member validate <pg-id> --instance <instance-id>
```

---

### Issue: `VolumeTypeNotReplicated` when adding a VM

**Symptom:** `openstack dr protection group member add` returns HTTP 422 with `VolumeTypeNotReplicated`.

**Likely cause:** One or more Cinder volumes attached to the instance use a volume type that does not have `replication_enabled='<is> True'` as an extra-spec.

**Fix:** Retype the volume to a replicated type, or create a new volume with the correct type:
```bash
# Check current extra-specs on the volume's type
openstack volume type show <volume-type-id>

# Create a replicated type if one does not exist
openstack volume type create replicated-vol \
  --property replication_enabled='<is> True' \
  --property replication_type='<in> async'
```

---

### Issue: Tenant mapping creates locally but does not sync to the remote site

**Symptom:** `openstack dr tenant mapping list` shows the mapping as `pending_validation` or the remote site reports it does not exist.

**Likely cause:** Port 8788 is not reachable from this site to the remote site (or vice versa). Cross-site metadata sync requires **bidirectional** connectivity on port 8788.

**Fix:** Verify bidirectional reachability:
```bash
# From site A to site B
curl -s http://<site-b-protector-api>:8788/healthz

# From site B to site A
curl -s http://<site-a-protector-api>:8788/healthz
```

Both should return `{"status": "ok", ...}`. Open firewall rules in both directions on port 8788.

---

### Issue: `Cannot resolve service user ID` on first tenant mapping

**Symptom:** The first tenant mapping fails with this error.

**Likely cause:** The site was registered without `--service-user-id`.

**Fix:** Update the site registration with the correct user ID:
```bash
# Get the service user ID on the target site
openstack user show protector -f value -c id

# Update the site
openstack dr site set <site-id> \
  --service-user-id <protector-user-id-on-that-site>
```

---

### Issue: `FailoverNotReady` when triggering failover

**Symptom:** `openstack dr failover` returns HTTP 422 with `FailoverNotReady`.

**Likely cause:** The Protection Group is not ready for failover — replication may be lagging or the health check has blockers.

**Fix:** Check replication health and review the `failover_validation.blockers` field:
```bash
openstack dr replication health <pg-id>
```

Address any blockers listed (e.g., replication lag exceeding RPO, missing resource mappings). Use `openstack dr protection group mapping list <pg-id> --unmapped` to identify unmapped resources.

---

### Issue: `config-flags` changes have no effect

**Symptom:** A `config-flags` value is set but the resulting `protector.conf` does not contain the expected option.

**Likely cause:** The `config-flags` value uses dot separators (e.g., `DEFAULT.rpc_response_timeout=120`) instead of colon separators.

**Fix:** Use colon separators in `section:key=value` format:
```bash
# Correct
juju config trilio-site-recovery config-flags="DEFAULT:rpc_conn_pool_size=50,engine:cross_site_timeout=60"

# Wrong — dot separators fail silently
juju config trilio-site-recovery config-flags="DEFAULT.rpc_conn_pool_size=50"
```

---

### Issue: `/healthz` returns 503 after deployment

**Symptom:** The health endpoint returns `{"status": "unhealthy", "checks": {"database": "unavailable (...)"}}` after the charm becomes active.

**Likely cause:** The `protector-api` service cannot reach the database. The `[database] connection` option may be missing, misconfigured, or point to an unreachable host.

**Fix:** Verify the database relation is active and inspect the rendered config:
```bash
# Juju 3.x
juju run trilio-site-recovery/leader show-config

# Juju 2.9
juju run-action trilio-site-recovery/leader show-config --wait
```

Check that the `[database] connection` string in the rendered `protector.conf` points to a reachable MariaDB/MySQL instance. In Juju charm deployments, the database is provisioned automatically via the `shared-db` relation — confirm this relation is joined.
