A volume that reports INUSE names what holds it in claimRef: the id of a volume attachment. Follow that attachment to find the instance, for example before you detach the volume to delete it.
Before you begin
Find the instance
-
Read the volume’s
claimRef.terminal origin storage get-volume --volume-urn <volume-urn> -
List the attachments that reference the volume.
terminal origin compute list-volume-attachments \ --project-urn <project-urn> --volume-urn <volume-urn>With the API, use the
volumeAttachmentsquery:GraphQL query { compute { volumeAttachments(input: { projectUrn: "<project-urn>" volumeUrn: "<volume-urn>" }) { id instanceUrn deviceName status } } } -
Take the entry whose
idequals the volume’sclaimRef. ItsinstanceUrnis the instance, anddeviceNameis the device name the guest sees. -
Confirm by reading the instance. Its
volumeAttachmentsinclude the volume.terminal origin compute get-instance --instance-urn <instance-urn>
Reading the attachment list
Normally the list has one entry, with status ATTACHED. Other entries appear while an attach or detach is in progress and after an attach that FAILED. An entry with status RELEASE_ABANDONED may still hold the volume: the platform has stopped trying to release it. Detached attachments aren’t listed.
A volume from another project returns an empty list, exactly like a volume that doesn’t exist.