Backing Up and Restoring Storage Volumes Using Snapshots

About Storage Volume Snapshots

Creating a snapshot of a storage volume enables you to capture all the data stored on the storage volume. You can retain snapshots as a backup, or use them to create new, identical storage volumes.

If you take multiple snapshots of a storage volume, the first snapshot captures all the data stored on the storage volume at that point in time. Successive snapshots are incremental backups, which capture new or modified data since the previous snapshot. This reduces the storage requirement for your snapshots. When there are ten incremental backups for a specified volume, the next backup is a full backup, which once again captures all the data that is on the storage volume when the snapshot is created. You can restore a storage volume from any snapshot and all the data in the storage volume at that time is restored.

You can create either colocated or remote storage volume snapshots.

  • Colocated snapshots: Snapshots are stored in the same physical location as the original storage volume. Colocated snapshots and volumes from colocated snapshots can be created very quickly. Colocated snapshots are useful for quickly cloning storage volumes within a site. However, you can’t restore volumes across sites using colocated snapshots.


    Colocated snapshots in Compute Classic

    The graphic shows the process for creating a colocated snapshot of a storage volume mounted on one instance and restoring it to a storage volume mounted on another instance in the same site.

  • Remote snapshots: Snapshots aren’t stored in the same location as the original storage volume. Instead, they are stored in the associated Oracle Cloud Infrastructure Object Storage Classic instance. Remote snapshots are useful if your domain spans multiple sites. With remote snapshots, you can create a snapshot in one site, then switch to another site and create a copy of the storage volume on that site. Creating a remote snapshot and restoring a storage volume from a remote snapshot can take more time than for colocated snapshots, as data is written to and from the Oracle Cloud Infrastructure Object Storage Classic instance.


    Remote snapshots in Compute Classic

    The graphic shows the process for creating a remote snapshot of a storage volume mounted on a Compute Classic instance. The snapshot is stored in Oracle Cloud Infrastructure Object Storage Classic and can be restored to a storage volume mounted on another Compute Classic instance, either in the same site or in another site.

Creating a Storage Volume Snapshot

Creating a snapshot of a storage volume enables you to capture all the data that is currently stored on the storage volume.

You can create a snapshot of a storage volume when it is either attached to an instance or detached. If the storage volume is attached to an instance, then only data that has already been written to the storage volume will be captured in the snapshot. Data that is cached by the application or the operating system will be excluded from the snapshot.

Tip:

To create a snapshot of a bootable storage volume that is currently being used by an instance, it is recommended that:
  • if you have created the instance using orchestration v2, suspend the orchestration before you create the snapshot.

  • if you have created the instance using orchestration v1, terminate the instance orchestration to delete the instance before you create the snapshot. Ensure that you stop only the instance orchestration and not the master orchestration or the orchestration that creates storage volumes. That way, only your instance is deleted and re-created and storage volumes or other resources defined in other orchestrations are not deleted.

This ensures that all data is written to the storage volume and no further data can be written to the disk while taking the snapshot. Data on the bootable storage volume is not deleted because the data is stored on a persistent boot disk. You can create the instance again later, after the snapshot is created.

Prerequisites

  • When you create a remote storage snapshot, the snapshot is stored in the associated Oracle Cloud Infrastructure Object Storage Classic instance. Ensure that you’ve set a replication policy for your Oracle Cloud Infrastructure Object Storage Classic instance. See Selecting a Replication Policy for Oracle Cloud Infrastructure Object Storage Classic in Using Oracle Cloud Infrastructure Object Storage Classic.

  • To complete this task, you must have the Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud My Services. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

Procedure

To create a storage volume snapshot:

  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. Click the Storage tab.
    The Storage Volumes page is displayed.
  3. Go to the storage volume that you want to create a snapshot of. From the menu icon menu, select Create Snapshot.
  4. In the Create Storage Snapshot dialog box, enter the required information:
    • Name: Enter a name for the snapshot.
    • Colocated: Specify if you want to create a colocated snapshot. Colocated snapshots are stored in the same physical location as the original storage volume. Colocated snapshots and clones from colocated snapshots are created very quickly. However, you can’t use a colocated snapshot across sites. Colocated snapshots as well as clones created from those snapshots are always on the same site as the original storage volume that you want to clone. If you want to back up a storage volume and restore it on another site in your account, don’t select this option. If you don’t select this option, a remote snapshot is created.
    • Description: Enter a description for this snapshot, if required.
    • Tags: Enter tags to help identify your snapshot, if required.
  5. Click Create.
    A storage volume snapshot is generated.
  6. To see a list of storage snapshots, click Storage Snapshots in the left pane. See Listing Storage Volume Snapshots.

To create a storage volume snapshot using the CLI, use the opc compute storage-snapshot add command. For help with that command, run the command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To create a storage volume snapshot using the API, use the POST /storage/snapshot/ method. For more information, see REST API for Oracle Cloud Infrastructure Compute Classic.

