bug 15080: check traffic type in host discovery stage - cluster level checks

This commit is contained in:
Kelven Yang 2012-05-25 10:51:39 -07:00
parent d8d4232a7b
commit 9298e5d25d

View File

@ -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