Trilio Site Recovery for OpenStackOpenStack native DR service
Guide

Upgrades

Upgrade procedure, db sync, rolling-upgrade notes


Overview

This page guides you through upgrading Trilio Site Recovery for OpenStack across all supported deployment models — Juju charm, Kolla-Ansible, and OpenShift. Upgrades involve three coordinated steps: running a preflight check to catch blockers before you touch any service, installing new packages or refreshing the charm, and synchronising the database schema with protector-manage db sync. Because the SQLAlchemy models declare every column that migrations add, starting new code over an old schema fails immediately on the first affected table read — schema synchronisation is not optional and must complete before the new services start.


Prerequisites

Before upgrading, confirm the following on every site that participates in DR:

  • Both sites are running Trilio Site Recovery 1.0.18 or later. Cross-version operation is not supported during the upgrade window.
  • The Keystone roles dr_operator and dr_site_admin exist on both sites. Trust creation names a missing role and fails rather than skipping it, so a cloud without dr_operator stops at its first DR operation after the upgrade.
  • You have SSH or Juju access to every node running protector-api and protector-engine.
  • The upgrade_preflight.py script has been obtained from the repository tag you are upgrading to (or from Trilio support). It is not shipped in any Debian package and must be copied to each site before running.
  • For Juju deployments: Juju client is installed and you have model admin access.
  • For Kolla deployments: protector-manage is in PATH on the controller node.
  • For OpenShift deployments: oc CLI is configured and you have cluster-admin access to the trilio-site-recovery namespace.
  • A database backup has been taken. Migrations alter table structure; take a full backup of the protector database on MariaDB/MySQL before proceeding.
  • No DR operations (failover, failback, test failover, reconcile) are in progress. Check with openstack dr operation list --status running.

Installation

Perform these steps on each site independently. Complete the upgrade on one site before starting the other.

Step 1 — Run the preflight check

Copy upgrade_preflight.py (from the target release tag or from Trilio support) to the node and run it as root:

sudo python3 upgrade_preflight.py

The script reads /etc/protector/protector.conf by default. To use a different path:

sudo python3 upgrade_preflight.py --config-file /etc/protector/protector.conf

The script reports three categories:

  • BLOCKERS — conditions you must fix before upgrading. The upgrade will fail or the service will not operate until these are resolved.
  • EXPECTED — conditions the upgrade itself resolves (for example, pending migrations). These are normal and require no action before you proceed.
  • WARNINGS — advisory items that do not block the upgrade but may cause problems later.

Do not proceed until there are no blockers.

Common blocker: local_site is not set

Release 1.0.20 no longer infers which site a node belongs to. The local_site option in [DEFAULT] must be set explicitly. The name must match openstack dr site list exactly.

On Juju: You cannot set local-site before refreshing the charm — the option arrives with the charm revision. The correct order is:

  1. Run juju refresh (Step 2 below).
  2. The unit lands in BLOCKED with the message: set local-site, pure-primary-site-name, pure-secondary-site-name. This is expected, not a failed upgrade.
  3. Set the required options (Step 3 below).

On Kolla or bare-metal: Set local_site in the [DEFAULT] section of /etc/protector/protector.conf before starting the new code:

[DEFAULT]
local_site = site-primary

Common blocker: Pure site names not set

If storage_driver = pure, the preflight also checks that primary_site_name and secondary_site_name are set in [pure_storage]. Each must name the OpenStack site whose array is at the matching management IP — primary_site_name names the site whose array is at primary_management_ip. These can be identical on both nodes; the driver resolves which array to talk to by site name, not by node position.

Common blocker: InnoDB row format prevents migration 019

Migration 019 widens columns in the tenant_mappings table. If the table uses the legacy COMPACT or REDUNDANT InnoDB row format, the ALTER fails because the composite unique index would exceed the 767-byte key limit. Convert the table first:

ALTER TABLE tenant_mappings ROW_FORMAT=DYNAMIC;

Then re-run the preflight to confirm the blocker is gone.

Alternatively, use the support script to widen the columns before upgrading (safe to run before migration 019; the migration skips columns already wide enough):

# Dry run — shows what would change
sudo python3 widen_keystone_id_columns.py

# Apply
sudo python3 widen_keystone_id_columns.py --apply

Run this on every site — each has its own database.


Step 2 — Install new packages

Juju

