steampipe plugin install oci

Table: oci_core_volume - Query OCI Core Volumes using SQL

OCI Core Volumes are block storage devices that you can attach to instances in the same availability domain. They are durable, high performance storage volumes that can persist beyond the life of a single Oracle Cloud Infrastructure Compute instance. Core Volumes are designed for mission-critical applications that require granular, consistent, and reliable data access.

Table Usage Guide

The oci_core_volume table provides insights into Core Volumes within Oracle Cloud Infrastructure (OCI). As a database administrator, explore volume-specific details through this table, including size, state, and associated metadata. Utilize it to uncover information about volumes, such as those with high performance, the availability of volumes, and the verification of volume backups.

Examples

Basic info

Explore which volumes in your Oracle Cloud Infrastructure are currently active, when they were created, and their display names for easy identification and management.

select
id as volume_id,
display_name,
lifecycle_state,
time_created
from
oci_core_volume;
select
id as volume_id,
display_name,
lifecycle_state,
time_created
from
oci_core_volume;

List volumes with a faulty state

Explore which storage volumes are in a faulty state. This is useful for identifying potential issues in your storage infrastructure that may require troubleshooting or maintenance.

select
id as volume_id,
display_name,
lifecycle_state,
time_created
from
oci_core_volume
where
lifecycle_state = 'FAULTY';
select
id as volume_id,
display_name,
lifecycle_state,
time_created
from
oci_core_volume
where
lifecycle_state = 'FAULTY';

List volumes with size greater than 1024 GB

Identify instances where storage volumes exceed 1024 GB to effectively manage resources and ensure optimal utilization.

select
id as volume_id,
display_name,
lifecycle_state,
size_in_gbs
from
oci_core_volume
where
size_in_gbs > 1024;
select
id as volume_id,
display_name,
lifecycle_state,
size_in_gbs
from
oci_core_volume
where
size_in_gbs > 1024;

List volumes with Oracle managed encryption (volumes are encrypted by default with Oracled managed encryption keys)

Determine the volumes that are encrypted using Oracle's default management keys. This can be useful to identify volumes that may not have been individually configured with custom encryption settings, potentially highlighting areas for enhanced security measures.

select
id as volume_id,
display_name,
lifecycle_state,
time_created
from
oci_core_volume
where
kms_key_id is null;
select
id as volume_id,
display_name,
lifecycle_state,
time_created
from
oci_core_volume
where
kms_key_id is null;

List volumes with customer managed encryption

Identify instances where customer-managed encryption is used for volumes. This can help assess security measures and compliance with data protection standards.

select
id as volume_id,
display_name,
lifecycle_state,
time_created
from
oci_core_volume
where
kms_key_id is not null;
select
id as volume_id,
display_name,
lifecycle_state,
time_created
from
oci_core_volume
where
kms_key_id is not null;

List volumes created in the root compartment

Discover the segments that are utilizing storage space within the root compartment. This can help in efficient management of resources and planning for future storage needs.

select
id as volume_id,
display_name,
lifecycle_state,
tenant_id,
compartment_id
from
oci_core_volume
where
compartment_id = tenant_id;
select
id as volume_id,
display_name,
lifecycle_state,
tenant_id,
compartment_id
from
oci_core_volume
where
compartment_id = tenant_id;

Query examples

Schema for oci_core_volume

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
auto_tuned_vpus_per_gbbigintThe number of Volume Performance Units per GB that this volume is effectively tuned to when it's idle.
availability_domaintext=The availability domain of the volume.
compartment_idtext=ColumnDescriptionCompartment
defined_tagsjsonbDefined tags for resource. Defined tags are set up in your tenancy by an administrator. Only users granted permission to work with the defined tags can apply them to resources.
display_nametext=A user-friendly name.
freeform_tagsjsonbFree-form tags for resource. This tags can be applied by any user with permissions on the resource.
idtext=The OCID of the volume.
is_auto_tune_enabledbooleanSpecifies whether the auto-tune performance is enabled for this volume.
is_hydratedbooleanSpecifies whether the cloned volume's data has finished copying from the source volume or backup.
kms_key_idtextThe OCID of the Key Management key which is the master encryption key for the volume.
lifecycle_statetext=The current state of a volume.
regiontextThe OCI region in which the resource is located.
size_in_gbsbigintThe size of the volume in GBs.
size_in_mbsbigintThe size of the volume in MBs.
source_detailsjsonbThe volume source, either an existing volume in the same availability domain or a volume backup.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
system_tagsjsonbSystem tags to volume by the service.
tagsjsonbA map of tags for the resource.
tenant_idtext=, !=, ~~, ~~*, !~~, !~~*The OCID of the Tenant in which the resource is located.
tenant_nametextThe name of the Tenant in which the resource is located.
time_createdtimestamp with time zoneThe date and time the volume was created.
titletextTitle of the resource.
volume_backup_policy_assignment_idtextThe OCID of the volume backup policy assignment.
volume_backup_policy_idtextThe OCID of the volume backup policy that has been assigned to the volume.
volume_group_idtext=The OCID of the source volume group.
vpus_per_gbbigintThe number of volume performance units (VPUs) that will be applied to this volume per GB,representing the Block Volume service's elastic performance options.

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