You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ke...@apache.org on 2012/06/07 02:10:16 UTC

[6/6] git commit: bug : CS-15080 - check traffic label at host discovery stage also

bug : CS-15080 - check traffic label at host discovery stage also


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

Branch: refs/heads/master
Commit: d8d4232a7b83c6d50aed34d44541a3bdadb599c2
Parents: 7092532
Author: Kelven Yang <ke...@cloud.com>
Authored: Fri May 25 10:18:26 2012 -0700
Committer: Kelven Yang <ke...@cloud.com>
Committed: Wed Jun 6 16:53:53 2012 -0700

----------------------------------------------------------------------
 .../cloud/hypervisor/vmware/VmwareManagerImpl.java |   17 ++++++--------
 1 files changed, 7 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d8d4232a/server/src/com/cloud/hypervisor/vmware/VmwareManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/vmware/VmwareManagerImpl.java b/server/src/com/cloud/hypervisor/vmware/VmwareManagerImpl.java
index 705b46f..746b582 100755
--- a/server/src/com/cloud/hypervisor/vmware/VmwareManagerImpl.java
+++ b/server/src/com/cloud/hypervisor/vmware/VmwareManagerImpl.java
@@ -376,11 +376,9 @@ public class VmwareManagerImpl implements VmwareManager, VmwareStorageMount, Lis
             mor = serviceContext.getHostMorByPath(hostInventoryPath);
 
         String privateTrafficLabel = null;
-        if (_nexusVSwitchActive) {
-            privateTrafficLabel = serviceContext.getStockObject("privateTrafficLabel");
-            if (privateTrafficLabel == null) {
-                privateTrafficLabel = _privateNetworkVSwitchName;
-            }
+        privateTrafficLabel = serviceContext.getStockObject("privateTrafficLabel");
+        if (privateTrafficLabel == null) {
+            privateTrafficLabel = _privateNetworkVSwitchName;
         }
 
         if(mor != null) {
@@ -401,12 +399,11 @@ public class VmwareManagerImpl implements VmwareManager, VmwareStorageMount, Lis
                 }
 
                 // prepare at least one network on the vswitch to enable OVF importing
-                String managementPortGroupName = getManagementPortGroupByHost(hostMo);
-                assert(managementPortGroupName != null);
-                HostPortGroupSpec spec = hostMo.getPortGroupSpec(managementPortGroupName);
                 String vlanId = null;
-                if(spec.getVlanId() != 0) {
-                    vlanId = String.valueOf(spec.getVlanId());
+                if(privateTrafficLabel != null) {
+                	String[] tokens = privateTrafficLabel.split(",");
+                	if(tokens.length == 2)
+                		vlanId = tokens[1];
                 }
 
                 if(!_nexusVSwitchActive) {