Refresh the charm to the latest revision on the channel you are tracking:

juju refresh trilio-site-recovery-for-openstack --channel latest/stable

The charm upgrades the trilio-site-recovery and python3-triliositerecovery packages on the unit. If you also run the CLI on machines not managed by the charm, upgrade the client package separately on those machines:

sudo apt-get install --only-upgrade python3-triliositerecovery

If you use the Horizon dashboard plugin, upgrade the dashboard charm:

juju refresh trilio-site-recovery-for-openstack-dashboard --channel latest/stable

Kolla-Ansible

Pull the new image and restart the containers using the Kolla install script:

sudo bash deploy/kolla/install.sh

The script manages the protector_api and protector_engine container lifecycle.

OpenShift (RHOSO18)

Run the installer script, which applies manifests in the correct order and gates each init Job on completion:

bash deploy/openshift/scripts/install.sh

Do not apply individual manifests by hand — the installer creates the namespace, configmap, secrets, four init Jobs (db-init, rabbitmq-init, keystone-init, db-sync), service, and deployments in a specific order. Skipping init Jobs leaves the API unable to authenticate tokens, reach the database, or dispatch RPC.

The script accepts flags to override defaults:

bash deploy/openshift/scripts/install.sh \
  --namespace trilio-site-recovery \
  --image docker.io/xyzmd/trilio-site-recovery-openstack:dev

Step 3 — Set required configuration (Juju only)

After juju refresh, the unit enters BLOCKED. This is expected. Set at minimum:

juju config trilio-site-recovery-for-openstack \
  local-site="<this site's registered name>"

If using Pure Storage:

juju config trilio-site-recovery-for-openstack \
  local-site="site-primary" \
  pure-primary-site-name="site-primary" \
  pure-secondary-site-name="site-secondary"

The site names must match openstack dr site list exactly. The unit exits BLOCKED and proceeds to Active once the required options are set.


Step 4 — Synchronise the database schema

Juju

The charm's db-sync action runs the preflight ENUM check automatically before applying migrations. Run it on the leader unit:

juju run trilio-site-recovery-for-openstack/leader db-sync

Kolla and bare-metal

Important: If you are upgrading across migration 022 (which adds RECONCILE to the dr_operations.operation_type ENUM), you must run the preflight subcommand manually before db sync. The bare protector-manage db sync command does not run the ENUM preflight automatically — only the Juju charm's db-sync and upgrade actions do.

Check whether migration 022 is in the pending set:

protector-manage db preflight

Then apply migrations:

protector-manage db sync

Both commands read /etc/protector/protector.conf by default. To use a different config file:

protector-manage --config-file /etc/protector/protector.conf db sync

OpenShift

The install.sh script runs the db-sync init Job automatically as part of the installation sequence. No manual action is required.


Step 5 — Verify the upgrade

Juju

juju run trilio-site-recovery-for-openstack/leader health-check
juju status trilio-site-recovery-for-openstack

Kolla

The protector_api container exposes a health endpoint. Check it:

curl -s http://127.0.0.1:8788/healthz

A 200 OK response means the API can serve requests. A 503 means it cannot — check the container logs.

OpenShift

Check pod status using the correct label selectors:

oc -n trilio-site-recovery get pods \
  -l app.kubernetes.io/name=trilio-site-recovery,app.kubernetes.io/component=api

oc -n trilio-site-recovery get pods \
  -l app.kubernetes.io/name=trilio-site-recovery,app.kubernetes.io/component=engine

Note: On OpenShift the services log to stdout only. Use oc logs to read service output — there is no /var/log/protector/ directory on OpenShift pods.

All deployment models

Confirm the CLI reaches the upgraded service:

openstack dr site list
openstack dr protection group list

Configuration

The upgrade introduces or enforces several configuration options that were optional or absent in earlier releases. All options are set in /etc/protector/protector.conf using oslo.config INI syntax.

[DEFAULT] section

OptionTypeDefaultDescription
local_sitestring(none)Required since 1.0.20. The name of the DR site this instance belongs to, exactly as registered with openstack dr site create. The service refuses to participate in any DR operation until this is set. Do not rely on inference — the inference used by earlier releases was incorrect on the recovery site.
use_mock_storagebooleanfalseUse the in-memory mock storage driver instead of Pure Storage. For evaluation only.
use_mock_cinderbooleanfalseSimulate Cinder calls. For evaluation only.

