Backing Up and Restoring an Instance

Oracle Private Cloud Appliance supports backing up and restoring instances. The instance backup is created in an Object Storage bucket. From there, you copy it to another server in your data center for safekeeping. When needed, you can import the backup into any Private Cloud Appliance 3.x Object Storage bucket, and use it to create instances.

The backup and restore process involves using a series of Compute API commands as described in the following sections.

For conceptual information about backing up and restoring instances, refer to "Instance Backup and Restore" in the Compute Instance Concepts chapter in the Oracle Private Cloud Appliance Concepts Guide.

Task Map - Backing Up an Instance

No. Task Links
1.

Ensure that you have an Object Storage bucket in the same tenancy where the instance is located.

2.

Create the instance backup.

Creating an Instance Backup

3.

Transfer the backup object from Object Storage to another system in your data center.

Transferring an Instance Backup to Another System

Task Map – Restoring an Instance From a Backup

The following tasks assume that you are restoring an instance from a backup that is on another system in your data center. If the backup is already on the Private Cloud Appliance where you plan to restore the instance, start with task number 3.

No. Task Links

1.

Ensure that you have an Object Storage bucket in the same tenancy where you plan to restore the instance.

2.

Upload the backup to the bucket.

Transferring an Instance Backup From Another System to Private Cloud Appliance

3. Identify the backup OCID. Listing Instance Backups

4.

Import the backup from the bucket into the appliance.

Importing an Instance Backup

5.

Finish restoring the instance by creating an instance using the imported instance backup.

Finishing the Instance Restore

Creating an Instance Backup

This section describes how to back up an instance to an Object Storage bucket.

The instance can be running or stopped. The boot volume and any block volumes must be attached.

Caution:

During the backup process, do not perform any volume attach or detach operations on the instance.

The duration of the backup varies based on the amount of data on the instance boot and block volumes. A small instance that only has a 50 GB boot volume takes only a few minutes to complete. If the instance volumes are as large as 32 TB, the backup can take up to 6 hours to complete.

Prerequisites

  • You must have an Object Storage bucket in the tenancy where the instance is located. See Creating a Bucket.
  • Quiesce instance activities such as running applications so that the backup is created at a known state.

Using the Compute Web UI

  1. In the navigation menu, under Compute, click Instances.

  2. If needed, select the compartment where your instance is located.
  3. Click the name of the instance you plan to back up.
  4. Click Controls and select Export.

  5. In the dialog box, select these items:

    • If needed, change the compartment to the compartment where the bucket with the backup is located by clicking (Change).

    • Select the Bucket.

  6. Click Create Export.

  7. To see the progress, under Resources, click Work Requests.

  8. To see the status of an instance backup, under Resources, click Instance Exports.

To transfer the backup to another server or to another appliance, see Transferring an Instance Backup to Another System.

Using the Compute API

export API – Creates an instance backup to an Object Storage bucket in the specified compartment.

API Endpoint

https://<mgmt_node_VIP>:30003/20160918/instances/<instance_OCID>/actions/export

where:

  • <mgmt_node_VIP> is the management node VIP host name or IP address.

  • <instance_OCID> is the instance ID.

Pass these key-value pairs:

{
	"bucketName": "<bucket_name>",
	"destinationType": "objectStorageTuple",
	"namespaceName": "<namespace_name>",
	"compartmentId": "<bucket_compartment_OCID>"
}

You can verify that the instance backup completed by using commands described in Listing Instance Backups.

Listing Instance Backups

The procedures in this section show you how to list backups for a given instance.

When you list instance backups, you are able to identify these components of the backup:

  • Backup OCID

  • Boot volume OCID

  • Instance OCID

  • Image OCID

Using the Compute Web UI

  1. In the navigation menu, under Compute, click any of the following links.

    • Instance Exports: Displays the list of instance backups.
    • Instance Imports: Displays the list of imported instance backups that can be used to create new instances.

Using the Compute API

There are two API endpoints for viewing instance backups:

  • List All Instance Backups in a Bucket.

    API endpoint

    https://<mgmt_node_VIP>:30003/20160918/instances/instanceBackups?compartmentId=<bucket_compartment_OCID>

    where:

    • <mgmt_node_VIP> is the management node VIP host name or IP address.

    • <bucket_compartment_OCID> is the compartment ID where the Object Storage bucket is located.

  • Get Instance Backup Details

    API endpoint

    https://<mgmt_node_VIP>:30003/20160918/instanceBackups/<instance_backup_id>

    where:

    • <mgmt_node_VIP> is the management node VIP host name or IP address.

    • <instance_backup_id> is the backup ID, which you can get from the backup export output or from listing backups with the API.

Transferring an Instance Backup

The procedures in this section describe how to transfer an instance backup to another system and how to transfer an instance backup back to any Private Cloud Appliance 3.x.

Transferring an Instance Backup to Another System

You can use this procedure to transfer the instance backup to another system in your data center for safekeeping.

