|
| 1 | +# evaluate-pg-rpo.py |
| 2 | + |
| 3 | +RPO Estimation for a FSDR Protection Group |
| 4 | + |
| 5 | +Reviewed: 24.03.2026 |
| 6 | + |
| 7 | +# When to use this asset? |
| 8 | + |
| 9 | +It can be used to roughly estimate the global RPO of a _FSDR Protection Group_ and as an example on how |
| 10 | +use the Python SDK and OCI API to get the replication metrics of some services. |
| 11 | + |
| 12 | +# How to use this asset? |
| 13 | + |
| 14 | +This is a simple Python script that can be used just passing the FSDR Protection Group ID and having access to the |
| 15 | +Primary and Secondary region. |
| 16 | + |
| 17 | +# Disclaimer |
| 18 | + |
| 19 | +This is program is just meant as an example on how to collect replication information from the FSDR PG underlying services. The |
| 20 | +evaluate RPO is not to consider an indication on a _real RPO_ which depends on multiple factors and which should be always |
| 21 | +evaluated taking into account the workload characteristics and the application behavior. |
| 22 | + |
| 23 | +# Overview |
| 24 | + |
| 25 | +FSDR is DR coordinator and orchestrator service and it doesn't influence its Protection Groups RPO in any way. |
| 26 | +The PG RPO depends only on the underline services and their replication methods. That said, this python script |
| 27 | +allows to evaluate the _maximum RPO_ of the group using the exposed replication metrics of its services. |
| 28 | + |
| 29 | +# Prerequisites |
| 30 | + |
| 31 | +You'll need Python3 and the following packages: |
| 32 | + |
| 33 | +- OCI module |
| 34 | +- PyYAML module |
| 35 | + |
| 36 | + |
| 37 | +For example, on Linux or MacOS, using a virtual environment configured with _pyenv_: |
| 38 | + |
| 39 | +```sh |
| 40 | +pyenv shell 3.14.2 |
| 41 | +pip install OCI |
| 42 | +pip install PyYAML |
| 43 | +``` |
| 44 | + |
| 45 | +# Currently Supported Services |
| 46 | + |
| 47 | +Currently, the script supports the following resources in the protection group: |
| 48 | + |
| 49 | +- Movable Virtual Machine |
| 50 | +- Block Volume Group |
| 51 | +- File System Service |
| 52 | +- Object Storage Buckets |
| 53 | +- Base DB System |
| 54 | +- Autonomous Database |
| 55 | +- OKE Cluster |
| 56 | + |
| 57 | +# Usage |
| 58 | + |
| 59 | +The script -h flag shows the usage options: |
| 60 | + |
| 61 | +```sh |
| 62 | +./evaluate_pg_rpo.py -h |
| 63 | +usage: evaluate_pg_rpo [-h] [-p PROTECTION_GROUP_ID] [-r REGION] [-t] [-c CONFIGURATION_FILE] [-d] [-v] |
| 64 | + |
| 65 | +Evaluate the RPO of a FSDR Protection Group. |
| 66 | + |
| 67 | +options: |
| 68 | + -h, --help show this help message and exit |
| 69 | + -p, --protection_group_id PROTECTION_GROUP_ID |
| 70 | + -r, --region REGION |
| 71 | + -t, --tagging Tagging flag, when enabled write the RPO in a free-form tag on the PG. Defaulting to no |
| 72 | + tagging. |
| 73 | + -c, --configuration_file CONFIGURATION_FILE |
| 74 | + OCI configuration file, defaulting to ~/.oci/config. If the string "none" is provided, instance principal |
| 75 | + authentication is used. |
| 76 | + -d, --debug Debug flag, defaulting to no debug |
| 77 | + -v, --version Shows version. |
| 78 | + ``` |
| 79 | + |
| 80 | + |
| 81 | +# Output Example |
| 82 | + |
| 83 | +```sh |
| 84 | + python3 ./evaluate-pg-rpo.py -p ocid1.drprotectiongroup.oc1.eu-milan-1.<hidden> |
| 85 | + |
| 86 | +Components RPO: |
| 87 | +-------- Type -------- -------- Name -------- --- RPO (sec) --- |
| 88 | +OBJECT_STORAGE_BUCKET mushop-media-cris 108 |
| 89 | +OBJECT_STORAGE_BUCKET mushop-cris 108 |
| 90 | +VOLUME_GROUP mushop-vg 173 |
| 91 | +AUTONOMOUS_DATABASE MuShopDB-cris 60 |
| 92 | + |
| 93 | +Protection Group RPO: |
| 94 | +Global RPO : 173 sec |
| 95 | +Component driving RPO : VOLUME_GROUP |
| 96 | +``` |
| 97 | + |
| 98 | +# Useful Links |
| 99 | + |
| 100 | +- [FSDR Documentation](https://docs.oracle.com/en-us/iaas/disaster-recovery/index.html) |
| 101 | +- [OCI Python SDK](https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/pythonsdk.htm) |
| 102 | +- [pyenv util](https://github.com/pyenv/pyenv) |
| 103 | +- [PyYAML Module](https://pypi.org/project/PyYAML/) |
| 104 | + |
| 105 | + |
| 106 | +# License |
| 107 | + |
| 108 | +Copyright (c) 2026 Oracle and/or its affiliates. |
| 109 | + |
| 110 | +Licensed under the Universal Permissive License (UPL), Version 1.0. |
| 111 | + |
| 112 | +See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE.txt) for more details. |
0 commit comments