permit VM's to be created in different zone that in which network is

created if the network support streched L2 subnet
This commit is contained in:
Murali Reddy 2014-03-11 20:04:45 +05:30
parent edf12ebc1e
commit 5f4bebf35c
1 changed files with 3 additions and 3 deletions

View File

@ -2420,7 +2420,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
}
s_logger.debug("Creating network for account " + owner + " from the network offering id=" + requiredOfferings.get(0).getId() + " as a part of deployVM process");
Network newNetwork = _networkMgr.createGuestNetwork(requiredOfferings.get(0).getId(), owner.getAccountName() + "-network", owner.getAccountName() + "-network",
null, null, null, null, owner, null, physicalNetwork, zone.getId(), ACLType.Account, null, null, null, null, true, null);
null, null, null, null, owner, null, physicalNetwork, zone.getId(), ACLType.Account, null, null, null, null, true, null, requiredOfferings.get(0).getSupportsStrechedL2());
defaultNetwork = _networkDao.findById(newNetwork.getId());
} else if (virtualNetworks.size() > 1) {
throw new InvalidParameterValueException("More than 1 default Isolated networks are found for account " + owner + "; please specify networkIds");
@ -2644,7 +2644,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
boolean securityGroupEnabled = false;
boolean vpcNetwork = false;
for (NetworkVO network : networkList) {
if (network.getDataCenterId() != zone.getId()) {
if ((network.getDataCenterId() != zone.getId()) && !network.isStrechedL2Network()) {
throw new InvalidParameterValueException("Network id=" + network.getId() + " doesn't belong to zone " + zone.getId());
}
@ -4543,7 +4543,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
+ " as a part of deployVM process");
Network newNetwork = _networkMgr.createGuestNetwork(requiredOfferings.get(0).getId(), newAccount.getAccountName() + "-network",
newAccount.getAccountName() + "-network", null, null, null, null, newAccount, null, physicalNetwork, zone.getId(), ACLType.Account, null, null,
null, null, true, null);
null, null, true, null, requiredOfferings.get(0).getSupportsStrechedL2());
// if the network offering has persistent set to true, implement the network
if (requiredOfferings.get(0).getIsPersistent()) {
DeployDestination dest = new DeployDestination(zone, null, null, null);