Table: oci_core_volume_attachment - Query OCI Core Volume Attachments using SQL
A Volume Attachment in Oracle Cloud Infrastructure (OCI) represents the relationship between a volume and an instance. It is a component of OCI Core Services that provides block storage capacity for instances. The volume can be attached in read/write or read-only access mode.
Table Usage Guide
The oci_core_volume_attachment
table provides insights into volume attachments within OCI Core Services. As a cloud engineer, you can explore details of volume attachments through this table, including the volume and instance they are attached to, the attachment type, and the state of the attachment. Utilize it to manage and monitor the block storage capacity of your instances, and to ensure optimal configuration and usage of your volumes.
Examples
Basic info
Explore which volume attachments in your Oracle Cloud Infrastructure are active or inactive by checking their lifecycle states and when they were created. This can help you manage your resources more effectively by identifying unused or outdated attachments.
select id, display_name, lifecycle_state, time_createdfrom oci_core_volume_attachment;
select id, display_name, lifecycle_state, time_createdfrom oci_core_volume_attachment;
List idle volume attachments
Determine the areas in which volume attachments are not actively being used. This can help manage resources more effectively by identifying unused elements.
select id, display_name, lifecycle_state, time_createdfrom oci_core_volume_attachmentwhere lifecycle_state <> 'ATTACHED';
select id, display_name, lifecycle_state, time_createdfrom oci_core_volume_attachmentwhere lifecycle_state <> 'ATTACHED';
List read only volume attachments
Explore which volume attachments are set to read-only status. This can be useful to ensure data integrity by preventing unauthorized modifications.
select id, display_name, lifecycle_state, time_createdfrom oci_core_volume_attachmentwhere is_read_only;
select id, display_name, lifecycle_state, time_createdfrom oci_core_volume_attachmentwhere is_read_only = 1;
Query examples
Schema for oci_core_volume_attachment
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
availability_domain | text | = | The availability domain of an instance. |
compartment_id | text | = | The OCID of the compartment in Tenant in which the resource is located. |
device | text | The device name. | |
display_name | text | A user-friendly name. Does not have to be unique, and it cannot be changed. | |
id | text | = | The OCID of the volume attachment. |
instance_id | text | = | The OCID of the instance the volume is attached to. |
is_multipath | boolean | Whether the attachment is multipath or not. | |
is_pv_encryption_in_transit_enabled | boolean | Whether in-transit encryption for the data volume's paravirtualized attachment is enabled or not. | |
is_read_only | boolean | Whether the attachment was created in read-only mode. | |
is_shareable | boolean | Whether the attachment should be created in shareable mode. | |
iscsi_login_state | text | The iscsi login state of the volume attachment. | |
lifecycle_state | text | The current state of the volume attachment. | |
region | text | The OCI region in which the resource is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
tenant_id | text | =, !=, ~~, ~~*, !~~, !~~* | The OCID of the Tenant in which the resource is located. |
tenant_name | text | The name of the Tenant in which the resource is located. | |
time_created | timestamp with time zone | The date and time the volume was created. | |
title | text | Title of the resource. | |
volume_id | text | = | The OCID of the volume. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- oci
You can pass the configuration to the command with the --config
argument:
steampipe_export_oci --config '<your_config>' oci_core_volume_attachment