cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: updated refs/heads/4.4 to 6bd9d12
Date Thu, 19 Jun 2014 13:24:17 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 99dd86e58 -> 6bd9d1241


CLOUDSTACK-6750: [OVS] With stretched network deploying vm in a ovs
disabled zone does not fail

Fix ensures that connectivity service provider is enabled in the zone on
to which nework is being streched.

(cherry picked from commit d8cbba1bc616d43e218229a2807915c1b21569dc)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6bd9d124
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6bd9d124
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6bd9d124

Branch: refs/heads/4.4
Commit: 6bd9d1241b7ec5cf1566bef89846bad3850af875
Parents: 99dd86e
Author: Murali Reddy <muralimmreddy@gmail.com>
Authored: Thu Jun 19 16:03:46 2014 +0530
Committer: Daan Hoogland <daan@onecht.net>
Committed: Thu Jun 19 15:24:05 2014 +0200

----------------------------------------------------------------------
 server/src/com/cloud/vm/UserVmManagerImpl.java | 25 +++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6bd9d124/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 673e035..02be03c 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -2716,8 +2716,29 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
         boolean securityGroupEnabled = false;
         boolean vpcNetwork = false;
         for (NetworkVO network : networkList) {
-            if ((network.getDataCenterId() != zone.getId()) && !network.isStrechedL2Network())
{
-                throw new InvalidParameterValueException("Network id=" + network.getId()
+ " doesn't belong to zone " + zone.getId());
+            if ((network.getDataCenterId() != zone.getId())) {
+                if (!network.isStrechedL2Network()) {
+                    throw new InvalidParameterValueException("Network id=" + network.getId()
+
+                            " doesn't belong to zone " + zone.getId());
+                }
+
+                NetworkOffering ntwkOffering = _networkOfferingDao.findById(network.getNetworkOfferingId());
+                Long physicalNetworkId = _networkModel.findPhysicalNetworkId(zone.getId(),
ntwkOffering.getTags(),
+                        ntwkOffering.getTrafficType());
+                if (physicalNetworkId == null) {
+                    s_logger.warn("Network id " + network.getId() + " could not be streched
to the zone " + zone.getId()
+                            + " as valid phyical network could not be found");
+                    throw new InvalidParameterValueException("Network in which is VM getting
deployed could not be" +
+                            " streched to the zone.");
+                }
+
+                String provider = _ntwkSrvcDao.getProviderForServiceInNetwork(network.getId(),
Service.Connectivity);
+                if (!_networkModel.isProviderEnabledInPhysicalNetwork(physicalNetworkId,
provider)) {
+                    s_logger.warn("Network id " + network.getId() + " could not be streched
to the zone " +zone.getId()
+                            + " as Connectivity service provider is not enabled in the zone
" + zone.getId());
+                    throw new InvalidParameterValueException("Network in which is VM getting
deployed could not be" +
+                            " streched to the zone.");
+                }
             }
 
             //relax the check if the caller is admin account


Mime
View raw message