CS-15080: VMware control network is CloudStack management network, correct the way to send down a correct traffic label to VMware resource

Reviewed-by: Anthony
This commit is contained in:
Kelven Yang 2012-05-31 11:32:04 -07:00
parent c89422cfb6
commit 400602ee9f
2 changed files with 7 additions and 4 deletions

View File

@ -230,7 +230,6 @@ import com.vmware.vim25.VirtualMachineGuestOsIdentifier;
import com.vmware.vim25.VirtualMachinePowerState;
import com.vmware.vim25.VirtualMachineRuntimeInfo;
import com.vmware.vim25.VirtualSCSISharing;
import com.xensource.xenapi.VLAN;
public class VmwareResource implements StoragePoolResource, ServerResource, VmwareHostService {
private static final Logger s_logger = Logger.getLogger(VmwareResource.class);

View File

@ -5998,12 +5998,16 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
@Override
public String getNetworkTag(HypervisorType hType, Network network) {
// no network tag for control traffic type
if (network.getTrafficType() == TrafficType.Control) {
TrafficType effectiveTrafficType = network.getTrafficType();
if(hType == HypervisorType.VMware && effectiveTrafficType == TrafficType.Control)
effectiveTrafficType = TrafficType.Management;
if (effectiveTrafficType == TrafficType.Control) {
return null;
}
Long physicalNetworkId = null;
if (network.getTrafficType() != TrafficType.Guest) {
if (effectiveTrafficType != TrafficType.Guest) {
physicalNetworkId = getNonGuestNetworkPhysicalNetworkId(network);
} else {
NetworkOffering offering = _configMgr.getNetworkOffering(network.getNetworkOfferingId());
@ -6016,7 +6020,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
return null;
}
return _pNTrafficTypeDao.getNetworkTag(physicalNetworkId, network.getTrafficType(), hType);
return _pNTrafficTypeDao.getNetworkTag(physicalNetworkId, effectiveTrafficType, hType);
}
protected Long getNonGuestNetworkPhysicalNetworkId(Network network) {