-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Cleanup allocated snapshots / vm snapshots, and update pending ones to Error on MS start #8452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup allocated snapshots / vm snapshots, and update pending ones to Error on MS start #8452
Conversation
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.20 #8452 +/- ##
============================================
- Coverage 16.17% 16.17% -0.01%
- Complexity 13297 13298 +1
============================================
Files 5656 5656
Lines 498136 498218 +82
Branches 60432 60451 +19
============================================
+ Hits 80584 80585 +1
- Misses 408584 408659 +75
- Partials 8968 8974 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@sureshanaparti |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8207 |
@weizhouapache issue is some active snapshots / vm snapshots are left in allocated when MS is stopped, no point in keeping them and wait until storage garbage collector cleans up (what if storage cleanup is disabled?) as these are listed / shown in UI as well (which are not allowed to delete). So, I think, it's better remove them on start itself. Any other thoughts / suggestions? |
@sureshanaparti We could add the cleanup of Allocated snapshot and Allocated/Error vm snapshots in the process IMHO, it is not the right place to cleanup during mgmt server start, as mgmt server might be running for several days. |
@weizhouapache Agreed for the resources in error state (as there might be things to reset / cleanup) and MS is running. snapshot / vm snapshots are in Allocated, mostly for the very recent active snapshot / vm snapshots before MS is stopped, so no need for any cleanup, better to set them as removed (Any event through state transition would still keep it in Allocated). Otherwise, at least have to not list them on UI, or allow explicit deletion from the UI. Snapshots in destroying state are deleted here. So, I thought, it's better to remove there on MS start. cloudstack/server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java Lines 1519 to 1523 in 3f9dd4d
|
@sureshanaparti (OK with cleaning up resource in both start process and garbage collector) |
ok, will check & update. thanks @weizhouapache |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
@sureshanaparti , does this need rebasing? |
|
on another note, is it maybe safe to first mark it as State == Error and then delete? (I think this is the same @weizhouapache suggests) |
|
@sureshanaparti , any progress on this? |
|
@blueorangutan package |
|
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 12329 |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
vishesh92
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
6c7d975 to
549842b
Compare
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 14985 |
|
@blueorangutan test |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-14314)
|
|
tested mgmt server restart during volume snapshot and vm snapshot
|
… job not finished and snapshot in Creating state
updated @weizhouapache, to change volume back to Ready (from Snapshotting). |
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15059 |
|
tested ok @blueorangutan test |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-14416)
|
…g ones to Error on MS start (apache#8452) * Remove allocated snapshots / vm snapshots on start * Check and Cleanup snapshots / vm snapshots on MS start * rebase fixes * Update volume state (from Snapshotting) on MS start when its snapshot job not finished and snapshot in Creating state
Description
Some latest active snapshots / vm snapshots are stuck in allocated / creating state when MS is stopped, these are listed / shown in UI as well (not allowed to delete). Remove allocated ones on MS start itself, and move creating ones to Error state (these will be removed by the storage garbage collector).
This PR removes snapshots / vm snapshots in allocated state on MS start, and moves creating one to Error state.
Fixes #8424
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Manually tested: Take VM Snapshot -> Stop MS -> Start MS
VM Snapshot record after MS stopped =>
VM Snapshot record after MS started (Not listed / shown in the UI) =>
How did you try to break this feature and the system with this change?