How to Delete Volume Attached to Stale VM?

Problem

A Persistent Storage volume cannot be deleted because it is still marked as attached to a VM, but:

  • The VM is deleted / missing / stale

  • The attachment is orphaned

  • Standard delete fails with errors like:

$ openstack volume delete <VOLUME_UUID>
Failed to delete volume with name or ID '[VOLUME_UUID]': 
Invalid volume: Volume is in status 'in-use', expected one of ('available', 'error', 'error_restoring', 'error_extending', 'error_managing'). 
(HTTP 400) (Request-ID: [REQ_ID])

Environment

  • Private Cloud Director Virtualization - v2025.4 and Higher

  • Self-Hosted Private Cloud Director Virtualization - v2025.4 and Higher

  • Component: Storage Service

Cause

This usually happens due to:

  • Failed VM deletion

  • Incomplete detach workflow

  • Messaging issues (RabbitMQ / Persistent Storage / Compute Service sync gap)

  • DB state inconsistency between Persistent Storage and Compute Service

Diagnostics

  • Step 1: Identify the Volume

    • Check:

      status -> likely in-use attachments -> contains stale server UUID

  • Step 2: Verify VM Existence

    • Check:

      Not found -> stale attachment confirmed

Resolution

  1. Force the volume to an available state for Persistent Storage to ignore the stale VM

  2. Delete the stale attachment:

  3. Delete the volume:

Validation

  • The volume is deleted successfully

circle-info

Below step is applicable for Self-Hosted Private Cloud Director Users who can access the persistent storage and compute service databases.

  • No stale entries present in the following tables:

    • volume_attachment

    • nova.block_device_mapping

Last updated