After creating a colocated storage volume snapshot, to use this snapshot to create a storage volume, see Restoring a Storage Volume from a Colocated Snapshot.

After creating a remote storage volume snapshot, to use this snapshot to restore a storage volume, see Restoring a Storage Volume from a Remote Snapshot.

Listing Storage Volume Snapshots

Storage volume snapshots allow you to create a new storage volume from an existing storage volume. You can take multiple snapshots of a storage volume and create multiple storage volumes from a snapshot. After you’ve created a snapshot, you can see a list of snapshots and view information about each snapshot on the Storage Snapshots page.

To complete this task, you must have the Compute_Monitor or Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud My Services. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. Click the Storage tab.
    The Storage Volumes page is displayed.
  3. Click the Storage Snapshots tab in the left pane.

    The Storage Snapshots page displays the list of storage volume snapshots, arranged alphabetically by storage volume name. If there are multiple snapshots of a storage volume, the most recent snapshot is at the top.

    The icon associated with each snapshot listed on this page also shows the status of the snapshot. While a snapshot is being created, the status shows as Initializing. Colocated snapshots are completed quickly, but remote snapshots can take longer to create and the status indicates the percentage of data copied.

    If you create multiple remote snapshots at the same time, the first four snapshots go to the initializing state, and the later snapshots remain in the queued state until the previous snapshots are completed. When a snapshot is completed, its status changes to Completed, and you can perform actions like restoring a storage volume or deleting the snapshot.

    The Storage Snapshots page also displays other relevant information about your storage volume snapshots, including the date each snapshot was created, and for colocated snapshots, the new storage volumes created from each snapshot, if any.

    Tip:

    You can filter the list of storage volume snapshots according to their category. To view storage volumes of a specific category (such as IaaS, PaaS, or Personal), click the Category menu and select the appropriate filter. You can also filter snapshots according to the type of snapshot. To view remote or colocated snapshots, click the Show menu and select the appropriate filter.

  4. (Optional) If your domain spans multiple sites, you can use the Site menu on the Storage Snapshots page to switch to another site. You’ll then be able to view snapshots from another site in your domain.

    Note:

    The Site menu near the top of every page controls the site that you’re logged in to. You use this option to view site resource usage and switch to another site in your domain. The Site menu on the Storage Snapshots page determines the list of storage snapshots displayed on this page. By default, the Site menu on the Storage Snapshots page is set to the current site, so you see the storage snapshots created in the site you’re logged in to. To see storage snapshots created in another site, select that site from the Site menu on the Storage Snapshots page. This action doesn’t change the site that you’re logged in to.

To view a list of your storage volume snapshots using the CLI, use the opc compute storage-snapshot list command. For help with that command, run the command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To view a list of your storage volume snapshots using the API, use the GET /storage/snapshot/container/ method. For more information, see REST API for Oracle Cloud Infrastructure Compute Classic.

After you’ve created a colocated storage volume snapshot, to use this snapshot to create a clone of a storage volume, see Restoring a Storage Volume from a Colocated Snapshot.

After you’ve created a remote storage volume snapshot, to use this snapshot to restore a storage volume, see Restoring a Storage Volume from a Remote Snapshot.

Restoring a Storage Volume from a Colocated Snapshot

You can back up and restore an existing storage volume by creating a colocated snapshot of the storage volume and using the snapshot to create a new storage volume.

Prerequisites

  • To complete this task, you must have the Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud My Services. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

  • You should have already created a colocated snapshot of the storage volume that you want to clone and the process of creating the snapshot should be complete. See Creating a Storage Volume Snapshot.

Procedure

  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. Click the Storage tab.
    The Storage Volumes page is displayed.
  3. In the Storage drop-down list, click Storage Snapshots.
  4. (Optional) To see the list of colocated snapshots, from the Show menu, select Colocated.
  5. Go to the snapshot that you want to create a storage volume from. From the menu icon menu, select Restore Volume.
  6. In the Restore Storage Volume dialog box, enter a name for the new storage volume and specify a description if required.
  7. Click Restore.
A new storage volume is created.

To create a storage volume from a storage volume snapshot using the CLI, use the opc compute storage-volume add command. For help with that command, run the command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To create a storage volume from a storage volume snapshot using the API, use the POST /storage/volume/ method. For more information, see REST API for Oracle Cloud Infrastructure Compute Classic.

After you’ve created a storage volume, to view details of your storage volume, see Viewing Details of a Storage Volume. To attach a storage volume to an instance, see Attaching a Storage Volume to an Instance.

Restoring a Storage Volume from a Remote Snapshot

You can back up an existing storage volume by creating a remote snapshot of the storage volume. Remote snapshots are stored in an associated Oracle Cloud Infrastructure Object Storage Classic instance. You can use the snapshot to restore the storage volume. If your domain spans multiple sites, using remote snapshots allows you to back up a storage volume in one site and restore it in another site.