Instance backups are large files. Ensure that you have enough space on your system to store the backup. You can use the oci os object list command to display the size of the instance backup. See Viewing Objects in a Bucket.

Using the OCI CLI

  1. Gather the information that you need to run the command.

  2. Run this command.

    Syntax (entered on a single line):

    oci os object get 
    --namespace-name <object_storage_namespace>
    --bucket-name <bucket_name> 
    --name <object_name> 
    --file <file_location>

    <file_location> is the destination path for the file being downloaded, such as C:\workspace\backups\ocid1.instance.uniqueID or /home/downloads/backups/ocid1.instance.uniqueID.

    Example:

    oci os object get  \
    --namespace-name mytenant  \
    --bucket-name my-backup-bucket  \
    --name ocid1.instance.uniqueID  \
    --file /home/downloads/backups/ocid1.instance.uniqueID
    Downloading object  [########################------------]   68%  00:00:05

Transferring an Instance Backup From Another System to Private Cloud Appliance

Use this procedure to transfer an instance backup from another system in your data center to an Object Storage bucket in Private Cloud Appliance.

Using the OCI CLI

  1. Gather the information that you need to run the command.

  2. Upload the instance backup to an Object Storage bucket in the target appliance.

    Use the oci os object put command.

    Syntax (entered on a single line):

    oci os object put  \
    --namespace-name <namespace_name>  \
    --bucket-name <bucket_name>  \
    --file <instance_backup_pathname>

    The value of <instance_backup_pathname> is the path name of the object being uploaded, such as C:\workspace\backups\ocid1.instance.uniqueID or /home/downloads/backups/ocid1.instance.uniqueID.

    Example:

    oci os object put  \
    --namespace-name mytenant  \
    --bucket-name target-bucket  \
    --file ./ocid1.instance.uniqueID
    
    Upload ID: f000bf64-9a96-4008-b1cc-f6b2595b04b1
    Split file into 35 parts for upload.
    Uploading object  [####################################]  100%
    {
      "etag": "ef7bdd67a72536e29da97f3414f4118e",
      "last-modified": "2022-07-06T17:50:00",
      "opc-multipart-md5": "htOEPyjWDFA4Bs2urJJPRQ==-35"
    

Restoring an Instance from an Instance Backup

You restore an instance by importing the instance backup from an Object Storage bucket. Next, create the instance using the boot volume from the backup as the image source. Then attach any block volumes that were included in the backup.

Importing an Instance Backup

Importing an instance backup copies the backup from an Object Storage backup to a location that is internal to the appliance.

For a given instance backup, you can only have one imported copy. If you need to import the same instance backup again, you must first delete the original instance backup. See Deleting an Instance Backup.

Prerequisites

Using the Compute Web UI

  1. Identify the OCID of the backup you plan to use.

    See Listing Instance Backups.

  2. In the navigation menu, under Compute, click Instances.

  3. Click Import.

  4. In the dialog box, select these items:

    • If needed, change the compartment to the compartment where the bucket with the backup is located by clicking (Change).

    • Select the Bucket.

    • Select the Backup OCID.

  5. Click Create Import.

  6. When the import is finished, perform the steps in Finishing the Instance Restore.

Using the Compute API

import API – Imports the instance backup from an Object Storage bucket so that instances can be created from the backup.

API endpoint

https://<mgmt_node_VIP>:30003/20160918/instanceBackups<instance_backup_OCID>/actions/import

where:

  • <mgmt_node_VIP> is the management node VIP host name or IP address.

  • <instance_backup_OCID> is the instance backup ID.

Pass these key-value pairs:

{
	"bucketName": "<bucket_name>",
	"destinationType": "objectStorageTuple",
	"namespaceName": "<namespace_name>",
	"compartmentId": "<bucket_compartment_OCID>"
}
When the import is complete, perform the steps in Finishing the Instance Restore.

Finishing the Instance Restore

Perform these steps to create as many instances as you like from the instance backup.

  1. Create an instance by following the instructions in Creating an Instance). While doing so, perform these actions:

    • For the source image, specify a backup boot volume instead of an image. Then select an imported instance.

    • If the instance requires access using SSH, ensure that you include an SSH public key.

  2. (Optional) Attach any block volumes that were included in the instance backup.

    See Attaching a Volume.

Deleting an Instance Backup

You can use the DELETE API to delete exported and imported instance backups. The API sets the exported backup lifecycle state to TERMINATED and performs one of these actions based on the type of backup:

  • Imported instance backups: Deletes the instance backup.
  • Exported instance backups: Deletes the instance backup (source for importing) from object storage bucket

Terminated instance backups are eventually cleaned up by a background task.

Using the Compute API

DELETE API – Deletes instance backups

API endpoint

https://<mgmt_node_VIP>:30003/20160918/instancesBackups<instance_backup_OCID>

where:

  • <mgmt_node_VIP> is the management node VIP host name or IP address.

  • <instance_backup_OCID> is the instance backup ID.