[pure_storage] section

OptionTypeDefaultDescription
primary_management_ipstring(none)Management IP of the primary FlashArray.
primary_api_tokenstring(none)API token for the primary array.
secondary_management_ipstring(none)Management IP of the secondary FlashArray.
secondary_api_tokenstring(none)API token for the secondary array.
primary_site_namestring(none)Required since 1.0.20. The OpenStack site name whose array is at primary_management_ip. Must match a registered site name exactly.
secondary_site_namestring(none)Required since 1.0.20. The OpenStack site name whose array is at secondary_management_ip.
verify_sslbooleanfalseVerify TLS certificates when connecting to FlashArray.
default_rpo_secondsinteger900Default RPO for ActiveDR replication, in seconds.
snapshot_interval_secondsinteger300Interval between async replication snapshots, in seconds.
additional_arrayslist""Names of additional [pure_array:<name>] sections for multi-array configurations. Each named section carries its own primary_management_ip, primary_api_token, secondary_management_ip, secondary_api_token, primary_site_name, secondary_site_name, and cinder_backend_names.

Array site name pairing: The driver resolves which array to talk to by comparing the protection group's primary site name against primary_site_name and secondary_site_name. The invariant is the pairing — primary_site_name must name the site whose array is at primary_management_ip. An identical [pure_storage] section works unchanged on both nodes; the names travel with the IPs.

[service_credentials] section

OptionTypeDefaultDescription
default_trust_rolesstringmember,dr_operatorRoles delegated by every per-tenant Keystone trust. Every role named here must exist in Keystone — trust creation fails (naming the missing role) rather than skipping it. The default member,dr_operator is correct for all standard deployments. Do not omit member — it provides the Nova and Cinder access the trust needs; dropping it causes failover to fail at the first instance or volume call, after the storage work is already done. Omit this option from your config file entirely to use the default.
usernamestring(none)Service account username (typically protector).
project_namestring(none)Service account project.
cafilestring(none)CA certificate file for Keystone TLS verification.
insecurebooleanfalseDisable TLS verification for Keystone calls.

[engine] section

OptionTypeDefaultDescription
topicstringprotector-engineRabbitMQ topic for engine RPC.
cross_site_timeoutinteger30Timeout in seconds for cross-site API calls. Increase on slow or high-latency links.
recovery_point_interval_minutesinteger0How often the engine creates automatic recovery points (0 = disabled).
recovery_point_max_countinteger20Maximum recovery points retained per protection group.
recovery_point_ttl_hoursinteger24Recovery point time-to-live in hours.
auto_create_security_groupsbooleanfalseAutomatically create missing security groups on the recovery site during failover.
coverage_refresh_interval_minutesinteger15How often the engine refreshes volume replication coverage data.

Setting options not modelled by the Juju charm

The charm renders /etc/protector/protector.conf on every hook and overwrites manual edits. For options the charm does not expose directly, use the config-flags option:

juju config trilio-site-recovery-for-openstack \
  config-flags="engine:cross_site_timeout=60"

The format is section:key=value. Do not use config-flags to override a key the charm template already renders — doing so appends a duplicate section, which some tools cannot parse. engine:cross_site_timeout is not in the charm template and is safe to set this way.

The charm exposes 47 named options. Any key not in that set must be set via config-flags.


Usage

Check whether an upgrade is needed

Compare the current schema revision against the expected head before deciding whether to upgrade:

protector-manage db preflight

This shows the current Alembic revision and any pending migrations.

Monitor a protection group during the upgrade window

Before taking any services offline, confirm all protection groups are in a consistent state:

openstack dr protection group list
openstack dr operation list --status running

Do not start the upgrade if any operation shows running. Wait for it to complete or cancel it:

openstack dr operation cancel <operation-id>

Validate replication health after the upgrade

After both sites are upgraded and schema-synced, check replication health for each protection group:

openstack dr replication health <protection-group>

To also verify that the recovery site can resolve the group's networks, security groups, and flavors as the project it recovers into, add --probe:

openstack dr replication health <protection-group> --probe

Note: --probe queries the recovery site's Neutron and Nova through a trust-scoped session. It checks resource resolution — whether the resources exist and are accessible to the recovering project — not storage array connectivity or replication lag. It is slower than the plain command because it contacts the other site. Run it before every planned failover window.

Upgrade the CLI on non-charm machines

