cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sate...@apache.org
Subject git commit: updated refs/heads/master to 26d8c66
Date Mon, 29 Jul 2013 08:21:04 GMT
Updated Branches:
  refs/heads/master bcf239db0 -> 26d8c668f


CLOUDSTACK-3870 [VMware] Management traffic network over a VLAN is not working

CLOUDSTACK-3437 In case of multiple physical network setup we see log message "can't get physical
network"

CloudStack's control network is management network in case of VMware.
Processing management VLAN id provided in zone traffic label for management traffic.`

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>


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

Branch: refs/heads/master
Commit: 26d8c668f9eaf4947e5867a88b0adb7b4da03254
Parents: bcf239d
Author: Sateesh Chodapuneedi <sateesh@apache.org>
Authored: Mon Jul 29 08:16:58 2013 +0530
Committer: Sateesh Chodapuneedi <sateesh@apache.org>
Committed: Mon Jul 29 08:20:51 2013 +0530

----------------------------------------------------------------------
 .../src/com/cloud/network/NetworkModelImpl.java | 48 +++++++++++++++-----
 1 file changed, 36 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26d8c668/server/src/com/cloud/network/NetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java
index d7ca639..849884d 100755
--- a/server/src/com/cloud/network/NetworkModelImpl.java
+++ b/server/src/com/cloud/network/NetworkModelImpl.java
@@ -1277,7 +1277,7 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel
{
     
         Long physicalNetworkId = null;
         if (effectiveTrafficType != TrafficType.Guest) {
-            physicalNetworkId = getNonGuestNetworkPhysicalNetworkId(network);
+            physicalNetworkId = getNonGuestNetworkPhysicalNetworkId(network, effectiveTrafficType);
         } else {
             NetworkOffering offering = _configMgr.getNetworkOffering(network.getNetworkOfferingId());
             physicalNetworkId = network.getPhysicalNetworkId();
@@ -1796,18 +1796,11 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel
{
 
     
 
-    protected Long getNonGuestNetworkPhysicalNetworkId(Network network) {
-            // no physical network for control traffic type
-    
-            // have to remove this sanity check as VMware control network is management network
+    protected Long getNonGuestNetworkPhysicalNetworkId(Network network, TrafficType trafficType)
{
+            // VMware control network is management network
             // we need to retrieve traffic label information through physical network
-    /*        
-            if (network.getTrafficType() == TrafficType.Control) {
-                return null;
-            }
-    */
             Long physicalNetworkId = network.getPhysicalNetworkId();
-    
+
             if (physicalNetworkId == null) {
                 List<PhysicalNetworkVO> pNtwks = _physicalNetworkDao.listByZone(network.getDataCenterId());
                 if (pNtwks.size() == 1) {
@@ -1817,7 +1810,7 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel
{
                     // We can make this assumptions based on the fact that Public/Management/Control
traffic types are
                     // supported only in one physical network in the zone in 3.0
                     for (PhysicalNetworkVO pNtwk : pNtwks) {
-                        if (_pNTrafficTypeDao.isTrafficTypeSupported(pNtwk.getId(), network.getTrafficType()))
{
+                        if (_pNTrafficTypeDao.isTrafficTypeSupported(pNtwk.getId(), trafficType))
{
                             physicalNetworkId = pNtwk.getId();
                             break;
                         }
@@ -1827,6 +1820,37 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel
{
             return physicalNetworkId;
         }
 
+    protected Long getNonGuestNetworkPhysicalNetworkId(Network network) {
+        // no physical network for control traffic type
+
+        // have to remove this sanity check as VMware control network is management network
+        // we need to retrieve traffic label information through physical network
+/*
+        if (network.getTrafficType() == TrafficType.Control) {
+            return null;
+        }
+*/
+        Long physicalNetworkId = network.getPhysicalNetworkId();
+
+        if (physicalNetworkId == null) {
+            List<PhysicalNetworkVO> pNtwks = _physicalNetworkDao.listByZone(network.getDataCenterId());
+            if (pNtwks.size() == 1) {
+                physicalNetworkId = pNtwks.get(0).getId();
+            } else {
+                // locate physicalNetwork with supported traffic type
+                // We can make this assumptions based on the fact that Public/Management/Control
traffic types are
+                // supported only in one physical network in the zone in 3.0
+                for (PhysicalNetworkVO pNtwk : pNtwks) {
+                    if (_pNTrafficTypeDao.isTrafficTypeSupported(pNtwk.getId(), network.getTrafficType()))
{
+                        physicalNetworkId = pNtwk.getId();
+                        break;
+                    }
+                }
+            }
+        }
+        return physicalNetworkId;
+    }
+
     @Override
     public NicProfile getNicProfile(VirtualMachine vm, long networkId, String broadcastUri)
{
         NicVO nic = null;


Mime
View raw message