Cloning a Boot Volume

Learn how to create a clone from an existing boot volume without repeating the backup and restore process.

You can create a clone from a boot volume using the Oracle Cloud Infrastructure Block Volume service. Cloning enables you to make a copy of an existing boot volume without needing to go through the backup and restore process. For more information about the Block Volume service, see Overview of Block Volume and the Block Volume FAQ.

A boot volume clone is a point-in-time direct disk-to-disk deep copy of the source boot volume, so all the data that is in the source boot volume when the clone is created is copied to the boot volume clone. Any subsequent changes to the data on the source boot volume are not copied to the boot volume clone. Since the clone is a copy of the source boot volume it will be the same size as the source boot volume unless you specify a larger volume size when you create the clone.

The clone operation occurs immediately and you can use the cloned boot volume as soon as the state changes to available.

There is a single point-in-time reference for a source boot volume while it is being cloned, so if you clone a boot volume while the associated instance is running, you need to wait for the first clone operation to complete from the source before creating additional clones. You also need to wait for any backup operations to complete as well.

You can only create a clone for a boot volume within the same region, availability domain, and tenant. You can create a clone for a boot volume between compartments as long as you have the required access permissions for the operation.

Differences Between Boot Volume Backups and Clones

Consider the following criteria when you decide whether to create a backup or a clone of a volume.

Criteria  Volume Backup Volume Clone
Description Creates a point-in-time backup of data on a volume. You can restore multiple new volumes from the backup later in the future. Creates a single point-in-time copy of a volume without having to go through the backup and restore process.
Use case

Retain a backup of the data in a volume, so that you can duplicate an environment later or preserve the data for future use.

Meet compliance and regulatory requirements, because the data in a backup remains unchanged over time.

Support business continuity requirements.

Reduce the risk of outages or data mutation over time.

Rapidly duplicate an existing environment. For example, you can use a clone to test configuration changes without impacting your production environment.

Speed Slower (minutes or hours) Faster (seconds)
Cost Lower cost Higher cost
Storage location Object Storage Block Volume
Retention policy Policy-based backups expire, manual backups do not expire No expiration
Volume groups Supported. You can back up a volume group. Supported. You can clone a volume group.

For more information about boot volume backups, see Boot Volume Backups and Manually Backing Up a Boot Volume.

Steps

    1. On the Boot Volumes list page, select the boot volume you want to work with. If you need help finding the list page or the boot volume, see Listing Boot Volumes.
    2. On the details page, select Clones.
    3. Select Create Clone.

    4. Specify a name for the clone. Avoid entering confidential information.

    5. Select the compartment for the clone to be created in.
    6. (Optional) Select the cluster placement group to assign to the clone.
      Note

      This option is visible when cluster placement groups are enabled for the tenancy, and you've created and activated a cluster placement group with the capability added for volume resources. See Cluster Placement Groups for Block Volume.
    7. To clone the boot volume to a larger size volume, select Custom Boot Volume Size (GB) and then specify the new size. You can only increase the size of the volume, you can't decrease the size. If you clone the boot volume to a larger size volume, you need to extend the volume's partition. See Extending the Partition for a Boot Volume for more information.

    8. (Optional) Enable cross-region replication.
      1. In the Cross ad/region replication), move the Enable cross ad/region replication toggle to the right to enable cross-region replication.
      2. Select the target region for the replica.
      3. Select the availability domain for the replica.
      4. Enter a name for the replica.
      5. Select Confirm to acknowledge the cost warning.

      6. (Optional) Encrypt the data for replicas of this clone by using your own encryption key. For more information, see Customer-Managed Encryption Keys for Cross-Region Operations.
        1. Select Encrypt using customer-managed keys.
        2. Enter the OCID for the encryption key in the destination region.
          Note

          The service doesn't support encrypting volumes with keys that are encrypted using the Rivest-Shamir-Adleman (RSA) algorithm. When you use your own keys, you must use keys that are encrypted using the Advanced Encryption Standard (AES) algorithm. This restriction applies to block volumes and boot volumes.
      7. (Optional) Encrypt the data in this volume by using your own encryption key. For more information, see Customer-Managed Encryption Keys for Cross-Region Operations.
        1. Under Volume Encryption, select Encrypt using customer-managed keys.
        2. Select the vault compartment and vault that contain the master encryption key you want to use.
        3. Select the master encryption key compartment and master encryption key.
          Note

          The service doesn't support encrypting volumes with keys that are encrypted using the Rivest-Shamir-Adleman (RSA) algorithm. When you use your own keys, you must use keys that are encrypted using the Advanced Encryption Standard (AES) algorithm. This restriction applies to block volumes and boot volumes.
    9. (Optional) Select Show tagging options to add tags to the volume. If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you're not sure whether to apply tags, skip this option or ask an administrator. You can apply tags later.

    10. Select Create clone.

    The clone is ready for use the State column lists it as Available in the Boot Volume Clones list.

  • Use the oci bv boot-volume create --source-boot-volume-id command and specify the --source-boot-volume-id parameter to clone that boot volume:

    oci bv boot-volume create --source-boot-volume-id volume_id

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the CreateBootVolume operation and specify the BootVolumeSourceFromBootVolumeDetails attribute for the CreateBootVolumeDetails resource.

Next Steps

After you have cloned a boot volume backup, you can:

Making a boot volume clone while an instance is running creates a crash-consistent clone, meaning the data is in the identical state it was in at the time the clone was made. This is the same state it would be in the case of a loss of power or hard crash. In most cases you can use the cloned boot volume to create an instance, however to ensure a bootable image, you should create a custom image from your instance. For information about creating custom images, see Managing Custom Images.