Listing Volume Attachments

Learn how to view a list all Block Volume volume attachments in a specific compartment, as well as detailed information on a single volume attachment.

Required IAM Policy

To use Oracle Cloud Infrastructure, an administrator must be a member of a group granted security access in a policy  by a tenancy administrator. This access is required whether you're using the Console or the REST API with an SDK, CLI, or other tool. If you get a message that you don't have permission or are unauthorized, verify with the tenancy administrator what type of access you have and which compartment  your access works in.

For administrators: The policy in Let users launch compute instances includes the ability to list volume attachments. The policy in Let volume admins manage block volumes, backups, and volume groups lets the specified group do everything with block volumes and backups, but not launch instances.

If you're new to policies, see Managing Identity Domains and Common Policies. For reference material about writing policies for instances, cloud networks, or other Core Services API resources, see Details for the Core Services.
  • To view the volumes attached to an instance from the Instance details page

    To view the volumes attached to an instance from the Instance details page

    1. Open the navigation menu  and select Compute. Under Compute, select Instances.
    2. In the Instances list, select the instance that you want to view the attached volumes for.

    3. In the Resources section, select Attached Block Volumes.

    All the block volumes attached to the instance will be displayed in the list, regardless of the compartment the block volumes are in.

    To view the instances attached to a volume from the Volume details page

    To view the instances attached to a volume from the Volume details page

    1. Open the navigation menu  and select Storage. Under Block Storage, select Block Volumes.
    2. In the Block Volumes list, select the block volume that you want to view the attached instances for.

    3. In the Resources section, select Attached Instances.

    All the attached instances in the selected compartment will be displayed in the list. To view attached instances in other compartments, change the compartment in the COMPARTMENT drop down list.

  • Use the oci compute volume-attachment list command and specify the --compartment-id or --instance-id parameters to view the volume attachments in that compartment or instance:

    oci compute volume-attachment list --compartment-id compartment_id [OPTIONS]
    oci compute volume-attachment list --instance-id instance_id [OPTIONS]
    Note

    This operation only returns the attached instances that are in the specified compartment. You must run this operation for every compartment that might contain instances that are attached to the specified volume.

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

  • Run the ListVolumeAttachments operation and specify the compartmentId attribute to view a list of a volume attachments in a compartment. To filter the list, additionally specify the instanceId and/or volumeId parameter(s).

    Note

    The ListVolumeAttachments operation will only return the attached instances that are in compartment you specify. You need to run this operation for every compartment that may contain instances that are attached to the specified volume.