Skip to content

Commit b5d7535

Browse files
authored
expunge vm: Allow expunging a VM in destroyed state (#5183)
1 parent 2e376f2 commit b5d7535

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3011,7 +3011,7 @@ public UserVm destroyVm(DestroyVMCmd cmd) throws ResourceUnavailableException, C
30113011
throw new InvalidParameterValueException("unable to find a virtual machine with id " + vmId);
30123012
}
30133013

3014-
if (vm.getState() == State.Destroyed || vm.getState() == State.Expunging) {
3014+
if ((vm.getState() == State.Destroyed && !expunge) || vm.getState() == State.Expunging) {
30153015
s_logger.debug("Vm id=" + vmId + " is already destroyed");
30163016
return vm;
30173017
}

0 commit comments

Comments
 (0)