Any machine running the openstack dr CLI that is not managed by the charm must be upgraded separately:

sudo apt-get update
sudo apt-get install --only-upgrade python3-triliositerecovery

Reconcile a protection group after an interrupted upgrade

If a failover or failback was interrupted during the upgrade window and left a protection group inconsistent, use the reconcile command on the recovery site:

openstack dr protection group reconcile <protection-group>

Reconcile repairs group status, relinks discovered VMs, restarts SHUTOFF workloads on the writable site, and synchronises the corrected state to the peer. It works when the primary site is unreachable. Each reconcile operation is recorded in the operations history and appears in openstack dr operation list with operation_type=reconcile.


Examples

Run the preflight check

sudo python3 upgrade_preflight.py

Run the preflight check against a non-default config file

sudo python3 upgrade_preflight.py \
  --config-file /etc/protector/protector.conf

Widen Keystone ID columns (dry run, then apply)

# See what would change without touching the database
sudo python3 widen_keystone_id_columns.py

# Apply the changes
sudo python3 widen_keystone_id_columns.py --apply

Remember to run this on both sites — each has its own database.

Refresh the Juju charm

juju refresh trilio-site-recovery-for-openstack --channel latest/stable

Set required options after charm refresh

juju config trilio-site-recovery-for-openstack \
  local-site="site-primary" \
  pure-primary-site-name="site-primary" \
  pure-secondary-site-name="site-secondary"

Run db-sync via the Juju charm action

juju run trilio-site-recovery-for-openstack/leader db-sync

Run the ENUM preflight then db-sync manually (Kolla / bare-metal)

protector-manage db preflight
protector-manage db sync

Run the OpenShift installer

bash deploy/openshift/scripts/install.sh

Check pod status on OpenShift after upgrade

# API pods
oc -n trilio-site-recovery get pods \
  -l app.kubernetes.io/name=trilio-site-recovery,app.kubernetes.io/component=api

# Engine pods
oc -n trilio-site-recovery get pods \
  -l app.kubernetes.io/name=trilio-site-recovery,app.kubernetes.io/component=engine

Read logs on OpenShift (stdout only — no log files on OpenShift)

# API logs
oc -n trilio-site-recovery logs \
  -l app.kubernetes.io/name=trilio-site-recovery,app.kubernetes.io/component=api \
  --tail=100

# Engine logs
oc -n trilio-site-recovery logs \
  -l app.kubernetes.io/name=trilio-site-recovery,app.kubernetes.io/component=engine \
  --tail=100

Check API health (Kolla / bare-metal)

curl -s http://127.0.0.1:8788/healthz

Confirm protection groups are healthy after upgrade

openstack dr protection group list
openstack dr replication health <protection-group>

Set a timeout option not modelled by the charm via config-flags

juju config trilio-site-recovery-for-openstack \
  config-flags="engine:cross_site_timeout=60"

Upgrade the CLI on a machine not managed by the charm

sudo apt-get update
sudo apt-get install --only-upgrade python3-triliositerecovery

Troubleshooting

Unit lands in BLOCKED after juju refresh with message about local-site

Symptom: After running juju refresh, the unit status shows BLOCKED with a message such as set local-site, pure-primary-site-name, pure-secondary-site-name.

Cause: This is expected behaviour, not a failed upgrade. Release 1.0.20 no longer infers which site a node belongs to, and the local-site charm option did not exist before the revision you just refreshed to — it could not be set before the refresh.

Fix: Set the required options:

juju config trilio-site-recovery-for-openstack \
  local-site="<this site's registered name>" \
  pure-primary-site-name="<site owning primary array>" \
  pure-secondary-site-name="<the other site>"

The site name must match openstack dr site list exactly. The unit exits BLOCKED once the options are set.


Migration 019 fails with MySQL error 1071

Symptom: protector-manage db sync or the db-sync charm action fails with MySQL error 1071 (index key too long).

Cause: The tenant_mappings table uses the legacy InnoDB COMPACT or REDUNDANT row format. Migration 019 widens two columns inside a composite unique index, growing the key from ~576 to ~800 bytes under utf8mb4. This exceeds the 767-byte limit for legacy row formats.

Fix: Convert the table to DYNAMIC row format before running the migration:

ALTER TABLE tenant_mappings ROW_FORMAT=DYNAMIC;

Then re-run db sync. Alternatively, run the support script first (the migration skips columns already wide enough):

