turbot/oci_insights

Query: blockstorage_block_volume_unattached_report

Usage

powerpipe query oci_insights.query.blockstorage_block_volume_unattached_report

SQL

select
v.display_name as "Name",
a.lifecycle_state as "Attachment Status",
i.display_name as "Instance Name",
t.title as "Tenancy",
coalesce(c.title, 'root') as "Compartment",
v.region as "Region",
v.id as "OCID"
from
oci_core_volume as v
left join oci_core_volume_attachment as a on a.volume_id = v.id
left join oci_core_instance as i on a.instance_id = i.id
left join oci_identity_compartment as c on v.compartment_id = c.id
left join oci_identity_tenancy as t on v.tenant_id = t.id
where
v.lifecycle_state <> 'TERMINATED'
order by
v.display_name;

Dashboards

The query is used in the dashboards: