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. Get the OCID of the compartment where you want the list of boot volumes (oci iam compartment list)

  2. Run the list boot volumes command.

    $ oci bv boot-volume list --availability-domain AD-1 \
    --compartment-id ocid1.compartment.unique_ID
    {
      "data": [
        {
          "auto-tuned-vpus-per-gb": null,
          "autotune-policies": null,
          "availability-domain": "AD-1",
          "boot-volume-replicas": null,
          "compartment-id": "ocid1.compartment.unique_ID",
          "defined-tags": {},
          "display-name": "instance20231705214217(Boot Volume)",
          "freeform-tags": {},
          "id": "ocid1.bootvolume.unique_ID",
          "image-id": "ocid1.image.unique_ID",
          "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": "2023-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. Get the OCID of the compartment where you want the list of boot volume attachments (oci iam compartment list)

  2. Run the list boot volume attachments command.

    $ oci compute boot-volume-attachment list --availability-domain AD-1 \
    --compartment-id ocid1.compartment.unique_ID
    {
      "data": [
         {
          "availability-domain": "AD-1",
          "boot-volume-id": "ocid1.bootvolume.unique_ID",
          "compartment-id": "ocid1.compartment.unique_ID",
          "display-name": "bootvolumeattachment20211705214514",
          "encryption-in-transit-type": null,
          "id": "ocid1.bootvolumeattachment.unique_ID",
          "instance-id": "ocid1.instance.unique_ID",
          "is-pv-encryption-in-transit-enabled": null,
          "lifecycle-state": "ATTACHED",
          "time-created": "2023-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 the boot volume to another instance as a data volume to troubleshoot it.

Note– The instance must be in the Stopped state to detach a boot volume (described in this procedure). You must reattach a boot volume before you can start the instance. To stop and start the instance, see Stopping, Starting, and Resetting an Instance.

When you stop the instance, any application that is running on the instance will be immediately stopped, possibly resulting in data corruption. To avoid stopping the instance while applications are running, manually shut down the instance by using the commands available in the instance OS. After the instance is shut down from the OS, then stop the instance from the appliance.

Using the Compute Web UI

  1. Stop the instance:

    1. Shut down the instance from the instance OS.

    2. On the appliance, in the navigation menu, click Compute and click Instances.

    3. Select the appropriate compartment.

    4. Click the name of the instance.

    5. On the instance details page, click Controls, then select Stop.

      Wait for the status to change from Stopping to Stopped. Stopping an instance can take up to five minutes.

  2. Scroll to the Resources section and click Boot Volumes.

  3. Click the boot volume Actions menu and then select Detach.

  4. Confirm when prompted.

Using the OCI CLI

  1. Gather the following information:

    • Instance OCID (oci compute instance list)

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

  2. Stop the instance.

    1. Shut down the instance from the instance OS.

    2. Run the instance stop command.

      $ oci compute instance action --instance-id ocid1.instance.unique_ID --action STOP

      Wait for the status to change from STOPPING to STOPPED.

      $ oci compute instance get --instance-id ocid1.instance.unique_ID

      Stopping an instance can take up to five minutes.

  3. Run the detach boot volume command.

    $ oci compute boot-volume-attachment detach \
    --boot-volume-attachment-id ocid1.bootvolumeattachment.unique_ID
    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.

Sometimes you need to detach and reattach a boot volume as a data volume for troubleshooting purposes. To detach a boot volume, see Detaching a Boot Volume. To attach the boot volume to another instance as a data volume, see Attaching a Volume.

This procedure describes how to reattach a boot volume as a boot 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. On the instance details page, scroll to the Resources section and click Boot Volumes.

  5. Click the boot volume Actions menu and then click Attach.

    Confirm when prompted.

    Wait for the state of the boot volume to be Attached. Then you can restart the instance as described in Stopping, Starting, and Resetting an Instance.

Using the OCI CLI

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

    • Boot volume OCID (oci bv boot-volume list)

    • Instance OCID (oci compute instance list)

  2. Run the attach boot volume command.

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

    When the lifecycle state is ATTACHED, you can restart the instance as described in Stopping, Starting, and Resetting an Instance.

Cloning a Boot Volume

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

For more information about cloned boot volumes, refer to "Cloning a Boot Volume" in the Compute Instance Concepts chapter in the Oracle Private Cloud Appliance Concepts Guide.

Using the Compute Web UI

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

  2. Select the appropriate compartment.

  3. For the volume you want to clone, click the Actions menu and then click Create Clone.

  4. In the dialog, enter the following information:

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

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

    • High-Performance Volume: (Optional) By default, the clone has the same performance setting as the source volume. Use this button to change the performance setting for this clone. For more information, see "Block Volume Performance Options" in the Block Volume Storage Overview chapter in the Oracle Private Cloud Appliance Concepts Guide.

    • 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.

  5. Click the Create Clone button in the dialog.

    The new boot volume is ready to use when it reaches the Available state. For example, you could click the Actions menu and then click Create Instance to use this new boot volume to create a new instance.

Using the OCI CLI

To clone a boot volume, create a new boot volume, specifying the volume that you want to clone as the source volume.

  1. Get the volume OCID of the boot volume to clone (oci bv boot-volume list)

  2. Run the boot volume create command, specifying the boot volume to clone.

    Syntax:

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

    Example:

    To create the clone in a compartment different from the compartment of the source, specify the compartment.

    $ oci bv boot-volume create --availability-domain AD-1 \
    --source-boot-volume-id ocid1.bootvolume.unique_ID
    {
      "data": {
        "auto-tuned-vpus-per-gb": null,
        "autotune-policies": null,
        "availability-domain": "AD-1",
        "boot-volume-replicas": null,
        "compartment-id": "ocid1.compartment.unique_ID",
        "defined-tags": {},
        "display-name": "instance20231306014509(Boot Volume)",
        "freeform-tags": {},
        "id": "ocid1.bootvolume.unique_ID",
        "image-id": "ocid1.image.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": {
          "id": "ocid1.bootvolume.unique_ID",
          "type": "bootVolume"
        },
        "system-tags": null,
        "time-created": "2023-06-13T01:45:09.053390+00:00",
        "volume-group-id": null,
        "vpus-per-gb": 0
      },
      "etag": "ffe90d4d-355d-4293-b562-35a4a09c0a9a",
      "opc-work-request-id": "ocid1.workrequest.unique_ID"
    }

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 will not 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. For the boot volume that you want to delete, click the Actions menu and then click Terminate.

    Confirm when prompted.

Using the OCI CLI

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

  2. Run the delete boot volume command.

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