7 Block Volume Storage

Block Volumes provide high-performance network storage capacity that supports a broad range of I/O intensive workloads.

You can use block volumes to expand the storage capacity of your compute instances, to provide durable and persistent data storage that can be migrated across compute instances, and to host large databases.

The Block Volume service lets you dynamically provision and manage block storage volumes. You can create, attach, connect, and move volumes to meet your storage, performance, and application requirements.

After a block volume is created, you attach the volume to one or more instances. You can use the volume like a regular hard drive. You can also disconnect a volume and attach it to another instance without the loss of data.

There are two types of volumes:

  • Block volume: A detachable block storage device that allows you to dynamically expand the storage capacity of an instance.

  • Boot volume: A detachable boot volume device that contains the image used to boot a Compute instance.

For more conceptual information, refer to the Block Volume Storage Overview section in the Oracle Private Cloud Appliance Concepts Guide.

This section provides instructions for managing Block Volumes.

Creating and Attaching Block Volumes

Task Flow

No. Task Links
1.

Create a block volume.

Creating a Block Volume

2.

Attach the block volume to one or more instances.

Attaching a Volume

or

Attaching a Volume to Multiple Instances

3. Identify the added block volume and perform administrative tasks. Find Your Volume in the Instance
4.

Configure the volume to automatically mount when the instance is rebooted.

Configuring Volumes to Automatically Mount (Linux Instances)

Creating a Block Volume

Block volumes are created using the Block Volume service.

Using the OCI CLI, you can set values for the Synchronous Write Bias and Secondary Cache properties.

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Block Volumes.

  2. Click Create Block Volume.

  3. Fill in the required volume information:

    • Name: Provide a name or description for the volume. Avoid entering confidential information.

    • Compartment: Select the compartment in which to create the block volume.

    • Size (in GBs): Must be between 50 GB and 32 TB and specified in 1 GB increments.

    • High Performance Volume: Optionally, choose to create a volume using the high performance feature. If not enabled, the volume uses balanced performance.

      • High performance: The Higher Performance elastic performance option is recommended for workloads with the highest I/O requirements, requiring the best possible performance, such as large databases.

      • Balanced performance: Suitable for most applications including boot volumes.

      For more information, refer to "Block Volume Performance Options" in the Block Volume Storage Overview in the Oracle Private Cloud Appliance Concepts Guide.

    • Backup Policy: Optionally, you can enable the use of a backup policy for this volume. Select a backup policy from the drop-down list.

      For more information about backup policies, see Managing Backup Policies.

    • Tagging: Optionally, add one or more tags to this resource.

      If you are not sure whether to apply tags, skip this option (you can apply tags later).

      For more information about tagging resources, see Working with Resource Tags.

  4. Click Create Block Volume.

    The volume is ready to attach to an instance after its icon lists the volume in the Available state.

    See Attaching a Volume.

Using the OCI CLI

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

    • Availability Domain Name (oci iam availability-domain list)

    • Compartment OCID (oci iam compartment list)

  2. Run the oci bv volume create command.

    This procedure does not show all available parameters for this command. For information about additional parameters, run the command with the --help option.

    Syntax:

    oci bv volume create --availability-domain availability_domain_name \
    --compartment-id compartment_OCID

    Example specifying only required parameters:

    oci bv volume create --availability-domain ad1 \
    --compartment-id ocid1.compartment.unique_ID
    {
      "data": {
        "auto-tuned-vpus-per-gb": null,
        "availability-domain": "ad1",
        "compartment-id": "ocid1.compartment.unique_ID",
        "defined-tags": {},
        "display-name": "volume20210106171509",
        "freeform-tags": {},
        "id": "ocid1.volume.unique_ID",
        "is-auto-tune-enabled": null,
        "is-hydrated": null,
        "kms-key-id": null,
        "lifecycle-state": "PROVISIONING",
        "size-in-gbs": 50,
        "size-in-mbs": 51200,
        "source-details": null,
        "system-tags": null,
        "time-created": "2021-06-01T17:15:09+00:00",
        "volume-group-id": null,
        "vpus-per-gb": 0
      },
      "etag": "d507e0b7-cffa-4eae-bfdb-ede81bc132d5"
    }

    Example specifying values for the logBias and secondaryCache properties:

    You can use OraclePCA defined tags to set values for the logBias and secondaryCache properties. See Adding Tags at Resource Creation for information about how to specify a defined tag.

    The logBias or Synchronous Write Bias property controls the use of the write cache flash devices for a share or LUN ("Logzilla"). The value of the logBias property must be either LATENCY or THROUGHPUT. If this value is not set, the value LATENCY is used.

    The secondaryCache property controls the use of the read cache flash devices for a share or LUN ("Readzilla"). The value of the secondaryCache property must one of ALL, METADATA, or NONE. If this value is not set, the value ALL is used.

    The values of the logBias and secondaryCache properties can be changed with the update command.

    oci bv volume create --availability-domain ad1 \
    --compartment-id ocid1.compartment.unique_ID --display-name myblockvolume \
    --defined-tags '{"OraclePCA":{"logBias":"THROUGHPUT","secondaryCache":"METADATA"}}'
    {
      "data": {
        "auto-tuned-vpus-per-gb": null,
        "autotune-policies": null,
        "availability-domain": "ad1",
        "block-volume-replicas": null,
        "compartment-id": "ocid1.compartment.unique_ID",
        "defined-tags": {
          "OraclePCA": {
            "logBias": "THROUGHPUT",
            "secondaryCache": "METADATA"
          }
        },
        "display-name": "myblockvolume",
        "freeform-tags": {},
        "id": "ocid1.volume.unique_ID",
        "is-auto-tune-enabled": null,
        "is-hydrated": null,
        "kms-key-id": null,
        "lifecycle-state": "PROVISIONING",
        "size-in-gbs": 50,
        "size-in-mbs": 51200,
        "source-details": null,
        "system-tags": null,
        "time-created": "2022-12-08T21:05:36.647925+00:00",
        "volume-group-id": null,
        "vpus-per-gb": 0
      },
      "etag": "08d0abc9-60c6-4fc7-b6fe-85d0af1c0308",
      "opc-work-request-id": "ocid1.workrequest.unique_ID"
    }

    When the volume is in the AVAILABLE state, you can attach the volume to an instance. See Attaching a Volume.

Attaching a Volume

You can attach a volume to an instance to expand the available storage on the instance. You can attach volumes to more than one instance at a time, see Attaching a Volume to Multiple Instances.

You can also attach a boot volume that has been detached from its instance to another instance as a data volume. This activity is convenient for troubleshooting a boot volume and for performing administrative activities while the boot volume is detached from its instance.

Important:

Only attach Linux volumes to Linux instances and Microsoft Windows volumes to Microsoft Windows instances.

Important:

If you are reattaching a volume that was detached, it might be associated with a different device name and the instance operating system might not recognize the volume.

Using the Compute Web UI

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

  2. Select the compartment where the instance resides.

  3. In the Instances list, click the instance that you want to attach a volume to.

  4. In the lower left panel, under Resources, select Attached Block Volumes.

  5. In the Attached Block Volumes panel, click Attach Block Volume.

  6. Select the compartment where the block volume resides.

  7. Select a Block Volume.

  8. Select one of the access methods:

    • Read/Write: (Default) Configures the volume attachment with read/write capabilities. It cannot be shared with other instances. This option enables attachment to a single instance only.

    • Read/Write - Shareable: Configures the volume attachment as read/write, shareable with other instances. This option enables read/write attachment to multiple instances.

    • Read Only - Shareable: Configures the volume attachment as read-only, enabling attachment to multiple instances

  9. Click Attach to Instance.

Using the OCI CLI

This procedure shows the minimum required parameters for this command. For information about optional parameters, run the command with the --help option.

The following optional parameter enables you to attach a shareable volume. If this parameter is omitted, it defaults to false.

--is-shareable <TRUE | FLASE>
  1. Gather the information that you need to run the command:

    • Instance OCID (oci compute instance list --compartment-id <compartment_OCID> )

    • Volume OCID (oci bv volume list --compartment-id <compartment_OCID> )

  2. Run the oci compute volume-attachment attach command.

    Syntax (entered on a single line):

    oci compute volume-attachment attach
    --instance-id <instance_OCID>
    --volume-id <volume_OCID>
    --type paravirtualized

    Example:

    oci compute volume-attachment attach   \
    --instance-id ocid1.instance.….….….uniqueID  \
    --volume-id ocid1.volume.….….….uniqueID   \
    --type paravirtualized
    {
      "data": {
        "attachment-type": "paravirtualized",
        "availability-domain": "MyAD",
        "compartment-id": "ocid1.compartment.….….….uniqueID",
        "device": null,
        "display-name": "volumeattachment.….….….uniqueID",
        "id": "ocid1.volumeattachment.….….….uniqueID",
        "instance-id": "ocid1.instance.….….….uniqueID",
        "is-pv-encryption-in-transit-enabled": null,
        "is-read-only": false,
        "is-shareable": false,
        "lifecycle-state": "ATTACHED",
        "time-created": "2021-06-01T17:24:13+00:00",
        "volume-id": "ocid1.volume.….….….uniqueID"
      }
    }

Attaching a Volume to Multiple Instances

The Block Volume service provides the capability to attach a block volume to multiple compute instances. With this feature, you can share block volumes across instances in read/write or read-only mode. Attaching block volumes as read/write and shareable enables you to deploy and manage cluster-aware solutions.

There are important limitations and considerations for attaching volumes to multiple instances. For more information, refer to the Block Volume Storage Overview chapter in the Oracle Private Cloud Appliance Concepts Guide.

Important:

If you are attaching a volume that was detached, it might be associated with a different device name and the instance operating system might not recognize the volume.

Configuring Multiple Instance Volume Attachments with Read/Write Access

The Block Volume service does not provide coordination for concurrent write operations to volumes attached to multiple instances. To prevent data corruption from uncontrolled read/write operations, you must install and configure a cluster aware system or solution such as Oracle Cluster File System version 2 (OCFS2) on top of the shared storage before you can use the volume.

This is a summary of the required steps:

  1. Attach the block volume to an instance as Read/Write-Shareable using the UI, CLI, or API.

    See Attaching a Volume

  2. Set up your OCFS2/O2CB cluster nodes.

  3. Create your OCFS2 file system and mount point.

Configuring Multiple Instance Volume Attachments with Read-Only Mode

Once you attach a block volume to an instance as read-only, it can only be attached to other instances as read-only. If you want to attach the block volume to an instance as read/write, you need to detach the block volume from all instances and then you can reattach the block volume to instances as read/write.

  1. Attach the block volume to an instance as read-only using the UI, CLI, or API.

    See Attaching a Volume

  2. Attach the block volume to additional instances as read-only using the UI, CLI, or API.

    See Attaching a Volume

Find Your Volume in the Instance

When a block volume is initially attached to an instance, the instance sees the volume as a new disk, for example, as device /dev/sdb. This procedure describes how to list the disk devices in an instance so that you can find the volume.

For UNIX-based images, if you want to mount these volumes when an instance boots, you need to add the volume to the /etc/fstab file. See Configuring Volumes to Automatically Mount (Linux Instances).

Optionally, you can perform various administrative tasks to configure the storage to suit your storage requirements.

The utilities you use to perform the administrative tasks vary depending on the type of OS in the instance. For additional administrative information, refer to the documentation for the version of the OS that is on the instance. These documentation libraries provide access to helpful information:

Identifying the Boot Volume and the Attached Block Volume Devices in the Instance Using Linux Commands

  1. Log on to your instance as described in Connecting to a Compute Instance.

  2. List the disk devices.

    Important:

    On UNIX type operating systems, the order in which volumes are attached is non-deterministic, so it can change with each reboot. If you refer to a volume using the device name, such as /dev/sdb, and you have more than one non-root volume, there is no guarantee that the volume you intend to mount for a specific device name will be the volume mounted. When configuring the OS to recognize the block volume (for example, adding the volume to the /etc/fstab file), use the volume's SCSI ID as described in this procedure.

    sudo ls /dev/sd*
    /dev/sda  /dev/sda1  /dev/sda2  /dev/sdb

    In this example, two devices are listed, /dev/sda and /dev/sdb.

  3. Use the fdisk -l command to view configuration information about the devices.

    In this example, /dev/sda is the boot volume. And /dev/sdb is the attached block volume.

    sudo fdisk -l
    
    Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 8192 bytes / 8192 bytes
    Disk label type: dos
    Disk identifier: 0x000af694
    
       Device Boot Start End Blocks Id System
    /dev/sda1 * 2048 2099199 1048576 83 Linux
    /dev/sda2 2099200 61442047 29671424 8e Linux LVM
    
    Disk /dev/mapper/ol-root: 27.2 GB, 27229421568 bytes, 53182464 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 8192 bytes / 8192 bytes
    
    
    Disk /dev/mapper/ol-swap: 3145 MB, 3145728000 bytes, 6144000 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 8192 bytes / 8192 bytes
    
    
    Disk /dev/sdb: 1099.5 GB, 1099511627776 bytes, 2147483648 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 8192 bytes / 8192 bytes

    This example output provides this information about /dev/sda and /dev/sdb:

    • The size of /dev/sda is 53.7 GB (boot volume).

    • /dev/sda has two partitions: /dev/sda1 and /dev/sda2.

    • The size of /dev/sdb is 1099.5 GB (the attached block volume), and does not have any partitions.

  4. Identify the devices that have file systems and are mounted in the OS.

    sudo df -T
    Filesystem          Type     1K-blocks    Used Available Use% Mounted on
    devtmpfs            devtmpfs  16318164       0  16318164   0% /dev
    tmpfs               tmpfs     16332596       0  16332596   0% /dev/shm
    tmpfs               tmpfs     16332596    8744  16323852   1% /run
    tmpfs               tmpfs     16332596       0  16332596   0% /sys/fs/cgroup
    /dev/mapper/ol-root xfs       26578248 2907292  23670956  11% /
    /dev/sda1           xfs        1038336  292512    745824  29% /boot
    tmpfs               tmpfs      3266520       0   3266520   0% /run/user/0

    In this example:

    • /dev/sda1 has an xfs file system and it is mounted on /boot (the boot volume).

    • /dev/sdb is not listed because this block volume was just attached and hasn't had a file system created and is not mountable yet.

  5. Find the SCSI ID for the newly attached volume.

    sudo ls -l /dev/disk/by-id
    total 0
    lrwxrwxrwx. 1 root root 10 Dec  6 18:26 dm-name-ol-root -> ../../dm-0
    lrwxrwxrwx. 1 root root 10 Dec  6 18:26 dm-name-ol-swap -> ../../dm-1
    lrwxrwxrwx. 1 root root 10 Dec  6 18:26 dm-uuid-LVM-83pr2aUrW2ZdCbWgsN4ZRFqvsXGGNZ8JO6il7j1YTWpywZeewYCiA6ywDmIeho1G -> ../../dm-0
    lrwxrwxrwx. 1 root root 10 Dec  6 18:26 dm-uuid-LVM-83pr2aUrW2ZdCbWgsN4ZRFqvsXGGNZ8JsaUihE3RWozk5u4p5nOwG9sFcj34AU3F -> ../../dm-1
    lrwxrwxrwx. 1 root root 10 Dec  6 18:26 lvm-pv-uuid-Dh9ydC-Rj90-chhj-tkwq-ZI0Z-mfop-Wtg5bh -> ../../sda2
    lrwxrwxrwx. 1 root root  9 Dec  6 18:26 scsi-3600144f096933b92000061ae9bfc0025 -> ../../sda
    lrwxrwxrwx. 1 root root 10 Dec  6 18:26 scsi-3600144f096933b92000061ae9bfc0025-part1 -> ../../sda1
    lrwxrwxrwx. 1 root root 10 Dec  6 18:26 scsi-3600144f096933b92000061ae9bfc0025-part2 -> ../../sda2
    lrwxrwxrwx. 1 root root  9 Dec  8 15:17 scsi-3600144f096933b92000061b1129e0037 -> ../../sdb
    lrwxrwxrwx. 1 root root  9 Dec  6 18:26 wwn-0x600144f096933b92000061ae9bfc0025 -> ../../sda
    lrwxrwxrwx. 1 root root 10 Dec  6 18:26 wwn-0x600144f096933b92000061ae9bfc0025-part1 -> ../../sda1
    lrwxrwxrwx. 1 root root 10 Dec  6 18:26 wwn-0x600144f096933b92000061ae9bfc0025-part2 -> ../../sda2
    lrwxrwxrwx. 1 root root  9 Dec  8 15:17 wwn-0x600144f096933b92000061b1129e0037 -> ../../sdb

    In this example, the following line shows the SCSI ID assigned to sdb:

    lrwxrwxrwx. 1 root root 9 Dec 8 15:17 scsi-3600144f096933b92000061b1129e0037 -> ../../sdb

    where scsi-3600144f096933b92000061b1129e0037 is the SCSI ID.

    The SCSI ID is a persistent device name for /dev/sdb and is used when performing administrative operations on the device, such as partitioning, creating a file system, and mounting.

    For more information about mounting a block volume file system to an instance, see Configuring Volumes to Automatically Mount (Linux Instances).

  6. Perform administrative tasks to configure the block volume to suit your storage requirements.

    The specific tasks you perform depend on the type of OS that runs the instance and how you want the storage configured. Refer to your OS documentation for details.

Configuring Volumes to Automatically Mount (Linux Instances)

On Linux instances, if you want to automatically mount volumes during an instance boot, you need add the volumes to the /etc/fstab file.

Before You Begin

Get the SCSI ID for the block volume you plan to mount. See Find Your Volume in the Instance

On Linux operating systems, specify the volume SCSI ID in the /etc/fstab file instead of the device name (for example, /dev/sdb). This is an example of a Volume SCSI ID:

/dev/disk/by-id/scsi-3600144f096933b92000061b1129e0037

Adding Volumes to the /etc/fstab File

  1. Prepare the newly attached block volume for mounting.

    Use the disk administration utilities included with instance OS to perform tasks such as the following:

    • Partition the volume

    • Create file systems on the volume or partitions

    Consult the documentation for your instance OS for details.

    This is an example of creating an ext4 file system for a block volume attached to a Linux instance:

    mkfs.ext4 /dev/disk/by-id/scsi-3600144f096933b92000061b1129e0037
    mke2fs 1.42.9 (28-Dec-2013)
    /dev/disk/by-id/scsi-3600144f096933b92000061b1129e0037 is entire device, not just one partition!
    Proceed anyway? (y,n) y
    Filesystem label=
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    Stride=2 blocks, Stripe width=2 blocks
    67108864 inodes, 268435456 blocks
    13421772 blocks (5.00%) reserved for the super user
    First data block=0
    Maximum filesystem blocks=2415919104
    8192 block groups
    32768 blocks per group, 32768 fragments per group
    8192 inodes per group
    Superblock backups stored on blocks:
            32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
            4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
            102400000, 214990848
    
    Allocating group tables: done
    Writing inode tables: done
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information: done
  2. Create a mount point for each file system you plan to mount.

    mkdir /mnt/volume1
  3. Add the volume to the /etc/fstab file.

    For this example, the following new line is added to the /etc/fstab file . . .

    /dev/disk/by-id/scsi-3600144f096933b92000061b1129e0037 /mnt/volume1 ext4 _netdev,nofail 0 0

    . . . using these field values:

    • Device: Specified using the SCSI ID: /dev/disk/by-id/scsi-3600144f096933b92000061b1129e003.

    • Mount point: The mount point created in the previous step: /mnt/volume1

    • Type: The type of file system, ext4 in this example.

    • Options:

      • _netdev – Configures the mount process to initiate before the volumes are mounted.

      • nofail – If the device does not exist, no errors are reported. This is a good option to use when an instance is used to create a custom image. Future instances created with that image will not include the block volume and might fail to boot without this option.

    • Dump:0 to not use the obsolete dump utility.

    • fsck:0 to not run fsck

  4. Use this command to mount the volumes that are in the /etc/fstab file:

    sudo mount -a
  5. Verify that the file system is mounted:

    mount | grep /mnt
    /dev/sdb on /mnt/volume1 type ext4 (rw,relatime,seclabel,stripe=2,data=ordered,_netdev)
    

Managing Block Volumes

You can manage these aspects of block volumes:

  • List the block volumes in a compartment.
  • List the details of a block volume.
  • List block volume attachments.
  • Edit the volume's configuration.
  • Move a volume to another compartment.
  • Clone a volume.
  • Detach a volume.
  • Delete a volume.

Listing Block Volumes and Block Volume Details

You can list all Block Volumes in a specific compartment, and detailed information about a single volume.

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Block Volumes.

  2. Select the appropriate compartment.

  3. To view block volume details, click the name of the block volume.

    The details are displayed.

    Detail Item Description
    Block volume icon

    Displays the status of the block volume.

    Block volume name

    The name of the block volume.

    Block Volume Information and Tags

    Tabs that you can click to display:

    • General Information

    • Tags that have been applied to this object.

    Created

    The day and time that the volume was created.

    Compartment

    The compartment that the volume belongs to.

    OCID

    The volume's Oracle Cloud ID.

    Backup Policy

    The backup policy assigned to the volume.

    Size

    The size of the volume.

    Volume is Hydrated

    Always no because this field does not apply to Oracle Private Cloud Appliance

    High Performance Enabled

    Indicates if the volume is configured as a high performance volume or not. If yes, the volume performance units (VPUs) per GB is displayed.

    Effective VPUs when Idle

    Displays the volume performance units (VPUs) per GB when the volume is idle.

