Managing Volume Groups

the Block Volume service enables you to organize multiple volumes into 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.
  • A volume group can include up to 32 volumes, up to a maximum size 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. You could add volumes that vary in size, however the overall combined size of all the block and boot volumes in the volume group cannot be more than 128 TB. Make sure you account for the size of any boot volumes in your volume group when considering volume group size limits.
  • A volume can 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, specify all the volumes to include in the volume group. The list of volumes to include replaces the existing list. If you do not include a volume OCID in the updated list, 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 the volume from the volume group and then delete the volume.
  • 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. Get the OCID of the compartment where you want to list volume groups: (oci iam compartment list)

  2. Run the volume group list command.

    Example:

    oci bv volume-group list --compartment-id ocid1.compartment.uniqueID
    {
      "data": [
        {
          "availability-domain": "AD-1",
          "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.volume.uniqueID-1",
              "ocid1.volume.uniqueID-2",
              "ocid1.volume.uniqueID-3"
            ]
          },
          "time-created": "2023-05-26T20:47:06+00:00",
          "volume-ids": [
              "ocid1.volume.uniqueID-1",
              "ocid1.volume.uniqueID-2",
              "ocid1.volume.uniqueID-3"
          ]
        },
        {
          "availability-domain": "AD-1",
          "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

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. In the dialog, provide the following information:

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

    • Compartment: The compartment for the volume group.

    • Volumes: Select a volume to add to the group from the volume drop-down list. You might need to select a different compartment above the volume drop-down list. Click + Add Volume to add another volume.

    • Backup Policy: (Optional) Select a backup policy from the drop-down list. You might need to change the compartment.

  5. Tagging:(Optional) Add defined or free-form tags for this instance as described in Adding Tags at Resource Creation. Tags can also be applied later.

  6. Click Create Volume Group.

Using the OCI CLI

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

    • Compartment OCID (oci iam compartment list)

    • The OCID of each volume that you want to add to the volume group (oci bv volume list)

  2. Construct an argument for the --source-details option.

    The --source-details option provides a list of the volumes to include in the group. The following example file named group_volumes.json shows the format of the list. Specify this content as the argument for the --source-details option, either as a string or as a file:// argument.

    {
      "type": "volumeIds",
      "volumeIds": [
        "ocid1.volume.unique_ID_1",
        "ocid1.volume.unique_ID_2",
        "ocid1.bootvolume.unique_ID_3"
      ]
    }
  3. Run the volume group create command.

    Syntax:

    oci bv volume-group create --availability-domain AD-1 \
    --compartment-id compartment_OCID 
    --source-details JSON_list_of_volumes_to_include

    Example:

    oci bv volume-group create --availability-domain AD-1 \
    --compartment-id ocid1.compartment.unique_ID \
    --source-details file:///group_volumes.json
    {
      "data": {
        "availability-domain": "AD-1",
        "compartment-id": "ocid1.compartment.unique_ID",
        "defined-tags": {},
        "display-name": "volumegroup20232605212205",
        "freeform-tags": {},
        "id": "ocid1.volumeGroup.unique_ID",
        "is-hydrated": null,
        "lifecycle-state": "PROVISIONING",
        "size-in-gbs": 100,
        "size-in-mbs": 102400,
        "source-details": {
          "type": "volumeIds",
          "volume-ids": [
            "ocid1.volume.unique_ID_1",
            "ocid1.volume.unique_ID_2",
            "ocid1.bootvolume.unique_ID_3"
          ]
        },
        "time-created": "2023-05-26T21:22:05+00:00",
        "volume-group-replicas": null,
        "volume-ids": [
          "ocid1.volume.unique_ID_1",
          "ocid1.volume.unique_ID_2",
          "ocid1.bootvolume.unique_ID_3"
        ]
      },
      "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. On the details page for the volume group, scroll to the Resources section, click Volumes, and click the Add Volumes button.

  5. Select a volume to add to the group from the volume drop-down list. You might need to select a different compartment above the volume drop-down list. Click + Add Volume to add another volume.

  6. Click Update Volume Group.

Using the OCI CLI

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

    • Volume group OCID (oci bv volume-group list)

    • OCID of each volume that you want to add to the volume group (oci bv volume list)

      For details about the JSON format, run this command:

      oci bv volume-group update --generate-param-json-input volume-ids
  2. Construct an argument for the --volume-ids option.

    The --volume-ids option provides a list of the volumes to add to the group.

    The --volume-ids argument must contain the full list of volumes to be included in the group. If a volume that is currently in the group is omitted from the --volume-ids argument, that volume will be removed from the group.

    The following example file named group_volumes-2.json shows the format of the list. Specify this content either as a string or as a file:// argument.

    [
      "ocid1.volume.unique_ID_1",
      "ocid1.volume.unique_ID_2",
      "ocid1.bootvolume.unique_ID_3",
      "ocid1.volume.unique_ID_4"
    ]
  3. Run the volume group update command.

    Syntax:

    oci bv volume-group update --volume-group-id volume_group_OCID \
    --volume-ids full_list_of_volumes_to_include

    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.unique_ID \
    --volume-ids file:///group_volumes-2.json
    {
      "data": {
        "availability-domain": "AD-1",
        "compartment-id": "ocid1.compartment.unique_ID",
        "defined-tags": {},
        "display-name": "volumegroup20232605212205",
        "freeform-tags": {},
        "id": "ocid1.volumeGroup.unique_ID",
        "is-hydrated": null,
        "lifecycle-state": "PROVISIONING",
        "size-in-gbs": 100,
        "size-in-mbs": 102400,
        "source-details": {
          "type": "volumeIds",
          "volume-ids": [
            "ocid1.volume.unique_ID_1",
            "ocid1.volume.unique_ID_2",
            "ocid1.bootvolume.unique_ID_3",
            "ocid1.volume.unique_ID_4"
          ]
        },
        "time-created": "2023-05-26T21:22:05+00:00",
        "volume-group-replicas": null,
        "volume-ids": [
          "ocid1.volume.unique_ID_1",
          "ocid1.volume.unique_ID_2",
          "ocid1.bootvolume.unique_ID_3",
          "ocid1.volume.unique_ID_4"
        ]
      },
      "etag": "eeb63423-1afa-43f1-9e3a-8d8e8d803ebc"
    }

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. On the details page for the volume group, scroll to the Resources section and click Volumes. For the volume that you want to remove, click the Actions menu, and then click Remove.

  5. Confirm the removal.

Using the OCI CLI

To remove a volume from a volume group, use the oci bv volume-group update command, and remove the volume from the list of volumes in the argument for the --volume-ids option as described in Adding Volumes to a Group.

Cloning a Volume Group

Cloning a volume group enables you to make a copy of a volume group without performing the backup and restore operations.

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 "Volume 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. On the details page for the volume group, scroll to the Resources section and click Volume Group Clones.

  5. Click the Create Volume Group Clone button.

  6. In the dialog, enter the following 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 the Create Volume Group Clone button in the dialog.

Using the OCI CLI

To clone a volume group, create a new volume group, specifying the same set of member volumes as the volume group that you want to clone.

In the following example, group_volumes.json is the same list of volumes as are in the volume group that you are cloning.

$ oci bv volume-group create --availability-domain AD-1 \
--compartment-id ocid1.compartment.unique_ID \
--source-details file:///group_volumes.json

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 details page for the volume group, click Terminate.

  5. Confirm the termination.

Using the OCI CLI

  1. Get the OCID of the volume group (oci bv volume-group list)

  2. Run the volume group delete command.

    Example:

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