expunge vm: Allow expunging a VM in destroyed state (#5183)

This commit is contained in:
Pearl Dsilva 2021-07-13 13:03:40 +05:30 committed by GitHub
parent 2e376f2195
commit b5d75352f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -3011,7 +3011,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
throw new InvalidParameterValueException("unable to find a virtual machine with id " + vmId);
}
if (vm.getState() == State.Destroyed || vm.getState() == State.Expunging) {
if ((vm.getState() == State.Destroyed && !expunge) || vm.getState() == State.Expunging) {
s_logger.debug("Vm id=" + vmId + " is already destroyed");
return vm;
}