Using the OCI CLI

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

    • Compartment OCID (oci iam compartment list)

  2. Run this command.

    Syntax (entered on a single line):

    oci bv volume list --compartment <compartment_OICD>

    Example:

    oci bv volume list    \
    --compartment ocid1.compartment.….….….uniqueID
    
    {
      "data": [
        {
          "auto-tuned-vpus-per-gb": null,
          "availability-domain": "MyAD",
          "compartment-id": "ocid1.compartment.….….….uniqueID",
          "defined-tags": {},
          "display-name": "volume2",
          "freeform-tags": {},
          "id": "ocid1.volume.….….….uniqueID-2",
          "is-auto-tune-enabled": null,
          "is-hydrated": null,
          "kms-key-id": null,
          "lifecycle-state": "AVAILABLE",
          "size-in-gbs": 52,
          "size-in-mbs": 53248,
          "source-details": null,
          "system-tags": null,
          "time-created": "2021-06-01T17:33:24+00:00",
          "volume-group-id": null,
          "vpus-per-gb": 0
        },
        {
          "auto-tuned-vpus-per-gb": null,
          "availability-domain": "MyAD",
          "compartment-id": "ocid1.compartment.….….….uniqueID",
          "defined-tags": {},
          "display-name": "volume20210106171509",
          "freeform-tags": {},
          "id": "ocid1.volume.….….….uniqueID-1",
          "is-auto-tune-enabled": null,
          "is-hydrated": null,
          "kms-key-id": null,
          "lifecycle-state": "AVAILABLE",
          "size-in-gbs": 50,
          "size-in-mbs": 51200,
          "source-details": null,
          "system-tags": null,
          "time-created": "2021-06-01T17:15:09+00:00",
          "volume-group-id":
        },
    }

Listing Block Volume Attachments

Using the Compute Web UI

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

  2. Select the compartment where the instance resides.

  3. Click the instance name to display the details.

  4. In the lower left corner, under Resources, select Attached Block Volumes.

    All block volumes that are attached to this instance are displayed.

  5. To see details for a block volume, click the block volume name.

Using the OCI CLI

  • Listing All Block Volumes in a Compartment

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

      • Compartment OCID (oci iam compartment list)

    2. Run this command.

      Syntax (entered on a single line):

      oci compute volume-attachment list 
      --compartment-id <compartment_OCID>

      Example:

      oci compute volume-attachment list   \
      --compartment-id oocid1.compartment.….….….uniqueID
      {
        "data": [
          {
            "attachment-type": "paravirtualized",
            "availability-domain": "MyAD",
            "compartment-id": "ocid1.compartment.….….….uniqueID",
            "device": null,
            "display-name": "volumeattachment20210106172413",
            "id": "ocid1.volumeattachment.….….….uniqueID-2",
            "instance-id": "ocid1.instance.….….….uniqueID",
            "is-pv-encryption-in-transit-enabled": null,
            "is-read-only": false,
            "is-shareable": false,
            "lifecycle-state": "ATTACHED",
            "time-created": "2021-06-01T17:24:13+00:00",
            "volume-id": "ocid1.volume.….….….uniqueID-2"
          },
          {
            "attachment-type": "paravirtualized",
            "availability-domain": "MyAD",
            "compartment-id": "ocid1.compartment.….….….uniqueID",
            "device": null,
            "display-name": "volumeattachment20210106175003",
            "id": "ocid1.volumeattachment.….….….uniqueID-1",
            "instance-id": "ocid1.instance.….….….uniqueID",
            "is-pv-encryption-in-transit-enabled": null,
            "is-read-only": false,
            "is-shareable": false,
            "lifecycle-state": "ATTACHED",
            "time-created": "2021-06-01T17:50:03+00:00",
            "volume-id": "ocid1.volume.….….….uniqueID-1"
          }
        ]
      }
  • Listing Block Volume Attachments for a Specific Instance

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

      • Volume OCID (oci bv volume list --compartment-id <compartment_OCID>)

    2. Run this command.

      Syntax (entered on a single line):

      oci compute volume-attachment list 
      --volume-id <volume_OCID>

      Example:

      oci compute volume-attachment list   \
      --instance-id ocid1.instance.….….….uniqueID
      {
         {
            "attachment-type": "paravirtualized",
            "availability-domain": "MyAD",
            "compartment-id": "ocid1.compartment.….….….uniqueID",
            "device": null,
            "display-name": "volumeattachment20210106175003",
            "id": "ocid1.volumeattachment.….….….uniqueID",
            "instance-id": "ocid1.instance.….….….uniqueID",
            "is-pv-encryption-in-transit-enabled": null,
            "is-read-only": false,
            "is-shareable": false,
            "lifecycle-state": "ATTACHED",
            "time-created": "2021-06-01T17:50:03+00:00",
            "volume-id": "ocid1.volume.….….….uniqueID"
          }
        ]
      }

Editing a Volume's Configuration

You can change settings for your block volumes and boot volumes while they are online, without any downtime.

You can change these volume settings:

  • Name: Is the volume display name. The name does not have to be unique.

  • Size (in GB): Is the capacity of the volume. You can only increase the capacity. Changing the size has repercussions. Before changing the size, see Resizing Volumes

  • High Performance: Enable or disable the higher performance option.

  • Backup Policy: Select a backup policy from the drop-down list.

  • Tagging: Add, remove, or change tags. For details about tagging, see Working with Resource Tags.

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Block Volumes.

  2. Select the compartment where the block volume resides.

  3. In the Actions menu (three dots), select Edit.

  4. In the dialog, change the setting.

  5. Click Save Changes.

Using theOCI CLI

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

    • Volume OCID (oci bv volume list --compartment-id <compartment_OCID>)

  2. Run the oci bv volume update command.

    Note:

    This procedure shows the minimum required parameters for this command. For information about optional parameters, run the command with the --help option.

    To change other volume parameters such as the volume size, you specify the parameters in a JSON format. For more information, refer to Using JSON for Complex Command Input.

    Changing a volume's display name

    Syntax (entered on a single line):

    oci bv volume update 
    --volume-id <volume_OCID> 
    --display-name <new-display-name>

    Example:

    oci bv volume update     \
    --volume-id ocid1.volume.….….….uniqueID   \
    --display-name volumeA

Moving a Volume to a Different Compartment

You can move Block Volume resources such as block volumes, boot volumes, clones, volume backups, volume groups, and volume group backups from one compartment to another.

When you move a volume resource to a new compartment, associated resources such as policies, are not moved. Inherent policies apply immediately and affect access to the resource.

Important:

When moving Block Volume resources between compartments, you need to ensure that the resource users have sufficient access permissions on the compartment the resource is being moved to.

  • You can't move a block volume or boot volume from a security zone to a standard compartment.

  • You can't move a volume from a standard compartment to a compartment that is in a security zone if the volume violates any security zone policies.

Using the OCI CLI

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

    • Volume OCID (oci bv volume list --compartment-id <compartment_OCID>)

    • Target Compartment OCID (oci iam compartment list)

  2. Run this command.

    Syntax (entered on a single line):

    oci bv volume change-compartment 
    --volume-id <volume_OCID> 
    --compartment-id <destination_compartment_OCID>

    Example:

    oci bv volume change-compartment  \
    --volume-id ocid1.volume.….….….uniqueID  \
    --compartment-id ocid1.compartment.….….….uniqueID \
    {
      "etag": "7e084c71-4729-4ddd-b131-d87bfc621e8c"
    }

Cloning a Volume

You can create a clone from a volume using the Block Volume service. Cloning enables you to make a copy of an existing block volume without needing to go through the backup and restore process.

A cloned volume is a point-in-time direct disk-to-disk deep copy of the source volume. All the data that is in the source volume is copied to the clone volume. Any subsequent changes to the data on the source volume are not copied to the clone.

The clone is the same size as the source volume unless you specify a larger volume size when you create the clone.

The volume data is being copied in the background, and can take up to thirty minutes depending on the size of the volume. You can attach and use the cloned volume as a regular volume when the state changes to available.

For more information about cloning volumes, refer to the Block Storage Backups and Clones section in the Block Volume Storage Overview chapter in the Oracle Private Cloud Appliance Concepts Guide.

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Block Volumes.

  2. Select the appropriate compartment.

  3. For the volume you plan to clone, click the Actions icon (three dots), and select Create Clone.

  4. In the dialog, enter this information:

    • Name: A name or description for the volume. Avoid entering confidential information.

    • Compartment: Select the compartment in which to clone the block volume.

    • Size (in GBs): You can keep the size the same, or increment the size up to 32 TB. You cannot decrease the size. The value is specified in 1 GB increments.

    • High-Performance Volume: Optionally, choose to create a volume using the high performance feature. If not enabled, the volume uses balanced performance.

      • High performance: The Higher Performance elastic performance option is recommended for workloads with the highest I/O requirements, requiring the best possible performance, such as large databases.

      • Balanced performance: Suitable for most applications including boot volumes.

      For more information, refer to "Block Volume Performance Options" in the Block Volume Storage Overview in the Oracle Private Cloud Appliance Concepts Guide.

    • Backup Policy: Optionally, you can enable the use of a backup policy for this volume by specifying the following items:

      • Compartment: Choose the compartment where the backup policy resides.

      • Backup Policy: Choose a backup policy from the list.

      For more information about backup policies, see Managing Backup Policies.

    • Tagging: Optionally, add one or more tags to this resource.

      If you are not sure whether to apply tags, skip this option (you can apply tags later).

      For more information about tagging resources, see Working with Resource Tags.

  5. Click Create Clone.

Using the OCI CLI

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

    • Availability Domain Name (oci iam availability-domain list)

    • Compartment OCID that contains the source volume (oci iam compartment list)

    • Volume OCID of the volume to clone (oci bv volume list --compartment-id <compartment_OCID>)

  2. Run this command.

    Syntax (entered on a single line):

    oci bv volume create
    --availability-domain <availability_domain_name>
    --compartment-id <compartment_OCID>
    --source-volume-id <source_volume_OCID>
    --display-name <display_name>

    Example:

    oci bv volume create  \
    --availability-domain ad1  \
    --compartment-id ocid1.compartment.….….….uniqueID   \
    --source-volume-id ocid1.volume.….….….uniqueID  \
    --display-name "MyVolumeClone"
    {
      "data": {
        "auto-tuned-vpus-per-gb": null,
        "availability-domain": "ad1",
        "compartment-id": "ocid1.compartment.….….….uniqueID",
        "defined-tags": {},
        "display-name": "MyVolumeClone",
        "freeform-tags": {},
        "id": "ocid1.volume.….….….uniqueID",
        "is-auto-tune-enabled": null,
        "is-hydrated": null,
        "kms-key-id": null,
        "lifecycle-state": "PROVISIONING",
        "size-in-gbs": 1024,
        "size-in-mbs": 51200,
        "source-details": {
          "id": "ocid1.volume.….….….uniqueID",
          "type": "volume"
        },
        "system-tags": null,
        "time-created": "2021-07-02T21:12:35+00:00",
        "volume-group-id": null,
        "vpus-per-gb": 0
      },
      "etag": "13864f86-cd1c-49f7-b414-4c4800103b0c",
      "opc-work-request-id": "ocid1.workrequest.….….….uniqueID"
    }

Detaching a Block Volume

When an instance no longer needs access to a volume, you can detach the volume from the instance without affecting the volume's data.

Caution:

If you later reattach the detached volume, it might be associated with a different device name and the instance operating system might not recognize the volume.

Using the Compute Web UI

  1. Perform administrative tasks to remove any dependencies that any instances have for the block volume.

    For example, ensure that no applications are accessing the volume. Unmount the volume and remove it from the /etc/fstab file, and so on.

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

  3. Select the compartment where the instance resides.

  4. In the Instances list, click the instance that has the volume attached.

  5. In the lower left corner, under Resources, select Attached Block Volumes.

  6. Click the Actions icon (three dots) next to the volume you want to detach, and then click Detach.

  7. Confirm when prompted.

Using the OCI CLI

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

    • Volume attachment OCID (oci compute volume-attachment list --compartment-id <compartment_OCID>)

  2. Run this command.

    Syntax (entered on a single line):

    oci compute volume-attachment detach
    --volume-attachment-id <volume-attachment_OCID>

    Example:

    oci compute volume-attachment detach    \
    --volume-attachment-id ocid1.volumeattachment.….….….uniqueID
    Are you sure you want to delete this resource? [y/N]: y

Deleting a Block Volume

You can delete a volume that is no longer needed.

Caution:

You cannot undo this operation. Any data on a volume is permanently deleted when the volume is deleted.

Caution:

All policy-based (scheduled) backups, and any manual backups that were created before the scheduled backup, eventually expire. If you want to keep a volume backup indefinitely, you need to cancel all future scheduled backups and create a manual backup before deleting the volume. See Backing Up Block Volumes.

When you delete a block volume, different things happen depending on these conditions:

  • The volume has no backups or clones: The volume is immediately deleted and the volume capacity is returned to the system for potential reuse. The volume entry is marked TERMINATED, and after a period of a day or so, the volume entry is no longer listed.
  • The volume has a backup or a clone: The volume entry is marked as TERMINATED, but the volume is not deleted and the capacity is not returned to the system. The volume stays in a TERMINATED state until all of its backups and clones are deleted, at which time, the volume is deleted and no longer listed.
  • The volume is part of a DR configuration and replicating: The volume is marked as TERMINATED, but the volume is not deleted and the capacity is not returned to the system until DR completes the replication.