sudo python3 widen_keystone_id_columns.py --apply

DR operations fail with 403 volume_extension:volume_manage after upgrade

Symptom: Failover succeeds through the storage steps but then fails with Policy doesn't allow volume_extension:volume_manage to be performed (HTTP 403).

Cause: The service runs as a tenant through a Keystone trust. Stock Cinder restricts volume manage/unmanage to admin. The required Cinder policy relaxations were not applied, or were applied on only one site.

Fix: Apply the following five Cinder policy rules on both sites:

"volume_extension:volume_manage": "rule:admin_or_owner",
"volume_extension:volume_unmanage": "rule:admin_or_owner",
"volume_extension:services:index": "rule:admin_or_owner",
"volume_extension:type_get": "rule:admin_or_owner",
"volume_extension:type_get_all": "rule:admin_or_owner"

All five are required. The type_get and type_get_all rules are read-only and may be open by default on some Cinder versions, which is why lab environments run without them while production clouds do not.


Trust creation fails with a missing role error after upgrade

Symptom: The first DR operation after the upgrade fails with an error naming a missing Keystone role (for example, dr_operator).

Cause: The default_trust_roles option (default: member,dr_operator) names roles that must exist in Keystone on both sites. Trust creation fails immediately if a named role is absent rather than filtering it out.

Fix: Create the missing roles on both sites:

openstack role create dr_operator
openstack role create dr_site_admin

Then retry the operation. Do not modify default_trust_roles in the config file — the default is correct. If you have set it explicitly and dropped member, restore it: removing member removes Nova and Cinder access from the trust and causes failover to fail at the first instance or volume call.


protector-manage db sync on Kolla silently skips the ENUM preflight

Symptom: After running protector-manage db sync, reconcile operations fail to record in the operations history, or the dr_operations table rejects inserts with an ENUM constraint error.

Cause: Migration 022 adds RECONCILE to the dr_operations.operation_type ENUM. The bare protector-manage db sync command does not run the ENUM preflight automatically — only the Juju charm's db-sync and upgrade actions do. On Kolla and bare-metal deployments, the preflight must be run manually before db sync when crossing migration 022.

Fix: Run the preflight subcommand before syncing:

protector-manage db preflight
protector-manage db sync

config-flags causes DuplicateSectionError in service startup

Symptom: After setting config-flags on the Juju charm, the protector-api or protector-engine service fails to start. Tools reading protector.conf report DuplicateSectionError.

Cause: config-flags appends its own [section] block to the rendered config file. If the key you set via config-flags is already rendered by the charm template, the section appears twice. oslo.config tolerates this (last value wins), but configparser and some support tools do not.

Fix: Only use config-flags for keys that the charm template does not already render. If you need to override a charm-managed key, use the corresponding charm config option instead (for example, use engine-topic rather than config-flags="engine:topic=...").

To remove a conflicting config-flags entry:

juju config trilio-site-recovery-for-openstack --reset config-flags

OpenShift pods not found when querying logs

Symptom: oc logs -l app=trilio-site-recovery-api returns No resources found.

Cause: The OpenShift manifests do not use a bare app label. Using the wrong label selector matches zero pods.

Fix: Use the correct label selectors:

# API pods
oc -n trilio-site-recovery logs \
  -l app.kubernetes.io/name=trilio-site-recovery,app.kubernetes.io/component=api

# Engine pods
oc -n trilio-site-recovery logs \
  -l app.kubernetes.io/name=trilio-site-recovery,app.kubernetes.io/component=engine

On OpenShift, oc logs is the only way to read service output — the services log to stdout and there are no log files in /var/log/protector/.


Protection group is inconsistent after an upgrade-window failover

Symptom: After an upgrade that interrupted a failover or failback, a protection group shows an unexpected status and VMs are not running on the expected site.

Cause: An interrupted failover or failback can leave the protection group in an inconsistent state — partial VM recreation, mismatched replication policy, or status that does not reflect actual storage state.

Fix: Run reconcile on the recovery site. Reconcile works even when the primary site is unreachable:

openstack dr protection group reconcile <protection-group>

Reconcile inspects storage, VMs, and operation history to fix protection group status, relink discovered VMs, restart SHUTOFF workloads on the writable site, and synchronise the corrected state to the peer. The operation is recorded in dr_operations and appears in openstack dr operation list.