DeployVm: when SG enabled network is passed to the command, but no SG list is defined in the request, add the vm to SG enabled network automatically

Conflicts:

	server/src/com/cloud/vm/UserVmManagerImpl.java
This commit is contained in:
Alena Prokharchyk 2012-11-09 11:02:07 -08:00
parent 74622a4dc3
commit 6d9cafbf35
1 changed files with 7 additions and 2 deletions

View File

@ -2145,8 +2145,13 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
}
boolean isSecurityGroupEnabled = _networkMgr.isSecurityGroupSupportedInNetwork(network);
if (isSecurityGroupEnabled && networkIdList.size() > 1) {
throw new InvalidParameterValueException("Can't create a vm with multiple networks one of which is Security Group enabled");
if (isSecurityGroupEnabled) {
if (networkIdList.size() > 1) {
throw new InvalidParameterValueException("Can't create a vm with multiple networks one of" +
" which is Security Group enabled");
}
isSecurityGroupEnabledNetworkUsed = true;
}
if (network.getTrafficType() != TrafficType.Guest || network.getGuestType() != Network.GuestType.Shared || (network.getGuestType() == Network.GuestType.Shared && !isSecurityGroupEnabled)) {