Using the Compute Web UI

  1. Perform administrative tasks to remove any dependencies that any instances have for the block volume.

    For example, ensure that no applications are accessing the volume. Unmount the volume and remove it from the /etc/fstab file, and so on.

  2. In the navigation menu, under Block Storage, click Block Volumes.

  3. Select the compartment that contains the block volume that you plan to delete.

  4. Click the Action menu (three dots) for the volume you plan to delete, and select Terminate.

  5. Confirm the termination when prompted.

Using the OCI CLI

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

    • Volume OCID (oci bv volume list --compartment-id <compartment_OCID>)

  2. Run this command.

    Syntax (entered on a single line):

    oci bv volume delete 
     --volume-id <volume_OCID>

    Example using the minimum required parameters:

     oci bv volume delete --volume-id ocid1.volume.….….….uniqueID
    Are you sure you want to delete this resource? [y/N]: y
    {
      "etag": "bd576de7-3193-4171-9792-uniqueID"
    }

Managing Boot Volumes

When you launch an instance, a new boot volume for the instance is created in the same compartment. That boot volume is associated with that instance until you terminate the instance. When you terminate the instance, you can preserve and reuse the boot volume and its data.

Boot volumes are encrypted by default.

For more conceptual information, refer to the Block Volume Storage Overview chapter in the Oracle Private Cloud Appliance Concepts Guide.

This section provides instructions for managing Boot Volumes.

Listing Boot Volumes

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Boot Volumes.

  2. Select the appropriate compartment.

    A list of boot volumes is displayed.

  3. To view details about a boot volume, click the boot volume name.

