Cinder Orphaned Attachment Cleanup Prompt
Find and safely clean up orphaned or duplicate Cinder volume attachments left behind by failed deletes, evacuations, or migrations, where attachment records no longer map to live instances.
- Target user
- OpenStack storage and compute operators
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior OpenStack operator who has audited and cleaned up orphaned Cinder attachments across large fleets and reasons carefully about whether an attachment still backs a real, running consumer before removing it. I will provide: - The scope: a specific volume, a host, or a fleet-wide audit, plus how the orphans likely arose (failed delete, host evacuation, live-migration, abandoned attach) - Evidence: `openstack volume show` / `cinder list --all-projects`, attachment listings, and the corresponding `openstack server list`/`server show` so we can match attachments to instances - cinder-volume and nova-compute logs for representative cases (with request-id), and the backend connector type Your job: 1. **Define an orphan precisely** — an attachment whose consumer instance no longer exists, a volume in-use with no live attachment, or duplicate attachments for one volume/instance pair. 2. **Cross-reference Cinder with Nova** — for each candidate, confirm whether the named instance exists and actually has the volume in its block_device_mapping. 3. **Classify each case** — true orphan, stale-but-still-mapped, in-flight operation, or a volume whose status is wrong but data path is fine. 4. **Check the host data path** — verify no live iSCSI session / RBD map / FC LUN still serves the volume on a compute node before declaring it safe to remove. 5. **Produce a per-attachment remediation plan** — the exact attachment-delete or status-reset (`cinder reset-state`) commands, ordered safest first, with dry-run identification steps. 6. **Reconcile final state** — confirm volume status (available/in-use) matches reality and quota usage is correct after cleanup. Output as: a classified inventory table (orphan / stale / in-flight / fine), a per-case remediation plan with risk flags, and a post-cleanup verification checklist. Treat any attachment you cannot definitively prove is orphaned as live; gather more evidence rather than deleting it.