Repository navigation
server: mark volume snapshots as Destroyed if it does not exist on primary and secondary storage when delete a volume - #6057
Conversation
…a volume in QCOW2 format when delete a volume in QCOW2 format, if volume snapshot does not exist on primary and secondary storage, mark the snapshot as Destroyed.
|
@blueorangutan package |
|
@blueorangutan package |
|
@nvazquez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2765 |
|
@blueorangutan test |
|
@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-3498)
|
|
@blueorangutan test |
|
@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-3504)
|
| } | ||
|
|
||
| private void markVolumeSnapshotsAsDestroyed(VolumeVO volume) { | ||
| if (!Storage.ImageFormat.QCOW2.equals(volume.getFormat())) { |
There was a problem hiding this comment.
If you have a VM with Ceph's volumes, for example, and snapshot.backup.to.secondary is disabled when you expunge the VM, all snapshots remain active in UI, but there are no records in the snapshot_store_ref table.
There was a problem hiding this comment.
@slavkap
I was not quite sure if the snapshots still work and removing this check will not lead to other unexpected issues.
If we can make sure it is not a problem to mark volume snapshot as destroyed if snapshot does not exist in primary and secondary storage, we can remove this check.
There was a problem hiding this comment.
Yes, it's better to remove this check because if we don't have snapshots on primary and secondary storage, the snapshot has to be marked as destroyed. I will test it
There was a problem hiding this comment.
@slavkap
good.
I have removed this check, and fixed the issue in vm expunge/destroy.
There was a problem hiding this comment.
Thanks, @weizhouapache. I will test it and let you know
|
@blueorangutan package |
|
@nvazquez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2795 |
|
@blueorangutan test |
|
@weizhouapache a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-3530) |
| @@ -468,6 +471,7 @@ public Void deleteVolumeCallback(AsyncCallbackDispatcher<VolumeServiceImpl, Comm | |||
| _snapshotStoreDao.remove(snapStoreVo.getId()); | |||
There was a problem hiding this comment.
Hi @weizhouapache, isn't it better to keep the info in the DB for the snapshots and update the State as Destroyed?
There was a problem hiding this comment.
@slavkap
is there any benifit ?
the records will be cleaned up by storage garbage collector.
There was a problem hiding this comment.
@weizhouapache, to keep it as history, nothing more
slavkap
left a comment
There was a problem hiding this comment.
code LGTM - tested but left a comment
|
Merging based on approvals and test results |
…imary and secondary storage when delete a volume (apache#6057) * server: mark volume snapshots as Destroyed in some cases when delete a volume in QCOW2 format when delete a volume in QCOW2 format, if volume snapshot does not exist on primary and secondary storage, mark the snapshot as Destroyed. * Update apache#6057: remove check on volume format (cherry picked from commit 3a456f1) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
when delete a volume in QCOW2 format, if volume snapshot does not exist on primary and secondary storage, mark the snapshot as Destroyed.
This fixes #5433
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?