mirror of https://github.com/apache/cloudstack.git
server: Limit API from trying to start a VM that is already running (#3979)
Fixes #2736
This commit is contained in:
parent
e8fe35bd59
commit
7a41e27526
|
|
@ -4632,6 +4632,10 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
|
|||
throw new InvalidParameterValueException("unable to find a virtual machine with id " + vmId);
|
||||
}
|
||||
|
||||
if (vm.getState()== State.Running) {
|
||||
throw new InvalidParameterValueException("The virtual machine "+ vm.getUuid()+ " ("+ vm.getDisplayName()+ ") is already running");
|
||||
}
|
||||
|
||||
_accountMgr.checkAccess(callerAccount, null, true, vm);
|
||||
|
||||
Account owner = _accountDao.findById(vm.getAccountId());
|
||||
|
|
|
|||
Loading…
Reference in New Issue