Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
# List all volumes that has been deleted, but the attachment is not marked as deleted:
MariaDB [cinder]> SELECT volumes.id,volumes.deleted_at,volume_attachment.id,volume_attachment.deleted_at FROM volumes INNER JOIN volume_attachment ON volumes.id=volume_attachment.volume_id WHERE volumes.deleted_at IS NOT NULL AND volume_attachment.deleted_at IS NULL;

+--------------------------------------+---------------------+--------------------------------------+------------+
| id                                   | deleted_at          | id                                   | deleted_at |
+--------------------------------------+---------------------+--------------------------------------+------------+
| 1588f08b-8014-4997-b874-9268fbf99315 | 2018-06-21 13:56:43 | ad9d1a73-4754-4db0-a9a6-d1f2a96d3c87 | NULL       |
+--------------------------------------+---------------------+--------------------------------------+------------+

# If this returns something, then update the deleted_at column for every volume_attachment listed. Just use the timstamp from volumes.deleted_at
UPDATE volume_attachment SET deleted=1, deleted_at='2018-06-21 13:56:43' WHERE id='ad9d1a73-4754-4db0-a9a6-d1f2a96d3c87';

heat

Infocode
# <days> means, "purge all records older than <days>"
root@heatapi1:~# heat-manage purge_deleted <days>