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
if (!VirtualMachine.State.Running.equals(userVm.getState())) {
202
-
logger.debug("ONTAP VM snapshot strategy requires a running VM, VM [{}] is in state [{}]",
203
-
vmId, userVm.getState());
201
+
// ONTAP VM snapshots work for both Running and Stopped VMs.
202
+
// Running VMs may be frozen/thawed (if quiesce is requested).
203
+
// Stopped VMs don't need freeze/thaw - just take the FlexVol snapshot directly.
204
+
VirtualMachine.StatevmState = userVm.getState();
205
+
if (!VirtualMachine.State.Running.equals(vmState) && !VirtualMachine.State.Stopped.equals(vmState)) {
206
+
logger.info("allVolumesOnOntapManagedStorage: ONTAP VM snapshot strategy requires VM to be Running or Stopped, VM [{}] is in state [{}], returning false",
207
+
vmId, vmState);
204
208
returnfalse;
205
209
}
206
210
@@ -289,7 +293,14 @@ public VMSnapshot takeVMSnapshot(VMSnapshot vmSnapshot) {
289
293
quiescevm = options.needQuiesceVM();
290
294
}
291
295
292
-
if (quiescevm) {
296
+
// Check if VM is actually running - freeze/thaw only makes sense for running VMs
Copy file name to clipboardExpand all lines: plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/vmsnapshot/OntapVMSnapshotStrategyTest.java
0 commit comments