Managing Disaster Recovery Configurations
This section explains how to configure disaster recovery settings on two Oracle Private Cloud Appliance systems such that each system is the fallback for the other system.
- Rules and Conditions
-
When populating DR configurations, respect the following rules regarding compute and storage resources.
-
A compute instance must be stopped before it can be added to a DR configuration. There is one exception: when all volumes attached to the instance are also attached to one or more instances already included in the same DR configuration.
-
A compute instance must be stopped before it can be removed from a DR configuration. There is one exception: when all volumes attached to the instance are also attached to one or more instances still included in the same DR configuration.
-
All compute instances in a DR configuration must be stopped before the DR configuration can be deleted.
-
A volume attached to a compute instance might be created from another source volume or volume backup. Such an instance (instance T) can be added to a DR configuration on condition that the source volume is not attached to any instance in any DR configuration. Note that source volume also refers to the volume used for the volume backup, and its direct or indirect source.
Alternatively, the instance with the source volume attached can be added to a DR configuration on condition that instance T is not added to any DR configuration. Due to the volume source/target relationship, only one of the instances involved can be part of a DR configuration, not both.
-
Refreshing a DR configuration results in a failure in case a volume and the source from which it was created, are both attached to one or more compute instances in any DR configuration.
-
Creating a DR Configuration
A DR configuration is the parent object to which you add compute instances that you want to protect against system outages.
Using the Service CLI
-
Gather the information that you need to run the command:
-
a unique name for the DR configuration
-
a unique name for the associated ZFS storage project
-
-
Create an empty DR configuration with the
drCreateConfig
command.Syntax (entered on a single line):
drCreateConfig configName=<DR_configuration_name> project=<ZFS_storage_project_name>
Example:
PCA-ADMIN> drCreateConfig configName=drConfig1 project=drProject1 Command: drCreateConfig configName=drConfig1 project=drProject1 Status: Success Time: 2021-08-17 07:19:33,163 UTC Data: Message = Successfully started job to create config drConfig1 Job Id = 252041b1-ff44-4c8e-a3de-11c1e47d9217
-
Use the job ID to check the status of the operation you started.
PCA-ADMIN> drGetJob jobid=252041b1-ff44-4c8e-a3de-11c1e47d9217 Command: drGetJob jobid=252041b1-ff44-4c8e-a3de-11c1e47d9217 Status: Success Time: 2021-08-17 07:21:07,021 UTC Data: Type = create_config Job Id = 252041b1-ff44-4c8e-a3de-11c1e47d9217 Status = finished Start Time = 2021-08-17 07:19:33.507048 End Time = 2021-08-17 07:20:16.783743 Result = success Message = job successfully retrieved Response = Successfully created DR config drConfig1: 439ad078-7e6a-4908-affa-ac89210d76ac
-
When the DR configuration is created, the storage project for data replication is set up on the ZFS Storage Appliances.
Note the DR configuration ID. You need it for all subsequent commands to modify the configuration.
-
To display a list of existing DR configurations, use the
drGetConfigs
command.PCA-ADMIN> drGetConfigs Command: drGetConfigs Status: Success Time: 2021-08-17 07:44:54,443 UTC Data: id configName -- ---------- 439ad078-7e6a-4908-affa-ac89210d76ac drConfig1 e8291afa-a413-4932-880a-abb8ac22c85d drConfig2 7ad05d9f-731c-41b8-b477-35da4b999071 drConfig3
-
To display the status and details of a DR configuration, use the
drGetConfig
command.Syntax:
drGetConfig drConfigId=<DR_configuration_id>
Example:
PCA-ADMIN> drGetConfig drConfigId=439ad078-7e6a-4908-affa-ac89210d76ac Command: drGetConfig drConfigId=439ad078-7e6a-4908-affa-ac89210d76ac Status: Success Time: 2021-08-17 07:47:53,401 UTC Data: Type = DrConfig Config State = ENABLED Config Name = drConfig1 Config Id = 439ad078-7e6a-4908-affa-ac89210d76ac Project Id = drProject1
Adding Site Mappings to a DR Configuration
Site mappings are added to determine how and where on the replica system the instances should be brought back up in case the primary system experiences an outage and a failover is triggered. Each site mapping contains a source object for the primary system and a corresponding target object for the replica system. Make sure that these resources exist on both the primary and replica system before you add the site mappings to the DR configuration.
These are the site mapping types you can add to a DR configuration:
-
Compartment: specifies that, if a failover occurs, instances from the source compartment must be brought up in the target compartment on the replica system
-
Subnet: specifies that, if a failover occurs, instances connected to the source subnet must be connected to the target subnet on the replica system
-
Network security group: specifies that, if a failover occurs, instances that belong to the source network security group must be included in the target security group on the replica system
Using the Service CLI
-
Gather the information that you need to run the command:
-
DR configuration ID (
drGetConfigs
) -
Mapping source and target object OCIDs
Use the Compute Enclave UI or CLI on the primary and replica system respectively. CLI commands:
-
oci iam compartment list
-
oci network subnet list --compartment-id "ocid1.compartment.....uniqueID"
-
oci network nsg list --compartment-id "ocid1.compartment.....uniqueID"
-
-
-
Add a site mapping to the DR configuration with the
drAddSiteMapping
command.Syntax (entered on a single line):
drAddSiteMapping drConfigId=<DR_configuration_id> objType=[compartment | subnet | networksecuritygroup] sourceId=<source_object_OCID> targetId=<target_object_OCID>
Examples:
PCA-ADMIN> drAddSiteMapping \ drConfigId=63b36a80-7047-42bd-8b97-8235269e240d \ objType=compartment \ sourceId="ocid1.compartment.....<region1>...uniqueID" \ targetId="ocid1.compartment.....<region2>...uniqueID" Command: drAddSiteMapping drConfigId=63b36a80-7047-42bd-8b97-8235269e240d objType=compartment sourceId="ocid1.compartment.....<region1>...uniqueID" targetId="ocid1.compartment.....<region2>...uniqueID" Status: Success Time: 2021-08-17 09:07:24,957 UTC Data: 9244634e-431f-43a1-89ab-5d25905d43f9 PCA-ADMIN> drAddSiteMapping \ drConfigId=63b36a80-7047-42bd-8b97-8235269e240d \ objType=subnet \ sourceId="ocid1.subnet.....<region1>...uniqueID" \ targetId="ocid1.subnet.....<region2>...uniqueID" Command: drAddSiteMapping drConfigId=63b36a80-7047-42bd-8b97-8235269e240d objType=subnet sourceId="ocid1.subnet.....<region1>...uniqueID" targetId="ocid1.subnet.....<region2>...uniqueID" Status: Success Time: 2021-08-17 09:07:24,957 UTC Data: d1bf2cf2-d8c7-4271-b8b6-cdf757648175 PCA-ADMIN> drAddSiteMapping \ drConfigId=63b36a80-7047-42bd-8b97-8235269e240d \ objType=networksecuritygroup \ sourceId="ocid1.nsg.....<region1>...uniqueID" \ targetId="ocid1.nsg.....<region2>...uniqueID" Command: drAddSiteMapping drConfigId=63b36a80-7047-42bd-8b97-8235269e240d objType=networksecuritygroup sourceId="ocid1.nsg.....<region1>...uniqueID" targetId="ocid1.nsg.....<region2>...uniqueID" Status: Success Time: 2021-08-17 09:07:24,957 UTC Data: 422f8892-ba0a-4a89-bc37-61b5c0fbbbaa
-
Repeat the command with the OCIDs of all the source and target objects that you want to include in the site mappings of the DR configuration.
Note:
Mappings for compartments and subnets are always required in order to perform a failover or switchover. Missing mappings will be detected by the Oracle Site Guard scripts during a precheck on the replica system. -
To display the list of site mappings included in the DR configuration, use the
drGetSiteMappings
command. The DR configuration ID is a required parameter.Syntax:
drGetSiteMappings drConfigId=<DR_configuration_id>
Example:
PCA-ADMIN> drGetSiteMappings drConfigId=63b36a80-7047-42bd-8b97-8235269e240d Command: drGetSiteMappings drConfigId=63b36a80-7047-42bd-8b97-8235269e240d Status: Success Time: 2021-08-17 09:19:22,580 UTC Data: id name -- ---- d1bf2cf2-d8c7-4271-b8b6-cdf757648175 null 9244634e-431f-43a1-89ab-5d25905d43f9 null 422f8892-ba0a-4a89-bc37-61b5c0fbbbaa null
-
To display the status and details of a site mapping included in the DR configuration, use the
drGetSiteMapping
command.Syntax (entered on a single line):
drGetSiteMapping drConfigId=<DR_configuration_id> mappingId=<site_mapping_id>
Example:
PCA-ADMIN> drGetSiteMapping drConfigId=63b36a80-7047-42bd-8b97-8235269e240d mappingId=d1bf2cf2-d8c7-4271-b8b6-cdf757648175 Command: drGetSiteMapping drConfigId=63b36a80-7047-42bd-8b97-8235269e240d mappingId=d1bf2cf2-d8c7-4271-b8b6-cdf757648175 Status: Success Time: 2021-08-17 09:25:53,148 UTC Data: Type = DrSiteMapping Object Type = subnet Source Id = ocid1.nsg.....<region1>...uniqueID Target Id = ocid1.nsg.....<region2>...uniqueID Work State = Normal
Removing Site Mappings from a DR Configuration
You can remove a site mapping from the DR configuration if it is no longer required.
Using the Service CLI
-
Gather the information that you need to run the command:
-
DR configuration ID (
drGetConfigs
) -
Site mapping ID (
drGetSiteMappings
)
-
-
Remove the selected site mapping from the DR configuration with the
drRemoveSiteMapping
command.Syntax (entered on a single line):
drRemoveSiteMapping drConfigId=<DR_configuration_id> mappingId=<site_mapping_id>
Example:
PCA-ADMIN> drRemoveSiteMapping drConfigId=63b36a80-7047-42bd-8b97-8235269e240d mappingId=422f8892-ba0a-4a89-bc37-61b5c0fbbbaa Command: drRemoveSiteMapping drConfigId=63b36a80-7047-42bd-8b97-8235269e240d mappingId=422f8892-ba0a-4a89-bc37-61b5c0fbbbaa Status: Success Time: 2021-08-17 09:41:43,319 UTC
-
Repeat the command with the IDs of all the site mappings that you want to remove from the DR configuration.
Adding Instances to a DR Configuration
Once a DR configuration has been created and the relevant site mappings have been set up, you add the required compute instances. Their data and disks are stored in the ZFS storage project associated with the DR configuration, and replicated over the network connection between the ZFS Storage Appliances of both Private Cloud Appliance systems.
If your system contains optional high-performance disk shelves, you must set up peering accordingly between the ZFS Storage Appliances. As a result, two ZFS projects are created for each DR configuration: one in the standard pool and one in the high-performance pool. When you add instances to the DR configuration that have disks running on standard as well as high-performance storage, those storage resources are automatically added to the ZFS project in the appropriate pool.
Using the Service CLI
-
Gather the information that you need to run the command:
-
DR configuration ID (
drGetConfigs
) -
Instance OCIDs from the Compute Enclave UI or CLI (
oci compute instance list --compartment-id <compartment_OCID>
)
-
-
Add a compute instance to the DR configuration with the
drAddComputeInstance
command.Syntax (entered on a single line):
drAddComputeInstance drConfigId=<DR_configuration_id> instanceId=<instance_OCID>
Example:
PCA-ADMIN> drAddComputeInstance \ drConfigId=63b36a80-7047-42bd-8b97-8235269e240d \ instanceId=ocid1.instance.....<region1>...uniqueID Command: drAddComputeInstance drConfigId=63b36a80-7047-42bd-8b97-8235269e240d instanceId=ocid1.instance.....<region1>...uniqueID Status: Success Time: 2021-08-17 07:24:35,186 UTC Data: Message = Successfully started job to add instance ocid1.instance.....<region1>...uniqueID to DR config 63b36a80-7047-42bd-8b97-8235269e240d Job Id = 8dcbd22d-69b0-4319-b09f-1a4df847e9df
-
Use the job ID to check the status of the operation you started.
PCA-ADMIN> drGetJob jobId=8dcbd22d-69b0-4319-b09f-1a4df847e9df Command: drGetJob jobId=8dcbd22d-69b0-4319-b09f-1a4df847e9df Status: Success Time: 2021-08-17 07:36:27,719 UTC Data: Type = add_computeinstance Job Id = 8dcbd22d-69b0-4319-b09f-1a4df847e9df Status = finished Start Time = 2021-08-17 07:24:36.776193 End Time = 2021-08-17 07:26:59.406929 Result = success Message = job successfully retrieved Response = Successfully added instance [ocid1.instance.....<region1>...uniqueID] to DR config [63b36a80-7047-42bd-8b97-8235269e240d]
-
Repeat the
drAddComputeInstance
command with the OCIDs of all the compute instances that you want to add to the DR configuration. -
To display the list of instances included in the DR configuration, use the
drGetComputeInstances
command. The DR configuration ID is a required parameter.Syntax:
drGetComputeInstances drConfigId=<DR_configuration_id>
Example:
PCA-ADMIN> drGetComputeInstances drConfigId=63b36a80-7047-42bd-8b97-8235269e240d Command: drGetComputeInstances drConfigId=63b36a80-7047-42bd-8b97-8235269e240d Status: Success Time: 2021-08-17 08:33:39,586 UTC Data: id name -- ---- ocid1.instance.....<region1>...instance1_uniqueID null ocid1.instance.....<region1>...instance2_uniqueID null ocid1.instance.....<region1>...instance3_uniqueID null
-
To display the status and details of an instance included in the DR configuration, use the
drGetComputeInstance
command.Syntax (entered on a single line):
drGetComputeInstance drConfigId=<DR_configuration_id> instanceId=<instance_OCID>
Example:
PCA-ADMIN> drGetComputeInstance \ drConfigId=63b36a80-7047-42bd-8b97-8235269e240d \ instanceId=ocid1.instance.....<region1>...instance1_uniqueID Command: drGetComputeInstance drConfigId=63b36a80-7047-42bd-8b97-8235269e240d instanceId=ocid1.instance.....<region1>...instance1_uniqueID Status: Success Time: 2021-08-17 08:34:42,413 UTC Data: Type = ComputeInstance Compartment Id = ocid1.compartment........uniqueID Boot Volume Id = ocid1.bootvolume........uniqueID Compute Instance Shape = VM.PCAStandard1.8 Work State = Normal
Removing Instances from a DR Configuration
Instances can only be part of a single DR configuration. You can remove a compute instance from the DR configuration to which it was added.
Using the Service CLI
-
Gather the information that you need to run the command:
-
DR configuration ID (
drGetConfigs
) -
Instance OCID (
drGetComputeInstances
)
-
-
Remove the selected compute instance from the DR configuration with the
drRemoveComputeInstance
command.Syntax (entered on a single line):
drRemoveComputeInstance drConfigId=<DR_configuration_id> instanceId=<instance_OCID>
Example:
PCA-ADMIN> drRemoveComputeInstance \ drConfigId=63b36a80-7047-42bd-8b97-8235269e240d \ instanceId=ocid1.instance.....<region1>...instance3_uniqueID Command: drRemoveComputeInstance drConfigId=63b36a80-7047-42bd-8b97-8235269e240d instanceId=ocid1.instance.....<region1>...instance3_uniqueID Status: Success Time: 2021-08-17 08:45:59,718 UTC Data: Message = Successfully started job to remove instance ocid1.instance.....<region1>...instance3_uniqueID from DR config 63b36a80-7047-42bd-8b97-8235269e240d Job Id = 303b42ff-077c-4504-ac73-25930652f73a
-
Use the job ID to check the status of the operation you started.
PCA-ADMIN> drGetJob jobId=303b42ff-077c-4504-ac73-25930652f73a Command: drGetJob jobId=303b42ff-077c-4504-ac73-25930652f73a Status: Success Time: 2021-08-17 08:56:27,719 UTC Data: Type = remove_computeinstance Job Id = 303b42ff-077c-4504-ac73-25930652f73a Status = finished Start Time = 2021-08-17 08:46:00.641212 End Time = 2021-08-17 07:47:19.142262 Result = success Message = job successfully retrieved Response = Successfully removed instance [ocid1.instance.....<region1>...instance3_uniqueID] from DR config [63b36a80-7047-42bd-8b97-8235269e240d]
-
Repeat the
drRemoveComputeInstance
command with the OCIDs of all the compute instances that you want to remove from the DR configuration.
Refreshing a DR Configuration
To ensure that the replication information stored in a DR configuration is updated with all the latest changes in your environment, you can refresh the DR configuration.
Using the Service CLI
-
Look up the ID of the DR configuration you want to refresh (
drGetConfigs
). -
Refresh the data stored in the selected DR configuration with the
drRefreshConfig
command.Syntax:
drRefreshConfig drConfigId=<DR_configuration_id>
Example:
PCA-ADMIN> drRefreshConfig drConfigId=63b36a80-7047-42bd-8b97-8235269e240d Command: drRefreshConfig drConfigId=63b36a80-7047-42bd-8b97-8235269e240d Status: Success Time: 2021-08-17 10:43:33,241 UTC Data: Message = Successfully started job to refresh DR config 63b36a80-7047-42bd-8b97-8235269e240d Job Id = 205eb34e-f416-41d3-95a5-506a1d891fdb
-
Use the job ID to check the status of the operation you started.
PCA-ADMIN> drGetJob jobId=205eb34e-f416-41d3-95a5-506a1d891fdb Command: drGetJob jobId=205eb34e-f416-41d3-95a5-506a1d891fdb Status: Success Time: 2021-08-17 10:51:27,719 UTC Data: Type = refresh_config Job Id = 205eb34e-f416-41d3-95a5-506a1d891fdb Status = finished Start Time = 2021-08-17 10:43:34.264828 End Time = 2021-08-17 10:45:12.718561 Result = success Message = job successfully retrieved Response = Successfully refreshed DR config [63b36a80-7047-42bd-8b97-8235269e240d]
Deleting a DR Configuration
When you no longer need a DR configuration, you can remove it with a single command. It also removes all site mappings and cleans up the associated storage projects on the ZFS Storage Appliances of the primary and replica system. However, you must stop all compute instances that are part of the DR configuration before you can delete it.
Using the Service CLI
-
Stop all the compute instances that are part of the DR configuration you want to delete.
-
Look up the ID of the DR configuration you want to delete (
drGetConfigs
). -
Delete the selected DR configuration with the
drDeleteConfig
command.Syntax:
drDeleteConfig drConfigId=<DR_configuration_id>
Example:
PCA-ADMIN> drDeleteConfig drConfigId=63b36a80-7047-42bd-8b97-8235269e240d Command: drDeleteConfig drConfigId=63b36a80-7047-42bd-8b97-8235269e240d Status: Success Time: 2021-08-17 14:45:19,634 UTC Data: Message = Successfully started job to delete DR config 63b36a80-7047-42bd-8b97-8235269e240d Job Id = d2c1198d-f521-4b8d-a9f1-c36c7965d567
-
Use the job ID to check the status of the operation you started.
PCA-ADMIN> drGetJob jobId=d2c1198d-f521-4b8d-a9f1-c36c7965d567 Command: drGetJob jobId=d2c1198d-f521-4b8d-a9f1-c36c7965d567 Status: Success Time: 2021-08-17 16:18:33,462 UTC Data: Type = delete_config Job Id = d2c1198d-f521-4b8d-a9f1-c36c7965d567 Status = finished Start Time = 2021-08-17 14:45:20.105569 End Time = 2021-08-17 14:53:32.405569 Result = success Message = job successfully retrieved Response = Successfully deleted DR config [63b36a80-7047-42bd-8b97-8235269e240d]