Control: Block and Boot volumes not attached any instances should be reviewed
Volumes that are unattached may no longer be needed.
Run the control in your terminal:
steampipe check oci_thrifty.control.boot_and_block_volume_unattached
Snapshot and share results via Steampipe Cloud:
steampipe loginsteampipe check --share oci_thrifty.control.boot_and_block_volume_unattached
Plugins & Tables
with vols_with_instances as (selectv.volume_id as volume_idfromoci_core_volume_attachment as vunionselectb.boot_volume_id as volume_idfromoci_core_boot_volume_attachment as b),-- Listing all volumes of type boot and block volumesall_volumes as (selectid,compartment_id,_ctx,tenant_id,region,display_name,size_in_gbsfromoci_core_volumeunionselectid,compartment_id,_ctx,tenant_id,region,display_name,size_in_gbsfromoci_core_boot_volume) -- Listing the volumes based on attachmentselecta.id as resource,casewhen v.volume_id is null then 'alarm'else 'ok'end as status,casewhen v.volume_id is null then a.display_name || ' of size ' || a.size_in_gbs || 'gb not attached.'else a.display_name || ' of size ' || a.size_in_gbs || 'gb attached to instance.'end as reason,coalesce(c.name, 'root') as compartment,a.regionfromall_volumes as aleft join vols_with_instances as v on v.volume_id = a.idleft join oci_identity_compartment as c on c.id = a.compartment_id;