advice needed: snapshot DB/table cleanup
HI guys, hi Mike.T.,
we have removed all NFS and CEPH storages, and are now purely running on
Now I want to do serious snapshot cleanup (for reason explained at the end
of email) - since "snapshots" and "snapshot_store_ref" tables are a
complete mess (i.e. snapshot is destroyed with/without "removed" date, and
then there are still references in snapshot_store_ref to these fully/half
I would like to ask for a tip - based on my common sense and experience, I
was thinking on doing something like following:
delete from snapshot_store_ref where snapshot_id in (select id from
snapshots where status="destroyed" or removed is NOT NULL and min_iops is
This last "min_iops is NULL" is identifier for snaps that are NOT on
SolidFire - I would not touch SF snapshots) - i.e. all snapshots that are
created from SF volumes have min_iops and max_iops values set - so I just
exclude them here....
- So - above I want to remove all references for snapshots that are
fully/semi destroyed (status=destroyed but no removed date - or other way
around - those that have "removed" date but status=Ready.....)
Then I was also thinking does it make sense, to also set (in "snapshots"
table) status=Destroyed where removed is NOT NULL and other way around -
set removed date where status=Destroyed.
Sorry for long question - but I had issues with some snaps referencing CEPH
(and we removed CEPH/NFS from ACS GUI) - i.e. client was unable to list
snaps for his account, because some volumes had snaps that were referencing
CEPH (though they are migrated to SF or deleted)...
Thanks a lot