Using the OCI CLI

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

    • Availability Domain Name (oci iam availability-domain list)

    • Compartment OCID (oci iam compartment list)

  2. Run this command.

    Syntax (entered on a single line):

    oci bv boot-volume list 
    --availability-domain <availability_domain_name>
    --compartment-id <compartment_OCID>

    Example:

    oci bv boot-volume list 
    --availability-domain MyAD
    --compartment-id ocid1.compartment.….….….uniqueID
    {
      "data": [
        {
          "auto-tuned-vpus-per-gb": null,
          "availability-domain": "MyAD",
          "compartment-id": "ocid1.compartment.….….….uniqueID",
          "defined-tags": {},
          "display-name": "instance20211705214217(Boot Volume)",
          "freeform-tags": {},
          "id": "ocid1.bootvolume.….….….uniqueID",
          "image-id": "ocid1.image.….….….uniqueID",
          "is-auto-tune-enabled": null,
          "is-hydrated": null,
          "kms-key-id": null,
          "lifecycle-state": "AVAILABLE",
          "size-in-gbs": 50,
          "size-in-mbs": 51200,
          "source-details": null,
          "system-tags": null,
          "time-created": "2021-05-17T21:42:17+00:00",
          "volume-group-id": null,
          "vpus-per-gb": 0
        }

Listing Boot Volume Attachments

Using the Compute Web UI

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

  2. Select the appropriate compartment.

  3. Click the name of the instance for which you want to view the boot volume attachment.

  4. Under Resources, click Attached Boot Volumes.

    The boot volume attachments are displayed.

  5. To view the details about an attachment, click the boot volume attachment name.

Using the OCI CLI

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

    • Availability Domain Name (oci iam availability-domain list)

    • Compartment OCID (oci iam compartment list)

  2. Run this command.

    Syntax (entered on a single line):

    oci compute boot-volume-attachment list
    --availability-domain <availability_domain_name>
    --compartment-id <compartment_OCID>

    Example:

     oci compute boot-volume-attachment list  \
    --availability-domain MyAD   \
    --compartment-id ocid1.compartment.….….….uniqueID
    {
      "data": [
         {
          "availability-domain": "MyAD",
          "boot-volume-id": "ocid1.bootvolume.….….….uniqueID",
          "compartment-id": "ocid1.compartment.….….….uniqueID",
          "display-name": "bootvolumeattachment20211705214514",
          "id": "ocid1.bootvolumeattachment.….….….uniqueID",
          "instance-id": "ocid1.instance.….….….uniqueID",
          "is-pv-encryption-in-transit-enabled": null,
          "lifecycle-state": "ATTACHED",
          "time-created": "2021-05-17T21:45:14+00:00"
        }

Detaching a Boot Volume

If you think a boot volume issue is causing a compute instance problem, you can stop the instance and detach the boot volume using the steps described in this topic. Then you can attach it to another instance as a data volume to troubleshoot it.

Note – The instance must be in a stopped state to detach a boot volume (described in this procedure). You must reattach a boot volume before you can start the instance.

Using the Compute Web UI

  1. Stop the instance:

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

    2. Select the appropriate compartment.

    3. Click the name of the instance.

    4. Click Controls, then select Stop.

      Wait for the status to change from Stopping to Stopped.

  2. Under Resources, click Boot Volumes.

  3. Click the Actions menu (three dots) for the boot volume, then select Detach.

  4. Confirm when prompted.

Using the OCI CLI

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

    • Boot volume attachment OCID (oci compute boot-volume-attachment list)

  2. Stop the instance.

    See Stopping, Starting, and Resetting an Instance.

  3. Detach the boot volume by running this command.

    Syntax (entered on a single line):

    oci compute boot-volume-attachment detach 
    --boot-volume-attachment-id <boot_volume-attachment_OCID>

    Example:

    oci compute boot-volume-attachment detach   \
    --boot-volume-attachment-id ocid1.bootvolumeattachment.….….….uniqueID
    Are you sure you want to delete this resource? [y/N]: y

Reattaching a Boot Volume

A boot volume is automatically attached to an instance when the instance is launched. However, there are circumstances when you might need to detach and reattach a boot volume as a data volume for troubleshooting purposes. This procedure describes how to reattach a boot volume as a boot volume.

If a boot volume has been detached from the instance for troubleshooting purposes, you can attach the boot volume to another instance as a data volume. See Attaching a Volume.

Using the Compute Web UI

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

  2. Select the compartment where the instance resides.

  3. Click the instance name.

  4. Under Resources, click Attached Boot Volumes.

  5. Click Attach Boot Volume.

  6. Confirm the deletion.

Using the OCI CLI

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

    • Boot volume OCID (see Listing Boot Volumes)

    • Instance OCID (oci compute instance list --compartment-id <compartment_OCID>)

  2. Run this command.

    Syntax (entered on a single line):

    oci compute boot-volume-attachment attach
    --boot-volume-id  <boot_volume_OCID>
    --instance-id <instance_OCID>

    Example:

    oci compute boot-volume-attachment attach  \
    --boot-volume-id ocid1.bootvolume.….….….uniqueID  \
    --instance-id ocid1.instance.….….….uniqueID
    {
      "data": {
        "availability-domain": "MyAD",
        "boot-volume-id": "ocid1.bootvolume.….….….uniqueID",
        "compartment-id": "ocid1.compartment.….….….uniqueID",
        "display-name": "bootvolumeattachment20212405205526",
        "id": "ocid1.bootvolumeattachment.….….….uniqueID",
        "instance-id": "ocid1.instance.….….….uniqueID",
        "is-pv-encryption-in-transit-enabled": null,
        "lifecycle-state": "ATTACHED",
        "time-created": "2021-05-24T20:55:26+00:00"
      }
    }

Deleting a Boot Volume

When you terminate an instance, you choose to delete or preserve the associated boot volume. You can also delete a boot volume if it has been detached from the associated instance. See Detaching a Boot Volume.

Caution:

You cannot undo this operation. Any data on a volume is permanently deleted when the volume is deleted. You won't be able to restart the associated instance.

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Boot Volumes.

  2. Select the appropriate compartment.

  3. In the Boot Volumes list, find the volume you want to delete.

  4. Click the Actions icon (three dots) for the boot volume and select Terminate.

  5. Confirm when prompted.

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 bv boot-volume delete
    --boot-volume-id <boot_volume_OCID>

    You can obtain the <boot_volume_OCID> by listing boot volumes. See Listing Boot Volumes.

    Example:

    oci bv boot-volume delete  \
    --boot-volume-id ocid1.bootvolume.….….….uniqueID
    Are you sure you want to delete this resource? [y/N]: y

Resizing Volumes

The Block Volume service lets you expand the size of block volumes and boot volumes. You have several options to increase the size of your volumes:

  • Expand an existing volume in place with online resizing.

  • Restore from a volume backup to a larger volume.

  • Clone an existing volume to a new, larger volume.

  • Expand an existing volume in place with offline resizing.

You cannot decrease the size of a volume.

For more conceptual information, refer to the Block Volume Storage Overview chapter in the Oracle Private Cloud Appliance Concepts Guide

Online Volume Resizing

With online resizing, you can expand the volume size without detaching the volume from an instance. Online resizing requires you to rescan the disk and extend the partition.

Online Block Volume Resizing

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Block Volumes.

  2. Select the appropriate compartment.

  3. For the volume you plan to resize, click the Actions icon (three dots), and select Edit.

  4. Change the size:

    • Size (in GBs): You can keep the size the same, or increment the size. You cannot decrease the size. The value must be between 50 GB and 32 TB and specified in 1 GB increments.

  5. Click Save Changes.

  6. Rescan the disk.

    For details, consult the OS documentation for the OS type and version running in the instance.

  7. Extend the partition.

    For details, consult the OS documentation for the OS type and version running in the instance.

Using the OCI CLI

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

    • Volume OCID (oci bv volume list --compartment-id <compartment_OCID>)

  2. Run this command.

    Syntax (entered on a single line):

    oci bv volume update 
    --volume-id <volume_OCID> 
    --size-in-gbs <size_in_GBS>

    <size_in_GBS> is the size of the block volume. You can increment the size. You cannot decrease the size. The value must be between 50 GB and 32 TB and specified in 1 GB increments.

    Example:

    oci bv volume update   \
    --volume-id ocid1.volume.….….….uniqueID   \
    --size-in-gbs 72{
      "data": {
        "auto-tuned-vpus-per-gb": null,
        "availability-domain": "ad1",
        "compartment-id": "ocid1.compartment.….….….uniqueID",
        "defined-tags": {},
        "display-name": "clone-w-policy",
        "freeform-tags": {},
        "id": "ocid1.volume.….….….uniqueID",
        "is-auto-tune-enabled": null,
        "is-hydrated": null,
        "kms-key-id": null,
        "lifecycle-state": "PROVISIONING",
        "size-in-gbs": 72,
        "size-in-mbs": 71424,
        "source-details": {
          "id": "ocid1.volume.….….….uniqueID",
          "type": "volume"
        },
        "system-tags": null,
        "time-created": "2021-07-02T20:48:20+00:00",
        "volume-group-id": null,
        "vpus-per-gb": 0
      },
      "etag": "58851b71-236d-4d99-8175-b27835d6b34f"
    }
  3. Rescan the disk.

    For details, consult the OS documentation for the OS type and version running in the instance.

  4. Extend the partition.

    For details, consult the OS documentation for the OS type and version running in the instance.

Online Boot Volume Resizing

Using theCompute Web UI

  1. Boot Volume: In the navigation menu, under Block Storage, click Boot Volumes.

  2. Select the appropriate compartment.

  3. For the volume you plan to resize, click the Actions icon (three dots), and select Edit.

  4. Change the size:

    • Size (in GBs): You can keep the size the same, or increment the size. You cannot decrease the size. The value must be between 50 GB and 32 TB and specified in 1 GB increments.

  5. Click Save Changes.

  6. Rescan the disk.

    For details, consult the OS documentation for the OS type and version running in the instance.

  7. Extend the partition.

    For details, consult the OS documentation for the OS type and version running in the instance.

Using the OCI CLI

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

    • Boot volume OCID (oci bv boot-volume list --availability-domain <availability_domain_name> --compartment-id <compartment_OCID>)

  2. Run this command.

    Syntax (entered on a single line):

    oci bv boot-volume update 
    --boot-volume-id <volume_OCID> 
    --size-in-gbs <size_in_GBS>

    <size_in_GBS> is the size of the boot volume. You can increment the size. You cannot decrease the size. The value must be between 50 GB and 32 TB and specified in 1 GB increments.

    Example:

    oci bv boot-volume update   \
    --boot-volume-id ocid1.bootvolume.….….….uniqueID   \
    --size-in-gbs 1024
    
    {
      "data": {
        "auto-tuned-vpus-per-gb": null,
        "availability-domain": "ad1",
        "compartment-id": "ocid1.tenancy.….….….uniqueID",
        "defined-tags": {},
        "display-name": "MyInstance(Boot Volume)",
        "freeform-tags": {},
        "id": "ocid1.bootvolume.….….….uniqueID",
        "image-id": "ocid1.image.….….….uniqueID",
        "is-auto-tune-enabled": null,
        "is-hydrated": null,
        "kms-key-id": null,
        "lifecycle-state": "PROVISIONING",
        "size-in-gbs": 1024,
        "source-details": null,
        "system-tags": null,
        "time-created": "2021-08-10T20:14:03.053300+00:00",
        "volume-group-id": null,
        "vpus-per-gb": 0
      },
      "etag": "bd0677e3-c542-45f3-bf04-c473b184c795"
    }
  3. Rescan the disk.

    For details, consult the OS documentation for the OS type and version running in the instance.

  4. Extend the partition.

    For details, consult the OS documentation for the OS type and version running in the instance.

Offline Volume Resizing

With offline resizing, you detach the volume from an instance before you expand the volume size. When the volume is resized and reattached, you need to extend the partition, but you do not need to rescan the disk.

Considerations When Resizing an Offline Volume

Whenever you detach and reattach volumes, there are complexities and risks for both UNIX based and Microsoft Windows instances. Keep the following points in mind when resizing volumes:

  • Before you resize a volume, create a full backup of the volume.

  • When you reattach a volume to an instance after resizing, if you are not using consistent device paths, or if the instance does not support consistent device paths, device order and path might change. If you are using a tool such as Logical Volume Manager (LVM), you might need to fix the device mappings.

Offline Block Volume Resizing

Using the Compute Web UI

  1. Detach the block volume.

    See Detaching a Block Volume.

  2. In the navigation menu, click Block Storage, then click Block Volumes.

  3. Select the appropriate compartment.

  4. For the volume you plan to resize, click the Actions icon (three dots), and select Edit.

  5. Change the size:

    • Size (in GBs): You can keep the size the same, or increment the size. You cannot decrease the size. The value must be between 50 GB and 32 TB and specified in 1 GB increments.

  6. Click Save Changes.

  7. Reattach the volume.

    See Attaching a Volume

  8. Extend the partition.

    For details, consult the OS documentation for the OS type and version running in the instance.

Using the OCI CLI

  1. Detach the block volume.

    See Detaching a Block Volume.

  2. Gather the information that you need to run the command:

    • Volume OCID (oci bv volume list --compartment-id <compartment_OCID>)

  3. Run this command.

    Syntax (entered on a single line):

    oci bv volume update 
    --volume-id <volume_OCID> 
    --size-in-gbs <size_in_GBS>

    <size_in_GBS> is the size of the block volume. You can increment the size. You cannot decrease the size. The value must be between 50 GB and 32 TB and specified in 1 GB increments.

    Example:

    oci bv volume update   \
    --volume-id ocid1.volume.….….….uniqueID   \
    --size-in-gbs 72{
      "data": {
        "auto-tuned-vpus-per-gb": null,
        "availability-domain": "ad1",
        "compartment-id": "ocid1.compartment.….….….uniqueID",
        "defined-tags": {},
        "display-name": "clone-w-policy",
        "freeform-tags": {},
        "id": "ocid1.volume.….….….uniqueID",
        "is-auto-tune-enabled": null,
        "is-hydrated": null,
        "kms-key-id": null,
        "lifecycle-state": "PROVISIONING",
        "size-in-gbs": 72,
        "size-in-mbs": 71424,
        "source-details": {
          "id": "ocid1.volume.….….….uniqueID",
          "type": "volume"
        },
        "system-tags": null,
        "time-created": "2021-07-02T20:48:20+00:00",
        "volume-group-id": null,
        "vpus-per-gb": 0
      },
      "etag": "58851b71-236d-4d99-8175-b27835d6b34f"
    }
  4. Reattach the volume.

    See Attaching a Volume.

  5. Extend the partition.

    For details, consult the OS documentation for the OS type and version running in the instance.

Offline Boot Volume Resizing

Using the Compute Web UI

  1. Stop the instance.

    See Stopping, Starting, and Resetting an Instance.

  2. Detach the boot volume.

    See Detaching a Boot Volume.

  3. In the navigation menu, under Block Storage, click Boot Volumes.

  4. Select the appropriate compartment.

  5. For the volume you plan to resize, click the Actions icon (three dots), and select Edit.

  6. Change the size:

    • Size (in GBs): You can keep the size the same, or increment the size. You cannot decrease the size. The value must be between 50 GB and 32 TB and specified in 1 GB increments.

  7. Click Save Changes.

  8. Attach the boot volume to a second instance as a data volume.

    See Attaching a Volume.

  9. Extend the partition and grow the file system.

    For details, consult the OS documentation for the OS type and version running in the instance.

  10. Detach the data volume.

    See Detaching a Block Volume.

  11. Reattach the boot volume.

    See Reattaching a Boot Volume.

  12. Restart the instance.

    See Stopping, Starting, and Resetting an Instance.

Using the OCI CLI

  1. Stop the instance.

    See Stopping, Starting, and Resetting an Instance.

  2. Detach the boot volume.

    See Detaching a Boot Volume.

  3. Gather the information that you need to run the command:

    • Boot volume OCID (oci bv boot-volume list --availability-domain <availability_domain_name> --compartment-id <compartment_OCID>)

  4. Run this command.

    Syntax (entered on a single line):

    oci bv boot-volume update 
    --boot-volume-id <volume_OCID> 
    --size-in-gbs <size_in_GBS>

    <size_in_GBS> is the size of the boot volume. You can increment the size. You cannot decrease the size. The value must be between 50 GB and 32 TB and specified in 1 GB increments.

    Example:

    oci bv boot-volume update   \
    --boot-volume-id ocid1.bootvolume.….….….uniqueID   \
    --size-in-gbs 1024
    
    {
      "data": {
        "auto-tuned-vpus-per-gb": null,
        "availability-domain": "ad1",
        "compartment-id": "ocid1.tenancy.….….….uniqueID",
        "defined-tags": {},
        "display-name": "MyInstance(Boot Volume)",
        "freeform-tags": {},
        "id": "ocid1.bootvolume.….….….uniqueID",
        "image-id": "ocid1.image.….….….uniqueID",
        "is-auto-tune-enabled": null,
        "is-hydrated": null,
        "kms-key-id": null,
        "lifecycle-state": "PROVISIONING",
        "size-in-gbs": 1024,
        "source-details": null,
        "system-tags": null,
        "time-created": "2021-08-10T20:14:03.053300+00:00",
        "volume-group-id": null,
        "vpus-per-gb": 0
      },
      "etag": "bd0677e3-c542-45f3-bf04-c473b184c795"
    }
  5. Attach the boot volume to a second instance as a data volume.

    See Attaching a Volume.

  6. Extend the partition and grow the file system.

    For details, consult the OS documentation for the OS type and version running in the instance.

  7. Detach the data volume.

    See Detaching a Block Volume.

  8. Reattach the boot volume.

    See Reattaching a Boot Volume.

  9. Restart the instance.

    See Stopping, Starting, and Resetting an Instance.

Managing Volume Groups

the Block Volume service provides you with the capability to group multiple volumes in a volume group. A volume group can include both block and boot volumes.

You can use volume groups to create volume group backups and clones that are point-in-time and crash-consistent. This simplifies the process to create time-consistent backups of running enterprise applications that span multiple storage volumes across multiple instances. You can then restore an entire group of volumes from a volume group backup.

Similarly, you can also clone an entire volume group in a time-consistent and crash-consistent manner. A deep disk-to-disk and fully isolated clone of a volume group, with all the volumes associated in it, becomes available for use within a matter of seconds. This speeds up the process of creating new environments for development, quality assurance, user acceptance testing, and troubleshooting.

When working with volume groups and volume group backups, keep the following in mind:

  • You can only add a volume to a volume group when the volume status is available.
  • You can add up to 32 volumes in a volume group, up to a maximum size limit of 128 TB. For example, if you wanted to add 32 volumes of equal size to a volume group, the maximum size for each volume would be 4 TB. Or you could add volumes that vary in size, however the overall combined size of all the block and boot volumes in the volume group must be 128 TB or less. Make sure you account for the size of any boot volumes in your volume group when considering volume group size limits.
  • Each volume may only be in one volume group.
  • When you clone a volume group, a new group with new volumes is created. For example, if you clone a volume group containing three volumes, once this operation is complete, you will now have two separate volume groups and six different volumes with nothing shared between the volume groups.
  • When you update a volume group using the CLI, SDKs, or REST APIs you need to specify all the volumes to include in the volume group each time you use the update operation. If you do not include a volume ID in the update call, that volume will be removed from the volume group.
  • When you delete a volume group the individual volumes in the group are not deleted.
  • When you delete a volume that is part of a volume group you must first remove it from the volume group before you can delete it.
  • When you delete a volume group backup, all the volume backups in the volume group backup are deleted.

Viewing the Volumes in a Volume Group

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Volume Groups.

  2. Select the appropriate compartment.

  3. In the Volume Groups list, click the volume group you want to view.

  4. To view the block volumes for the volume group, in Resources, click Volumes.

Using the OCI CLI

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

    • Compartment OCID (oci iam compartment list)

  2. Run this command.

    Syntax (entered on a single line):

    oci bv volume-group list 
    --compartment-id <compartment_OCID>

    Example:

    oci bv volume-group list   \
    --compartment-id ocid1.compartment.….….….uniqueID
    {
      "data": [
        {
          "availability-domain": "MyAD",
          "compartment-id": "ocid1.compartment.….….….uniqueID",
          "defined-tags": {},
          "display-name": "myVolumeGroup",
          "freeform-tags": {},
          "id": "ocid1.volumeGroup.….….….uniqueID",
          "is-hydrated": null,
          "lifecycle-state": "AVAILABLE",
          "size-in-gbs": 150,
          "size-in-mbs": 153600,
          "source-details": {
            "type": "volumeIds",
            "volume-ids": [
              "ocid1.volumeuniqueID-1",
              "ocid1.volume.….….….uniqueID-2",
              "ocid1.volume.….….….uniqueID-3"
            ]
          },
          "time-created": "2021-05-26T20:47:06+00:00",
          "volume-ids": [
              "ocid1.volume.….….….uniqueID-1",
              "ocid1.volume.….….….uniqueID-2",
              "ocid1.volume.….….….uniqueID-3"
          ]
        },
        {
          "availability-domain": "MyAD",
          "compartment-id": "ocid1.compartment.….….….uniqueID",
          "defined-tags": {},
          "display-name": "anotherVolumeGroup",
          "freeform-tags": {},
          "id": "ocid1.volumeGroup.….….….uniqueID",
          "is-hydrated": null,
          "lifecycle-state": "AVAILABLE",
          "size-in-gbs": 100,
          "size-in-mbs": 102400,
          "source-details": {
            "type": "volumeIds",
            "volume-ids": [
              "ocid1.volume.….….….uniqueID-4",
              "ocid1.volume.….….….uniqueID-5"
            ]
          },
          "time-created": "2021-05-25T19:08:55+00:00",
          "volume-ids": [
              "ocid1.volume.….….….uniqueID-4",
              "ocid1.volume.….….….uniqueID-5"
          ]
        }
      ]
    }

Creating a Volume Group from Existing Volumes

This procedure assumes that the volumes you plan to group are created. See Creating a Block Volume.

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Volume Groups.

  2. Select the compartment where you want the volume group created.

  3. Click Create Volume Group.

  4. Fill in the required volume information:

    • Name: A user-friendly name or description for the group.

    • Compartment: The compartment for the volume group.

    • Volumes: For each volume you want to add, select the compartment containing the volume, select the volume to add. Click + Add Volume to add additional volumes.

  5. Tagging: Optionally, add one or more tags to this resource.

    If you are not sure whether to apply tags, skip this option (you can apply tags later).

    For more information about tagging resources, see Working with Resource Tags.

  6. Click Create Volume Group.

Using the OCI CLI

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

    • Availability Domain Name (oci iam availability-domain list)

    • Compartment OCID (oci iam compartment list)

    • Source details – a JSON string or file that lists all volumes you want in the group.

      For details about the JSON format, run this command:

      oci bv volume-group create  \
      --generate-param-json-input source-details
  2. Run this command.

    Syntax (entered on a single line):

    oci bv volume-group create
    --availability-domain <availability_domain_name> 
    --compartment-id <compartment_OCID> 
    --source-details <json_string> or file://<path_to_JSON_file>

    Example:

    oci bv volume-group create   \
    --availability-domain MyAD   \
    --compartment-id ocid1.compartment.….….….unique_ID  \
    --source-details '{"type": "volumeIds", "volumeIds":["ocid1.volume.….….….uniqueID-1",   \
    "ocid1.volume.….….….uniqueID-2"]}'
    {
      "data": {
        "availability-domain": "MyAD",
        "compartment-id": "ocid1.compartment.….….….uniqueID",
        "defined-tags": {},
        "display-name": "volumegroup20212605212205",
        "freeform-tags": {},
        "id": "ocid1.volumeGroup.….….….uniqueID",
        "is-hydrated": null,
        "lifecycle-state": "PROVISIONING",
        "size-in-gbs": 100,
        "size-in-mbs": 102400,
        "source-details": {
          "type": "volumeIds",
          "volume-ids": [
            "ocid1.volume.….….….uniqueID-1",
            "ocid1.volume.….….….uniqueID-2"
          ]
        },
        "time-created": "2021-05-26T21:22:05+00:00",
        "volume-ids": []
      },
      "etag": "c7053513-6819-49ad-8785-dd3e2a45272a"
    }

Adding Volumes to a Group

Note:

You cannot add a volume with an existing backup policy assignment to a volume group with a backup policy assignment. You must first remove the backup policy assignment from the volume before you can add it to the volume group.

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Volume Groups.

  2. Select the compartment that contains the volume group.

  3. In the Volume Groups list, click the volume group you want to add the volume to.

  4. Click Add Block Volumes.

  5. For each block volume you want to add, select the compartment containing the volume and then select the volume to add. Click + Add Volume to add additional volumes.

  6. After you have selected all the block volumes to add to the volume group, click Update Volume Group.

Using the OCI CLI

Caution:

Updates to volume-ids replace any existing values. This means that you need to specify the volume IDs for all volumes in the volume group each time you update the volume group.

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

    • Volume group OCID (oci bv volume-group list --compartment-id <compartment_OCID>)

    • Volume OCIDs – a JSON string or file that lists the all volumes (existing and new) that you want in the group.

      For details about the JSON format, run this command:

      oci bv volume-group update --generate-param-json-input volume-ids
  2. Run this command.

    Syntax (entered on a single line):

    oci bv volume-group update 
    --volume-group-id <volume_group_OCID> 
    --volume-ids <volume_OCIDs_JSON>

    Example:

    In this example, the first two volume IDs are already in the volume group, and the third volume ID is added to the group.

    oci bv volume-group update   \
    --volume-group-id ocid1.volumeGroup.….….….uniqueID    \
    --volume-ids '["ocid1.volume.….….….uniqueID-1","ocid1.volume.….….….uniqueID-2","ocid1.volume.….….….uniqueID-3"]'

Removing Volumes from a Group

When you remove the last volume in a volume group, the volume group is deleted.

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Volume Groups.

  2. Select the appropriate compartment.

  3. In the Volume Groups list, click the volume group that contains the volume you plan to remove.

  4. In Actions menu (three dots) for the block volume you want to remove, click Remove.

  5. Confirm the removal.

Using the OCI CLI

Caution:

Updates to volume-ids replace any existing values. This means that you need to specify the volume IDs for all volumes in the volume group each time you update the volume group.

You remove a volume from a volume group using the oci bv volume-group update command with valid JSON formatting. For details about the syntax and how to specify the volume OCIDs in a valid JSON file, refer to volume group update in the OCI CLI Command Reference .

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

    • Volume group OCID (oci bv volume-group list --compartment-id <compartment_OCID>)

    • Volume OCIDs – a JSON string or file that lists the volumes that you want to keep in the group.

      For details about the JSON format, run this command:

      oci bv volume-group update --generate-param-json-input volume-ids
  2. Run this command.

    Syntax (entered on a single line):

    oci bv volume-group update 
    --volume-group-id <volume_group_OCID> 
    --volume-ids <volume_OCIDs_JSON>

    Example:

    In this example, the first two volume IDs remain in the volume group. Omitting a volume ID removes it from the group.

    oci bv volume-group update   \
    --volume-group-id ocid1.volumeGroup.….….….uniqueID    \
    --volume-ids '["ocid1.volume.….….….uniqueID-1","ocid1.volume.….….….uniqueID-2"]'

Creating a Clone of a Volume Group

You can create a clone from a volume group. Cloning enables you to make a copy of an existing volume group without needing to go through the backup and restore process.

A cloned volume group is a point-in-time direct disk-to-disk deep copy of the source volume group, so all the data that is in the source volume group is copied to the clone volume group.

Any subsequent changes to the data on the source volume group are not copied to the clone.

For additional details about clones and how they differ from backups, refer to the Block Storage Backups and Clones section in the Block Volume Storage Overview chapter in the Oracle Private Cloud Appliance Concepts Guide.

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Volume Groups.

  2. Select the appropriate compartment.

  3. Click the name of the Volume Group you plan to clone.

  4. Under Resources, click Volume Group Clones.

  5. Click Create Volume Group Clone.

  6. Enter the required information:

    • Volume Group Clone Name: Enter a descriptive name for the clone.

    • Create in Compartment: Select the compartment where the clone will be created.

  7. Click Create Volume Group Clone.

Deleting a Volume Group

When you delete a volume group the individual volumes in the group are not deleted, only the volume group is deleted.

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Volume Groups.

  2. Select the appropriate compartment.

  3. In the Volume Groups list, click the volume group you want to delete.

  4. On the Volume Group Details page, click Terminate.

  5. Confirm the termination.

Using the OCI CLI

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

    • Volume group OCID (oci bv volume-group list --compartment-id <compartment_OCID>)

  2. Run this command.

    Syntax (entered on a single line):

    oci bv volume-group delete 
    --volume-group-id <volume_group_OCID>

    Example:

    oci bv volume-group delete   \
    --volume-group-id ocid1.volumegroup.….….….unique_ID

Backing Up Block Volumes

The backups feature for the Block Volume service lets you make a point-in-time snapshot of the data on a block volume. You can make a backup of a volume when the volume is attached to an instance or while it is detached. These backups can then be restored to new volumes any time.

There are two ways to initiate a backup:

  • Manual Backups: Are on-demand one-off backups that you can launch immediately. The backup is a full backup. See Backing Up Block Volumes.

  • Policy-Based Backups: Are automated scheduled backups as defined by the backup policy assigned to the volume. See Managing Backup Policies.

For more information about Block Volume backups, such as the differences between backups and clones, refer to "Block Storage Backups and Clones" in the Block Volume Storage Overview in the Oracle Private Cloud Appliance Concepts Guide.

Viewing Volume Backups

Use these steps to view volume backups and volume group backups.

Using the Compute Web UI

  1. Perform one of these actions based on the type of backup you want to view:

    • Block Volume Backups: In the navigation menu, under Block Storage, click Block Volume Backups.

    • Volume Group Backups: In the navigation menu, under Block Storage, click Volume Group Backups.

    The backups are listed.

  2. If you don't see your backup listed, ensure you are viewing the correct compartment which is displayed at the top of the page.

  3. To view the details of a backup, click the backup name.

Using the OCI CLI

  • Viewing a Block Volume Backup

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

      • Compartment OCID (oci iam compartment list)

    2. Run this command.

      Syntax (entered on a single line):

      oci bv backup list
      --compartment-id <Compartment_OCID>

      Example:

      oci bv backup list --compartment-id ocid1.….….….uniqueID
      {
        "data": [
          {
            "compartment-id": "ocid1.compartment.….….….uniqueID",
            "defined-tags": {},
            "display-name": "Vol2-manual-backup",
            "expiration-time": null,
            "freeform-tags": {},
            "id": "ocid1.volumebackup.….….….uniqueID",
            "kms-key-id": null,
            "lifecycle-state": "AVAILABLE",
            "size-in-gbs": 0,
            "size-in-mbs": null,
            "source-type": "MANUAL",
            "source-volume-backup-id": null,
            "system-tags": null,
            "time-created": "2021-06-29T19:02:16.000001+00:00",
            "time-request-received": "2021-06-29T19:02:04.000001+00:00",
            "type": "FULL",
            "unique-size-in-gbs": 0,
            "unique-size-in-mbs": null,
            "volume-id": "ocid1.volume.….….….uniqueID"
          }
        ]
      }
  • Viewing a Volume Group Backup

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

      • Compartment OCID (oci iam compartment list)

    2. Run this command.

      Syntax (entered on a single line):

      oci bv volume-group-backup list
      --compartment-id <Compartment_OCID>

      Example:

      oci bv volume-group-backup list  \
      --compartment-id ocid1.compartment.….….….uniqueID
      {
        "data": [
          {
            "compartment-id": "ocid1.compartment.….….….uniqueID",
            "defined-tags": null,
            "display-name": "MyVolGrpBackup",
            "freeform-tags": null,
            "id": "ocid1.volumegroupbackup.….….….uniqueID",
            "lifecycle-state": "AVAILABLE",
            "size-in-gbs": 0,
            "size-in-mbs": 0,
            "time-created": "2021-06-29T21:37:29+00:00",
            "time-request-received": "2021-06-29T21:37:18+00:00",
            "type": "FULL",
            "unique-size-in-gbs": null,
            "unique-size-in-mbs": 0,
            "volume-backup-ids": [
              "ocid1.volumebackup.….….….uniqueID-1",
              "ocid1.volumebackup.….….….uniqueID-2"
            ],
            "volume-group-id": "ocid1.volumegroup.….….….uniqueID"
          }
        ]
      }

Creating a Manual Boot or Block Volume Backup

This procedure describes how to back up both types of volumes:

  • Block Volumes

  • Boot Volumes

Using the Compute Web UI

  1. Locate the volume you plan to back up:

    • Block Volume: In the navigation menu, under Block Storage, click Block Volumes.

    • Boot Volume: In the navigation menu, under Compute, click Boot Volumes.

  2. If you don't see your volume listed, ensure you are viewing the correct compartment which is displayed at the top of the page.

  3. For the volume you plan to back up, click the Action Menu (three dots), then click Create Manual Backup.

  4. In the dialog, enter this information:

    • Name: Enter a descriptive name for the backup.

    • Tagging: Optionally, add one or more tags to this resource.

      If you are not sure whether to apply tags, skip this option (you can apply tags later).

      For more information about tagging resources, see Working with Resource Tags.

  5. Click Create Manual Backup or Submit.

Using the OCI CLI

  • Creating a Block Volume Backup

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

      • Volume OCID (oci bv volume list --compartment-id <compartment_OCID>)

    2. Run this command.

      Syntax (entered on a single line):

      oci bv backup create 
      --volume-id <block_volume_OCID> 
      --display-name <Backup_Name> 
      --type FULL

      Example:

      oci bv backup create   \
      --volume-id ocid1.volume.….….….uniqueID.xyz   \
      --display-name "ABC-Full-Backup"   \
      --type FULL
      {
        "data": {
          "compartment-id": "ocid1.compartment.….….….uniqueID",
          "defined-tags": {},
          "display-name": "ABC-Full-Backup",
          "expiration-time": null,
          "freeform-tags": {},
          "id": "ocid1.volumeBackup.oc1.….….….uniqueID.abc",
          "kms-key-id": null,
          "lifecycle-state": "CREATING",
          "size-in-gbs": null,
          "size-in-mbs": null,
          "source-type": "MANUAL",
          "source-volume-backup-id": null,
          "system-tags": null,
          "time-created": "2021-05-19T21:50:11+00:00",
          "time-request-received": "2021-05-19T21:50:11+00:00",
          "type": "FULL",
          "unique-size-in-gbs": null,
          "unique-size-in-mbs": null,
          "volume-id": "ocid1.volume.….….….uniqueID.xyz"
        },
        "etag": "616112e8-728c-43d6-b0d1-c6cfcc1a46e6"
      }
  • Creating a Boot Volume Backup

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

      • Volume OCID (oci bv volume list --compartment-id <compartment_OCID>)

    2. Run this command.

      Syntax (entered on a single line):

      oci bv boot-volume-backup create 
      --volume-id <block_volume_OCID> 
      --display-name <Backup_Name> 
      --type FULL

      Example:

      oci bv backup create   \
      --volume-id ocid1.bootvolume.….….….uniqueID.123   \
      --display-name "mybootvolume-20210424"   \
      --type FULL
      
      {
        "data": {
          "boot-volume-id": "ocid1.bootvolume.oc1.….….….uniqueID.123",
          "compartment-id": "ocid1.compartment.….….….uniqueID",
          "defined-tags": {},
          "display-name": "mybootvolume-20210424",
          "expiration-time": null,
          "freeform-tags": {},
          "id": "ocid1.bootvolumeBackup.oc1.….….….uniqueID.456",
          "image-id": "ocid1.image.oc1.….….….uniqueID",
          "kms-key-id": null,
          "lifecycle-state": "CREATING",
          "size-in-gbs": null,
          "source-boot-volume-backup-id": null,
          "source-type": "MANUAL",
          "system-tags": null,
          "time-created": "2021-04-24T21:40:13+00:00",
          "time-request-received": "2021-04-24T21:40:13+00:00",
          "type": "FULL",
          "unique-size-in-gbs": null
        },
        "etag": "123a12b3-daa8-4557-8c83-uniqueID"
      }

Creating a Manual Backup of a Volume Group

Using the Compute Web UI

  1. In the navigation menu, click Block Storage, then click Volume Groups.

  2. Select the appropriate compartment.

  3. Click the name of the Volume Group you plan to back up.

  4. Under Resources, click Volume Group Backups.

  5. Click Create Volume Group Backup.

  6. In the dialog, enter this information:

    • Name: Enter a descriptive name for the backup.

  7. Click Create Volume Group Backup.

Using the OCI CLI

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

    • Volume group OCID (oci bv volume-group list --compartment-id <compartment_OCID>)

    • Compartment OCID (oci iam compartment list)

  2. Run this command.

    Syntax (entered on a single line):

    oci bv volume-group-backup create
    --volume-group-id <volume_group_OCID>
    --compartment-id <compartment_OCID>
    --display-name <display_name>
    --type FULL

    Example:

    oci bv volume-group-backup create   \
    --compartment-id ocid1.compartment.….….….uniqueID    \
    --volume-group-id ocid1.volumeGroup.….….….uniqueID   \
    --display-name vol-grp-backup-2205   \
    --type FULL
    {
      "data": {
        "compartment-id": "cid1.compartment.….….….uniqueID",
        "defined-tags": {},
        "display-name": "vol-grp-backup-2205",
        "freeform-tags": {},
        "id": "ocid1.volumeGroupBackup.….….….uniqueID",
        "lifecycle-state": "CREATING",
        "size-in-gbs": null,
        "size-in-mbs": null,
        "time-created": "2021-05-26T21:44:36+00:00",
        "time-request-received": "2021-05-26T21:44:36+00:00",
        "type": "FULL",
        "unique-size-in-gbs": null,
        "unique-size-in-mbs": null,
        "volume-backup-ids": [],
        "volume-group-id": "ocid1.volumeGroup.….….….uniqueID"
      },
      "etag": "04761386-6ec5-4cfa-b88e-a085ad833eac"
    }

Restoring a Backup to a New Volume

Using the Compute Web UI

  1. In the navigation menu, click Block Storage, then click Block Volume Backups.

  2. If you don't see your backup listed, ensure you are viewing the correct compartment which is displayed at the top of the page.

  3. Click the Actions icon (three dots) for the block volume backup you want to restore, and click Create Block Volume.

  4. Fill in the required volume information:

    • Name: A name or description for the volume. Avoid entering confidential information.

    • Compartment: Select the compartment in which to create the block volume.

    • Size (in GBs): Must be between 50 GB and 32 TB. You can specify a value in 1 GB increments.

    • High Performance Volume: Optionally, choose to create a volume using the high performance feature. If not enabled, the volume uses balanced performance.

      • High performance: The Higher Performance elastic performance option is recommended for workloads with the highest I/O requirements, requiring the best possible performance, such as large databases.

      • Balanced performance: Suitable for most applications including boot volumes.

      For more information, refer to "Block Volume Performance Options" in the Block Volume Storage Overview in the Oracle Private Cloud Appliance Concepts Guide.

    • Backup Policy: Optionally, you can enable the use of a backup policy for this volume by specifying the following items:

      • Compartment: Choose the compartment where the backup resides.

      • Backup Policy: Choose a backup policy from the list.

      For more information about backup policies, see Managing Backup Policies.

    • Tagging: Optionally, add one or more tags to this resource.

      If you are not sure whether to apply tags, skip this option (you can apply tags later).

      For more information about tagging resources, see Working with Resource Tags.

  5. Click Create Block Volume.

    The volume is ready to attach after its icon no longer lists it as PROVISIONING in the volume list.

Using the OCI CLI

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

    • Availability Domain Name (oci iam availability-domain list)

    • Source volume backup OCID – the OCID of the volume backup from which the data will be restored on the newly created volume.

  2. Run this command.

    Syntax (entered on a single line):

    oci bv volume create
    --availability-domain <availability_domain_name>
    --volume-backuup-id <source_volume_backup_OCID>

    Example:

    oci bv volume create  \
    --availability-domain ad1  \
    --volume-backup-id ocid1.….….….uniqueID{
      "data": {
        "auto-tuned-vpus-per-gb": null,
        "availability-domain": "ad1",
        "compartment-id": "ocid1.compartment.….….….uniqueID",
        "defined-tags": {},
        "display-name": "volume20212906194712",
        "freeform-tags": {},
        "id": "ocid1.volume.….….….uniqueID",
        "is-auto-tune-enabled": null,
        "is-hydrated": null,
        "kms-key-id": null,
        "lifecycle-state": "PROVISIONING",
        "size-in-gbs": 50,
        "size-in-mbs": 51200,
        "source-details": {
          "id": "ocid1.volumebackup.….….….uniqueID",
          "type": "volumeBackup"
        },
        "system-tags": null,
        "time-created": "2021-06-29T19:47:12+00:00",
        "volume-group-id": null,
        "vpus-per-gb": 0
      },
      "etag": "13864f86-cd1c-49f7-b414-4c4800103b0c",
      "opc-work-request-id": "ocid1.workrequest.….….….f4s6nne9dbi4e"
    }

Restoring a Volume Group from a Volume Group Backup

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Volume Group Backups.

  2. Select the appropriate compartment.

  3. Click the Actions icon (three dots) for the block volume backup you want to restore, and click Create Volume Group.

  4. Fill in the required volume information:

    • Name: Enter a descriptive name for the group.

    • Compartment: Select the compartment for the volume group.

    • Tagging: Optionally, add one or more tags to this resource.

      If you are not sure whether to apply tags, skip this option (you can apply tags later).

      For more information about tagging resources, see Working with Resource Tags.

  5. Click Create Volume Group.

Using the OCI CLI

You restore a volume group backup using the oci bv volume-group create command with valid JSON formatting. For details about the syntax and how to specify the volume OCIDs in a valid JSON file, refer to volume group create in the OCI CLI Command Reference .

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

    • Availability Domain Name (oci iam availability-domain list)

    • Compartment OCID (oci iam compartment list)

    • Source details – a JSON string or file that lists the volume group backup that is used to create the restored volume group.

      For details about the JSON format, run this command:

      oci bv volume-group create --generate-param-json-input source-details
  2. Run this command.

    Syntax (entered on a single line):

    oci bv volume-group create
    --availability-domain <availability_domain_name>
    --compartment-id  <compartment_OCID>
    --source-details <json_string> or file://<path_to_JSON_file>

    Example:

    oci bv volume-group create 
    --availability-domain MyAD 
    --compartment-id ocid1.compartment.….….….uniqueID 
    --display-name VolumeGroupBackup-Monday 
    --source-details '{"type": "volumeGroupBackupId-1", "volumeGroupBackupId-2":["ocid1.volumeGroupBackupId-3"]}'
    
    {
      "data": {
        "availability-domain": "MyAD",
        "compartment-id": "ocid1.compartment.….….….uniqueID",
        "defined-tags": {},
        "display-name": "VolumeGroupBackup-Monday",
        "freeform-tags": {},
        "id": "ocid1.volumeGroup.….….….new-uniqueID",
        "is-hydrated": null,
        "lifecycle-state": "PROVISIONING",
        "size-in-gbs": 0,
        "size-in-mbs": 0,
        "source-details": {
          "type": "volumeGroupBackupId",
          "volume-group-backup-id": [
            "ocid1.volumeGroupBackup..….….….uniqueID"
          ]
        },
        "time-created": "2021-05-26T22:44:07+00:00",
        "volume-ids": []
      },
      "etag": "c7053513-6819-49ad-8785-dd3e2a45272a"
    }

Managing Backup Policies

Block Volume service provides you with the capability to perform volume backups and volume group backups automatically using a schedule, and retains them based on the retention setting in the backup policy.

Caution:

All policy-based (scheduled) backups, and any manual backups that were created before the scheduled backup, eventually expire. If you want to keep a volume backup indefinitely, you need to cancel all future scheduled backups and create a manual backup. See Backing Up Block Volumes.

For more conceptual information, refer to Block Storage Backups and Clones in the Block Volume Storage Overview chapter in the Oracle Private Cloud Appliance Concepts Guide.

Creating a Backup Policy

Using the Compute Web UI

Creating a backup policy using the UI is a two task process. First create the backup policy, then create a backup policy schedule, as described in this procedure.

Note:

You cannot add a policy to a block volume or block volume group if the schedule portion of the policy is not configured.
  1. In the navigation menu, under Block Storage, click Backup Policies.

  2. Click Create Backup Policy.

  3. Enter the required information:

    • Name: Enter a descriptive name for the policy.

    • Create in Compartment: Select the compartment for the policy.

    • Tagging: Optionally, add one or more tags to this resource.

      If you are not sure whether to apply tags, skip this option (you can apply tags later).

      For more information about tagging resources, see Working with Resource Tags.

  4. Click Create Backup Policy

    The policy is empty until you add a schedule to the policy.

  5. On the policy details page, click Add Schedule.

  6. In the dialog box, enter the schedule parameters:

    • Schedule Type options: Specify the backup frequency by selecting Daily, Weekly, Monthly, or Yearly.

    • Configure the additional schedule options.

      Depending on the schedule type, the additional schedule options include one or more of the following choices:

      • Hour of the day

      • Day of the week

      • Day of the month

      • Month of the year

    • Retention Time: Depending on the schedule type, specify the days, weeks, months, or years.

    • Time Zone: Select the time zone to base the schedule settings on, either UTC or Regional Data Center Time.

  7. Click Add Schedule.

    The policy can now be applied to one or more volumes and volume groups. See Assigning a Backup Policy to a Volume or Volume Group

Using the OCI CLI

Creating a backup policy using the CLI creates the policy and the schedule using one command, as described in this procedure.

Note:

You cannot add a policy to a block volume or block volume group if the schedule portion of the policy is not configured.
  1. Gather the information that you need to run the command:

    • Compartment OCID (oci iam compartment list)

    • Schedule items – A valid JSON string on the command line, or a valid JSON file with all required schedule items plus any optional schedule items of your choice.

      For details about the schedule items and the proper JSON format, run this command:

       oci bv volume-backup-policy create --generate-param-json-input schedules

      For more details about required and optional schedule items, refer to the VolumeBackupSchedule Reference in the Oracle Cloud Infrastructure documentation.

  2. Run this command.

    Syntax (entered on a single line):

    oci bv volume-backup-policy create
    --compartment-id <compartment_OCID>
    --display-name <discriptive_name>
    --schedule <json_string> or file://<path_to_JSON_file>

    Example using a JSON string:

    oci bv volume-backup-policy create  \
    --compartment-id ocid1.compartment.….….….uniqueID  \
    --display-name daily-full-backup  \
    --schedules '{"backupType":"FULL","period":"ONE_DAY","hourOfDay": 23,"retentionSeconds":172800,"timeZone":"UTC"}'
    {
      "data": {
        "compartment-id": "ocid1.compartment.….….….uniqueID",
        "defined-tags": {},
        "destination-region": null,
        "display-name": "daily-full-backup",
        "freeform-tags": {},
        "id": "ocid1.volumebackuppolicy.….….….uniqueID",
        "schedules": [
          {
            "backup-type": "FULL",
            "day-of-month": null,
            "day-of-week": null,
            "hour-of-day": 23,
            "month": null,
            "offset-seconds": null,
            "offset-type": null,
            "period": "ONE_DAY",
            "retention-seconds": 172800,
            "time-zone": "UTC"
          }
        ],
        "time-created": "2021-10-04T23:22:08.688884+00:00"
      },
      "etag": "0e1d293e-42fe-4fa9-88f7-a0ab30cc8256",
      "opc-work-request-id": "ocid1.workrequest.….….….uniqueID"
    }
  3. Assign the policy to a volume.

    See Assigning a Backup Policy to a Volume or Volume Group.

Assigning a Backup Policy to a Volume or Volume Group

You can assign a backup policy to a volume at these stages:

  • During volume creation. See Creating a Block Volume.

  • After the volume is created, you can add a backup policy to a volume or volume group by following the steps in this section.

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Block Volumes or Volume Groups.

  2. Select the appropriate compartment.

  3. Click the volume or volume group name.

  4. Click Edit.

  5. Select a backup policy from the menu.

  6. Click Save Changes.

Using the OCI CLI

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

    • Asset ID – the target volume OCID (oci bv volume list --compartment <compartment_OICD>)

    • Policy ID – the policy OCID (oci bv volume-backup-policy list --compartment-id <compartment_OCID>)

  2. Run this command.

    Syntax (entered on a single line):

    oci bv volume-backup-policy-assignment create
    --asset-id <volume_OCID>
    --policy-id <backup-policyABC>

    Example:

    oci bv volume-backup-policy-assignment create  \
    --asset-id ocid1.volume.….….….uniqueID123  \
    --policy-id ocid1.volumeBackupPolicy..….….….uniqueID456
    {
      "data": {
        "asset-id": "ocid1.volume.….….….uniqueID123",
        "id": "ocid1.backupPolicyAssignment.….….….new-uniqueID",
        "policy-id": "ocid1.volumeBackupPolicy.….….….uniqueID456",
        "time-created": "2021-05-26T23:31:53+00:00"
      },
      "etag": "57ddd89d-14bc-4ecf-b164-8a6cc9dc9014"
    }

Accessing the Backups

After a manual or automatic backup takes place, follow these steps to locate the backups.

Note:

For scheduled or policy-based backups, there might be a delay of up to 5 minutes for backups to show up in the list. This delay applies to viewing backups in the UI and in the CLI.

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click one of the following items:

    • Block Volume Backups

    • Volume Group Backups

    The manual and automatic backups are displayed.

  2. To see the details of a backup, click the backup name.

Using the OCI CLI

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

    • Compartment OCID (oci iam compartment list)

  2. Run this command.

    Syntax (entered on a single line):

    oci bv backup list 
    --compartment-id <compartment_OCID>

    Example:

    oci bv backup list --compartment-id ocid1.compartment.….….….uniqueID
    {
      "data": [
        {
          "compartment-id": "ocid1.compartment.….….….uniqueID",
          "defined-tags": {},
          "display-name": "volumebackup20212909223152",
          "expiration-time": null,
          "freeform-tags": {},
          "id": "ocid1.volumebackup.….….….uniqueID",
          "kms-key-id": null,
          "lifecycle-state": "AVAILABLE",
          "size-in-gbs": 0,
          "size-in-mbs": null,
          "source-type": "MANUAL",
          "source-volume-backup-id": null,
          "system-tags": null,
          "time-created": "2021-09-29T22:31:55.000001+00:00",
          "time-request-received": "2021-09-29T22:31:52.000001+00:00",
          "type": "FULL",
          "unique-size-in-gbs": 0,
          "unique-size-in-mbs": null,
          "volume-id": "ocid1.volume.….….….uniqueID"
        }
      ]
    }

Viewing Backup Policies

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Backup Policies.

  2. Select the appropriate compartment.

  3. To see details about a policy, click the policy name.

Using the OCI CLI

  • Listing All the Backup Policies in a Compartment

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

      • Compartment OCID (oci iam compartment list)

    2. Run this command.

      Syntax (entered on a single line):

      oci bv volume-backup-policy list --compartment-id <compartment_OCID>

      Example:

      oci bv volume-backup-policy list   \
      --compartment-id ocid1.compartment.oc1.….….….unique_ID
      {
        "data": [
          {
            "compartment-id": "ocid1.compartment.oc1.….….….unique_ID",
            "defined-tags": {},
            "destination-region": null,
            "display-name": "backup-policyABC",
            "freeform-tags": {},
            "id": "ocid1.volumeBackupPolicy.….….….uniqueID-1",
            "schedules": null,
            "time-created": "2021-05-17T22:40:17+00:00"
          }
         {
            "compartment-id": "ocid1.compartment.oc1.….….….unique_ID",
            "defined-tags": {},
            "destination-region": null,
            "display-name": "backup-policy1",
            "freeform-tags": {},
            "id": "ocid1.volumeBackupPolicy.….….….uniqueID-2",
            "schedules": null,
            "time-created": "2021-05-17T22:10:45+00:00"
          }
      }
  • Listing a Specific Backup Policy

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

      • Backup Policy OCID (oci bv volume-backup-policy list --compartment-id <compartment_OCID>)

    2. Run this command.

      Syntax (entered on a single line):

      oci bv volume-backup-policy get --policy-id  <backup_policy_OCID>

      Example:

      oci bv volume-backup-policy get   \
      --policy-id ocid1.volumeBackupPolicy.….….….uniqueID-1
      {
        "data": [
          {
            "compartment-id": "ocid1.compartment.oc1.….….….unique_ID",
            "defined-tags": {},
            "destination-region": null,
            "display-name": "backup-policyABC",
            "freeform-tags": {},
            "id": "ocid1.volumeBackupPolicy.….….….uniqueID-1",
            "schedules": null,
            "time-created": "2021-05-17T22:40:17+00:00"
          }

Editing a Backup Policy Schedule

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Backup Policies.

  2. Select the appropriate compartment.

  3. Click the backup policy name that has the schedule you want to edit.

  4. In Schedules, find the schedule you want to edit, click the Actions icon (three dots), and then click Edit.

  5. After making your changes to the schedule, click Update Schedule.

Using the OCI CLI

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

    • Backup policy OCID (oci bv volume-backup-policy list --compartment-id <compartment_OCID>)

    • Schedule items – A valid JSON string on the command line, or a valid JSON file with all required schedule items plus any optional schedule items of your choice.

      For details about the JSON items and format, run this command:

       oci bv volume-backup-policy create --generate-param-json-input schedules

      For extra details about required and optional schedule items, refer to the VolumeBackupSchedule Reference in the Oracle Cloud Infrastructure Documentation.

  2. Run this command.

    Caution:

    Running this command replaces all schedule items with the items you specify in the --schedule JSON.

    Syntax (entered on a single line):

    oci bv volume-backup-policy update 
    --policy-id <backup_policy_OCID> 
    --schedule <json_string> or file://<path_to_JSON_file>

    Example:

    oci bv volume-backup-policy update  \ 
    --policy-id ocid1.volumebackuppolicy.….….….uniqueID   \
    --schedules '{"backupType":"FULL","period":"ONE_DAY","hourOfDay": 3,"retentionSeconds":172800,"timeZone":"UTC"}'
    
    WARNING: Updates to schedules and defined-tags and freeform-tags will replace any existing values. 
    Are you sure you want to continue? [y/N]: y
    {
      "data": {
        "compartment-id": "ocid1.compartment.….….….uniqueID",
        "defined-tags": {},
        "destination-region": null,
        "display-name": "policy-daily-full",
        "freeform-tags": {},
        "id": "ocid1.volumebackuppolicy.….….….uniqueID",
        "schedules": [
          {
            "backup-type": "FULL",
            "day-of-month": null,
            "day-of-week": null,
            "hour-of-day": 3,
            "month": null,
            "offset-seconds": null,
            "offset-type": null,
            "period": "ONE_DAY",
            "retention-seconds": 172800,
            "time-zone": "UTC"
          }
        ],
        "time-created": "2021-10-05T21:01:45.153443+00:00"
      },
      "etag": "fb61d20c-92b2-465e-a545-68f6a5463b8e"
    }

Deleting a Backup Policy Schedule

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Backup Policies.

  2. Select the appropriate compartment.

  3. Click the backup policy that has the schedule you want to delete.

  4. In Schedules, for the schedule you want to delete, click the Actions icon (three dots), and then click Delete.

  5. Confirm the deletion.

Deleting a Backup Policy

Using the Compute Web UI

  1. In the navigation menu, under Block Storage, click Backup Policies.

  2. Select the appropriate compartment.

  3. Click the name of the policy you want to delete.

  4. Click Delete.

  5. Confirm the deletion.

Using the OCI CLI

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

    • Backup Policy OCID (oci bv volume-backup-policy list --compartment-id <compartment_OCID>)

  2. Run the command.

    Syntax (entered on a single line):

    oci bv volume-backup-policy delete --policy-id <policy_OCID>

    Example:

    oci bv volume-backup-policy delete 
    --policy-id ocid1.volumeBackupPolicy.….….….uniqueID
    Are you sure you want to delete this resource? [y/N]: y
    {
      "etag": "63a6b74f-e86e-423c-9948-123456789012"
    }