You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 678ed74
Browse filesBrowse the repository at this point in the historyBrowse files
CS-3474: Transition KVM disk-only VM snapshot to Error state on delete failure
deleteVMSnapshot in KvmFileBasedStorageVmSnapshotStrategy transitioned the
snapshot to Expunging but had no exception handling, so any exception thrown
by the merge/delete helpers (e.g. an agent command timeout) left the
snapshot permanently stuck in Expunging. VMSnapshotManagerImpl.hasActiveVMSnapshotTasks
treats Expunging as active work, so this permanently blocked reboot and
further snapshot operations on the VM.
Wrap the delete body in a try/catch, mirroring the existing pattern already
used by takeVMSnapshot and revertVMSnapshot in the same class: on any
RuntimeException, transition the snapshot to Error via the existing
Expunging -> OperationFailed state machine transition before rethrowing.
Test: KvmFileBasedStorageVmSnapshotStrategyTest#testDeleteVMSnapshotMarksSnapshotFailedWhenDeleteThrowsAfterExpungeRequested
fails without this fix (no OperationFailed transition is ever fired) and
passes with it.
Copy file name to clipboardExpand all lines: engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/vmsnapshot/KvmFileBasedStorageVmSnapshotStrategy.java
+43-38Lines changed: 43 additions & 38 deletions
Original file line number
Diff line number
Diff line change
@@ -142,52 +142,57 @@ public boolean deleteVMSnapshot(VMSnapshot vmSnapshot) {
Copy file name to clipboardExpand all lines: engine/storage/snapshot/src/test/java/org/apache/cloudstack/storage/vmsnapshot/KvmFileBasedStorageVmSnapshotStrategyTest.java
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -439,6 +439,32 @@ public void testDeleteVMSnapshotFailsWhenHostLacksNvramAwareCleanupCapabilityFor
0 commit comments