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
Copy file name to clipboardExpand all lines: plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/vmsnapshot/OntapVMSnapshotStrategy.java
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -272,6 +272,15 @@ public VMSnapshot takeVMSnapshot(VMSnapshot vmSnapshot) {
272
272
"Please use snapshotmemory=false for disk-only snapshots.",
273
273
userVm.getInstanceName());
274
274
logger.error("takeVMSnapshot: {}", errorMsg);
275
+
// Clean up the VM snapshot record that was created in Allocated state before throwing
276
+
// This prevents orphaned snapshot records from showing in the UI
277
+
try {
278
+
vmSnapshotDao.remove(vmSnapshotVO.getId());
279
+
logger.debug("takeVMSnapshot: Removed VM snapshot record [{}] after memory snapshot validation failure", vmSnapshotVO.getId());
280
+
} catch (ExceptioncleanupEx) {
281
+
logger.warn("takeVMSnapshot: Failed to remove VM snapshot record [{}] during cleanup: {}",
0 commit comments