This is an automated email from the ASF dual-hosted git repository. DaanHoogland pushed a commit to branch 4.22 in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit 3e688b0197863bd35635d7e0999b91a35b692ac6 Merge: 5b9a3d7d320 2eef7aa9a27 Author: Daan Hoogland <[email protected]> AuthorDate: Wed May 6 11:13:45 2026 +0200 Merge tag '4.22.0.1' into 4.22 .../extensions/manager/ExtensionsManagerImpl.java | 14 +++++++------- .../java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java | 7 +++++++ .../apache/cloudstack/vm/UnmanagedVMsManagerImplTest.java | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --cc server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java index bfec3247a7b,fe91e1d9caa..baa74128ce3 --- a/server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java +++ b/server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java @@@ -754,9 -748,9 +754,16 @@@ public class VMSnapshotManagerImpl exte if (userVm.getState() != VirtualMachine.State.Running && userVm.getState() != VirtualMachine.State.Stopped) { throw new InvalidParameterValueException( - "VM Snapshot reverting failed due to vm is not in the state of Running or Stopped."); + "Instance Snapshot reverting failed because the Instance is not in Running or Stopped state."); + } + ++ if (userVm.getState() == VirtualMachine.State.Running && vmSnapshotVo.getType() == VMSnapshot.Type.Disk) { ++ throw new InvalidParameterValueException( ++ "Reverting to the Instance Snapshot is not allowed for running Instances as this would result in an Instance state change. " + ++ "For running Instances only Snapshots with memory can be reverted. " + ++ "In order to revert to a Snapshot without memory you need to first stop the Instance."); + } + if (userVm.getState() == VirtualMachine.State.Running && vmSnapshotVo.getType() == VMSnapshot.Type.Disk) { throw new InvalidParameterValueException( "Reverting to the Instance Snapshot is not allowed for running Instances as this would result in an Instance state change. " + diff --cc server/src/test/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImplTest.java index 874bce0f95e,544c37d57e9..bee6c4ad257 --- a/server/src/test/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImplTest.java +++ b/server/src/test/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImplTest.java @@@ -169,6 -167,6 +169,7 @@@ import com.cloud.vm.ImportVMTaskVO import com.cloud.vm.NicProfile; import com.cloud.vm.UserVmManager; import com.cloud.vm.UserVmVO; ++import com.cloud.vm.VmDetailConstants; import com.cloud.vm.VMInstanceDetailVO; import com.cloud.vm.VMInstanceVO; import com.cloud.vm.VirtualMachine;
