Creating and Maintaining Site Mappings

Site mappings determine how and where on the standby Private Cloud Appliance system the instances should be brought back up in case the primary system experiences an outage.

Each site mapping consists of a source object on the primary system and a corresponding target object on the standby system. Ensure that these resources exist on both systems before you add the site mappings to the DR configuration.

Adding Site Mappings

These are the site mapping types you can include in a DR configuration:

  • Compartment: specifies that, if a failover or switchover occurs, instances from the source compartment must be brought up in the target compartment on the standby system

  • Subnet: specifies that, if a failover or switchover occurs, instances connected to the source subnet must be connected to the target subnet on the standby system

Using the Service CLI
  1. 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 standby system respectively.

      CLI commands:

      • oci iam compartment list

      • oci network subnet list --compartment-id "ocid1.compartment.....uniqueID"

  2. 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]
    sourceId=<source_object_OCID>
    targetId=<target_object_OCID>

    Examples:

    PCA-ADMIN> drAddSiteMapping drConfigId=d3cd87de-afd4-4718-a3e6-1105b56b42d8 objType=compartment \
    sourceId=ocid1.compartment....<region1>....uniqueID targetId=ocid1.compartment....<region1>....uniqueID
    Data:
      Message = Successfully added site mapping to DR config [mydrconf1]
      Returned Object Id = 77233b2c-aa4a-4314-8196-4d8dd1d20721
    
    PCA-ADMIN> drAddSiteMapping drConfigId=d3cd87de-afd4-4718-a3e6-1105b56b42d8 objType=subnet \
    sourceId=ocid1.subnet....<region1>....uniqueID targetId=ocid1.subnet....<region2>....uniqueID
    Data:
      Message = Successfully added site mapping to DR config [mydrconf1]
      Returned Object Id = 4467bb39-7256-4715-9a01-bedd25f73a82
  3. 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.

  4. 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:

    PCA-ADMIN> drGetSiteMappings drConfigId=d3cd87de-afd4-4718-a3e6-1105b56b42d8
    Data:
      id                                     Object Type
      --                                     -----------
      77233b2c-aa4a-4314-8196-4d8dd1d20721   compartment
      6ef9e3b6-6704-4260-b345-f55e364ba9e9   compartment
      4467bb39-7256-4715-9a01-bedd25f73a82   subnet
      096a5499-9720-4a4f-a8be-ce055f0efd5d   subnet
  5. To display the status and details of a site mapping included in the DR configuration, use the drGetSiteMapping command. The DR configuration ID and site mapping ID are required parameters.

    PCA-ADMIN> drGetSiteMapping drConfigId=d3cd87de-afd4-4718-a3e6-1105b56b42d8 mappingId=4467bb39-7256-4715-9a01-bedd25f73a82
    Data:
      Type = DrSiteMapping
      Mapping Id = 4467bb39-7256-4715-9a01-bedd25f73a82
      Object Type = subnet
      Source Id = ocid1.subnet1....<region1>....uniqueID
      Target Id = ocid1.subnet1....<region2>....uniqueID
      Message = Successfully retrieved mapping data
Using the Service Web UI
  1. Collect the OCIDs of the source and target objects you are going to map. Use the Compute Enclave UI or CLI on the primary and standby system respectively. CLI commands:

    • oci iam compartment list

    • oci network subnet list --compartment-id "ocid1.compartment.....uniqueID"

  2. Under Disaster Recovery Service, open the DR Configurations page. In the table, click the configuration to which you want to add site mappings. The DR Configuration detail page appears.

  3. In the Resources section, click Site Mappings.

    On the right hand side of the Site Mappings box, click Add Site Mapping.

  4. In the Add Site Mapping window, enter the following information in the respective fields:

    • Object Type: Specify which resource type you are mapping. Enter either compartment or subnet.

    • Target ID: Enter the OCID of the target object on the remote system.

    • Source ID: Enter the OCID of the source object on the local system.

    Click Add Site Mapping. The new site mapping appears in the resources table.

    Optionally, click the site mapping to display its detail page.

  5. Repeat these steps to add all the required site mappings.

    As cloud resources across the environment are added and removed over time, verify on a regular basis that the site mappings in the DR configuration are up-to-date.

Removing Site Mappings

You can remove a site mapping from the DR configuration if it is no longer required.

Using the Service CLI
  1. Gather the information that you need to run the command:

    • DR configuration ID (drGetConfigs)

    • Site mapping ID (drGetSiteMappings)

  2. 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=d3cd87de-afd4-4718-a3e6-1105b56b42d8 mappingId=1ce736ef-13f9-40a9-aa6b-3e8960261224
    Data:
      Message = Successfully removed mapping [1ce736ef-13f9-40a9-aa6b-3e8960261224] from DR config [mydrconf1]
  3. Repeat the command with the IDs of all the site mappings that you want to remove from the DR configuration.

Using the Service Web UI
  1. Under Disaster Recovery Service, open the DR Configurations page. In the table, click the configuration for which you want to edit site mappings. The DR Configuration detail page appears.

  2. In the Resources section, click Site Mappings. All existing site mappings are displayed in the table.

  3. In the Actions column, open the quick menu (3 dots) and click Remove Site Mapping.

    Alternatively, click the site mapping to display its detail page. In the top-right corner, click Remove Site Mapping.

  4. Repeat until all obsolete site mappings have been removed.

    As cloud resources across the environment are added and removed over time, verify on a regular basis that the site mappings in the DR configuration are up-to-date.