Adding and Removing Compute Instances
When the relevant site mappings have been set up in the DR configuration, 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 peer connection between the Private Cloud Appliance systems.
Adding Instances
Compute instances must be stopped before you add them to a DR configuration. Instances can be added one at a time, per compartment, or all at once across all compartments.
In the Service Web UI, compute instances must be added one by one.
- Using the Service CLI
-
-
Gather the information that you need to run the command:
-
DR configuration ID (
drGetConfigs) -
Instance OCIDs from the Service Enclave UI or CLI (
oci compute instance list --compartment-id <compartment_OCID>)
-
-
Add compute instances to the DR configuration with the
drAddComputeInstancecommand.Syntax (entered on a single line):
drAddComputeInstance drConfigId=<DR_configuration_id> instanceId="<instance-1_OCID>","<instance-n_OCID>" compartmentId="<compartment-1_OCID>","<compartment-1_OCID>" all=TrueNote
When selecting "all", the instance and compartment parameters cannot be included in the command.
Examples:
-
individual instances: single instance or comma-separated list
PCA-ADMIN> drAddComputeInstance drConfigId=d3cd87de-afd4-4718-a3e6-1105b56b42d8 instanceId="ocid1.instance1....uniqueID","ocid1.instance2....uniqueID" Data: Message = Successfully started job to add instance to config d3cd87de-afd4-4718-a3e6-1105b56b42d8 Job Id = dc0787ef-c254-4d91-b7dc-ca4d2412f461 -
all instances in a compartment: single compartment or comma-separated list
PCA-ADMIN> drAddComputeInstance drConfigId=d3cd87de-afd4-4718-a3e6-1105b56b42d8 compartmentId="ocid1.compartment1....uniqueID","ocid1.compartment2....uniqueID" Data: Message = Successfully started job to add instance to config d3cd87de-afd4-4718-a3e6-1105b56b42d8 Job Id = 3801d0be-f2ab-48d5-ad12-cd8afd444bc2 -
all instances across all mapped compartments
PCA-ADMIN> drAddComputeInstance drConfigId=d3cd87de-afd4-4718-a3e6-1105b56b42d8 all=True Data: Message = Successfully started job to add instance to config d3cd87de-afd4-4718-a3e6-1105b56b42d8 Job Id = d0a11091-f202-4350-b59a-f0cddc9fb035
-
-
Use the job ID to check the status of the operation you started.
PCA-ADMIN> drGetJob jobId=3801d0be-f2ab-48d5-ad12-cd8afd444bc2 Data: Type = add_computeinstance Job Id = 3801d0be-f2ab-48d5-ad12-cd8afd444bc2 Status = finished Result = success Message = job successfully retrieved Response = Successfully added the following instances to mydrconf1 ['ocid1.instance1....uniqueID','ocid1.instance2....uniqueID'] -
Repeat the
drAddComputeInstancecommand to add all the required compute instances to the DR configuration. -
To display the list of instances included in the DR configuration, use the
drGetComputeInstancescommand. The DR configuration ID is a required parameter.PCA-ADMIN> drGetComputeInstances drConfigId=d3cd87de-afd4-4718-a3e6-1105b56b42d8 Data: id -- ocid1.instance1....uniqueID ocid1.instance2....uniqueID ocid1.instance3....uniqueID ocid1.instance4....uniqueID -
To display the status and details of an instance included in the DR configuration, use the
drGetComputeInstancecommand. The DR configuration ID and instance ID are required parameters.PCA-ADMIN> drGetComputeInstance drConfigId=d3cd87de-afd4-4718-a3e6-1105b56b42d8 instanceId=ocid1.instance1....uniqueID Data: Compartment Id = ocid1.compartment....uniqueID Boot Volume Id = ocid1.bootvolume....uniqueID Compute Instance Shape = VM.PCAStandard1.Flex Message = Successfully retrieved instance data
-
- Using the Service Web UI
-
-
Collect the OCIDs of the compute instances that need to be added to the DR configuration. Use the Service Enclave UI, or these CLI commands:
-
oci iam compartment list -
oci compute instance list --compartment-id <compartment_OCID>
-
-
Under Disaster Recovery Service, open the DR Configurations page. In the table, click the configuration to which you want to add compute instances. The DR Configuration detail page appears.
-
In the Resources section, click Compute Instances.
On the right hand side of the Compute Instances box, click Add Instance.
-
In the Add Compute Instances window, select compute instances using one of these methods:
-
By instance OCID
Add a single instance by entering its OCID. Add multiple instances by entering their OCIDs as a comma-separated list.
-
By compartment OCID
Add all instances in a compartment by entering the compartment OCID. Add instances from multiple compartments by entering the compartment OCIDs as a comma-separated list.
-
All
Add all instances from all mapped compartments.
Click Submit. A DR job is started. When it completes successfully, the instances appear in the resources table.
To track progress, under Disaster Recovery Service, select Jobs. The Jobs table reports the status of each job. Click a record in the table to display the job details.
-
-
Check regularly for instances requiring DR protection, and repeat these steps whenever necessary.
As cloud resources across the environment are added and removed over time, verify on a regular basis that the list of compute instances in the DR configuration is up-to-date.
-
Removing Instances
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 instances from the DR configuration with the
drRemoveComputeInstancecommand.Syntax (entered on a single line):
drRemoveComputeInstance drConfigId=<DR_configuration_id> instanceId=<instance_OCID> compartmentId=<compartment_OCID> all=TrueNote
When selecting "all", the instance and compartment parameters cannot be included in the command.
Examples:
-
single instance
PCA-ADMIN> drRemoveComputeInstance drConfigId=d3cd87de-afd4-4718-a3e6-1105b56b42d8 instanceId=ocid1.instance....uniqueID Data: Message = Successfully started job to remove instance(s) from DR config d3cd87de-afd4-4718-a3e6-1105b56b42d8 Job Id = 20f6735e-7702-4d27-ba19-41cf08a86d90 -
all instances in a compartment
PCA-ADMIN> drRemoveComputeInstance drConfigId=d3cd87de-afd4-4718-a3e6-1105b56b42d8 compartmentId=ocid1.compartment....uniqueID Data: Message = Successfully started job to remove instance(s) from DR config d3cd87de-afd4-4718-a3e6-1105b56b42d8 Job Id = c4b0ff83-45e3-4498-98bb-e8a2f6b904e8 -
all instances in the DR configuration
PCA-ADMIN> drRemoveComputeInstance drConfigId=d3cd87de-afd4-4718-a3e6-1105b56b42d8 all=True Data: Message = Successfully started job to remove instance(s) from DR config d3cd87de-afd4-4718-a3e6-1105b56b42d8 Job Id = 0a2cdc62-1d13-4774-b3c6-d2a30b75db5e
-
-
Use the job ID to check the status of the operation you started.
PCA-ADMIN> drgetjob jobId=20f6735e-7702-4d27-ba19-41cf08a86d90 Data: Type = remove_computeinstance Job Id = 20f6735e-7702-4d27-ba19-41cf08a86d90 Status = finished Result = success Message = job successfully retrieved Response = Successfully removed the following instances from mydrconf1 ['ocid1.instance....uniqueID'] -
Repeat the
drRemoveComputeInstancecommand to remove all the required compute instances from the DR configuration.
-
- Using the Service Web UI
-
-
Under Disaster Recovery Service, open the DR Configurations page. In the table, click the configuration from which you want to remove compute instances. The DR Configuration detail page appears.
-
In the Resources section, click Compute Instances. All instances included in the DR configuration are displayed in the table.
-
To quickly remove a single instance, in the Actions column, open the quick menu (3 dots) and click Delete. To remove multiple instances, proceed to the next step.
-
Open the Controls menu in the top-right corner of the DR Configuration detail page and click Remove Instances.
-
In the Remove Compute Instances window, select compute instances for removal using one of these methods:
-
By instance OCID
Remove a single instance by entering its OCID. Remove multiple instances by entering their OCIDs as a comma-separated list.
-
By compartment OCID
Remove all instances in a compartment by entering the compartment OCID. Remove instances included from multiple compartments by entering the compartment OCIDs as a comma-separated list.
-
All
Remove all instances included from all mapped compartments.
Click Submit. A DR job is started. When it completes successfully, the instances are removed from the resources table.
To track progress, under Disaster Recovery Service, select Jobs. The Jobs table reports the status of each job. Click a record in the table to display the job details.
-
-
Check regularly for instances that no longer require DR protection, and repeat these steps whenever necessary.
As cloud resources across the environment are added and removed over time, verify on a regular basis that the list of compute instances in the DR configuration is up-to-date.
-