This is an automated email from the ASF dual-hosted git repository. DaanHoogland pushed a commit to branch ghi14680-stateCondition in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit 8f52075d1bfa62dd4099d1358c363d78c480ebfd Author: Daan Hoogland <[email protected]> AuthorDate: Fri Nov 20 14:32:27 2026 +0100 fix condition for detaching root volumes --- server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java index 11b24a9beef..9de9547c05b 100644 --- a/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java @@ -3547,7 +3547,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic || vm.getHypervisorType() == HypervisorType.Simulator)) { throw new InvalidParameterValueException("Root volume detach is not supported for hypervisor type " + vm.getHypervisorType()); } - if (!(vm.getState() == State.Stopped) || (vm.getState() == State.Destroyed)) { + if (!(vm.getState() == State.Stopped || vm.getState() == State.Destroyed)) { throw new InvalidParameterValueException("Root volume detach can happen only when vm is in states: " + State.Stopped.toString() + " or " + State.Destroyed.toString()); }