Prerequisites

  • To complete this task, you must have the Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud My Services. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

  • You should have already created a remote snapshot of the storage volume that you want to restore and the snapshot should be in the complete state. See Creating a Storage Volume Snapshot.

Procedure

  1. Sign in to the Compute Classic console.
  2. (Optional) If your domain spans multiple sites, then ensure that you select the site where you want to create the storage volume. Also check that the site you’ve selected has sufficient capacity to create the required storage volume. Click Site near the top of the page to view resource usage across a site. If resource usage on the selected site is close to maximum, select another site.
  3. Click the Storage tab.
    The Storage Volumes page is displayed.
  4. In the Storage drop-down list, click Storage Snapshots.
  5. (Optional) If your domain spans multiple sites, and if you want to restore a volume from a snapshot created on another site, you can select a site by using the Site menu on the Storage Snapshots page to switch to another site. You’ll then be able to view the snapshots on another site in your domain and select a remote snapshot to restore from.

    Note:

    The Site menu near the top of every page controls the site that you’re logged in to. You use this option to view site resource usage and switch to another site in your domain. The Site menu on the Storage Snapshots page determines the list of storage snapshots displayed on this page. By default, the Site menu on the Storage Snapshots page is set to the current site, so you see the storage snapshots created in the site you’re logged in to. To see storage snapshots created in another site, select that site from the Site menu on the Storage Snapshots page. This action doesn’t change the site that you’re logged in to.

    Note:

    When you view snapshots in another site, there is no actions menu for the colocated snapshots in that site, because you can’t perform any action on the colocated snapshots in another site. To use colocated snapshots that were created in another site, you must switch to the site where the colocated snapshot was created.

  6. (Optional) The Storage Snapshots page displays both colocated and remote snapshots. To list only remote snapshots, from the Show menu, select Remote.

    Note:

    If your domain spans multiple sites and you want to restore a storage volume across sites, you must use remote snapshots. You can’t do this using colocated snapshots.

  7. Go to the completed snapshot that you want to create a storage volume from. From the menu icon menu, select Restore Volume.
  8. In the Restore Storage Volume dialog box, enter a name for the new storage volume and specify a description, if required.
  9. Click Restore.
Depending on the size of the storage volume, it can take some time to restore a storage volume from a remote snapshot. While the storage volume is being created, the status on the Storage Volume page shows Initializing. After the storage volume has been restored, its status changes to Online.

To create a storage volume from a storage volume snapshot using the CLI, use the opc compute storage-volume add command. For help with that command, run the command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To create a storage volume from a storage volume snapshot using the API, use the POST /storage/volume/ method. For more information, see REST API for Oracle Cloud Infrastructure Compute Classic.

After you’ve created a storage volume, to view details of your storage volume, see Viewing Details of a Storage Volume. To attach a storage volume to an instance, see Attaching a Storage Volume to an Instance.

Deleting a Storage Volume Snapshot

You can restore or clone an existing storage volume by creating a snapshot of the storage volume and using the snapshot to create a new storage volume. You can create multiple snapshots of a storage volume. If a storage volume snapshot gets outdated, or if you no longer need a snapshot, you can delete it. You can delete a snapshot when it is in the initializing or online state. When you delete a remote snapshot, the snapshot file in the associated Oracle Cloud Infrastructure Object Storage Classic account is deleted.

Note:

You can’t delete a colocated snapshot if it has been used to create a new storage volume.

Prerequisites

  • To complete this task, you must have the Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud My Services. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

  • If you want to delete a colocated snapshot, ensure that no storage volumes have been created using the snapshot that you want to delete. See Listing Storage Volume Snapshots.

  • If you want to delete a remote snapshot, ensure that no storage volumes are currently being created using the snapshot that you want to delete. If a restored storage volume is in the initializing state, the remote snapshot can’t be deleted.

Note:

You should always use your orchestrations to manage resources that you’ve created using orchestrations. Don’t, for example, use the web console or the CLI or REST API to delete an object that you created using an orchestration. This could cause your orchestration to either attempt to re-create the object and associated resources, or to go into an error state.

If you created the object using orchestration v1, then you can delete the object by terminating the orchestration. See Terminating an Orchestration v1.

If you created the object using an orchestration v2, then you can delete the object by suspending, terminating, or updating the orchestration. See Suspending an Orchestration v2, Terminating an Orchestration v2, or Updating an Orchestration v2.

Procedure

  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. Click the Storage tab.
    The Storage Volumes page is displayed.
  3. In the Storage drop-down list, click Storage Snapshots.
  4. Go to the snapshot that you want to delete. From the menu icon menu, select Delete.

    Note:

    You can’t delete a colocated snapshot if it has been used to create storage volumes. In this case, the Delete option is disabled.

To delete a storage volume snapshot using the CLI, use the opc compute storage-snapshot delete command. For help with that command, run the command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To delete a storage volume snapshot using the API, use the DELETE /storage/snapshot/name method. See REST API for Oracle Cloud Infrastructure Compute Classic.