bug 15080: check traffic type in host discovery stage - cluster level checks
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/9298e5d2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/9298e5d2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/9298e5d2 Branch: refs/heads/master Commit: 9298e5d25d430b80d9a14b437193ae9802bf363a Parents: d8d4232 Author: Kelven Yang <[email protected]> Authored: Fri May 25 10:51:39 2012 -0700 Committer: Kelven Yang <[email protected]> Committed: Wed Jun 6 16:54:16 2012 -0700 ---------------------------------------------------------------------- .../cloud/hypervisor/vmware/VmwareManagerImpl.java | 23 +++++++-------- 1 files changed, 11 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/9298e5d2/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 746b582..90a040b 100755 --- a/server/src/com/cloud/hypervisor/vmware/VmwareManagerImpl.java +++ b/server/src/com/cloud/hypervisor/vmware/VmwareManagerImpl.java @@ -374,7 +374,6 @@ public class VmwareManagerImpl implements VmwareManager, VmwareStorageMount, Lis ManagedObjectReference mor = null; if (serviceContext != null) mor = serviceContext.getHostMorByPath(hostInventoryPath); - String privateTrafficLabel = null; privateTrafficLabel = serviceContext.getStockObject("privateTrafficLabel"); if (privateTrafficLabel == null) { @@ -393,6 +392,7 @@ public class VmwareManagerImpl implements VmwareManager, VmwareStorageMount, Lis HostFirewallSystemMO firewallMo = hostMo.getHostFirewallSystemMO(); if(firewallMo != null) { if(hostMo.getHostType() == VmwareHostType.ESX) { + firewallMo.enableRuleset("vncServer"); firewallMo.refreshFirewall(); } @@ -436,14 +436,14 @@ public class VmwareManagerImpl implements VmwareManager, VmwareStorageMount, Lis } } - 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]; } + + s_logger.info("Calling prepareNetwork : " + hostMo.getContext().toString()); // prepare at least one network on the vswitch to enable OVF importing if(!_nexusVSwitchActive) { @@ -467,12 +467,11 @@ public class VmwareManagerImpl implements VmwareManager, VmwareStorageMount, Lis } } - 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]; } // prepare at least one network on the vswitch to enable OVF importing
