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 874544fd64
commit 8b6936bde6
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.VirtualMachinePowerState;
import com.vmware.vim25.VirtualMachineRuntimeInfo; import com.vmware.vim25.VirtualMachineRuntimeInfo;
import com.vmware.vim25.VirtualSCSISharing; import com.vmware.vim25.VirtualSCSISharing;
import com.xensource.xenapi.VLAN;
public class VmwareResource implements StoragePoolResource, ServerResource, VmwareHostService { public class VmwareResource implements StoragePoolResource, ServerResource, VmwareHostService {
private static final Logger s_logger = Logger.getLogger(VmwareResource.class); private static final Logger s_logger = Logger.getLogger(VmwareResource.class);

View File

@ -6060,12 +6060,16 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
@Override @Override
public String getNetworkTag(HypervisorType hType, Network network) { public String getNetworkTag(HypervisorType hType, Network network) {
// no network tag for control traffic type // 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; return null;
} }
Long physicalNetworkId = null; Long physicalNetworkId = null;
if (network.getTrafficType() != TrafficType.Guest) { if (effectiveTrafficType != TrafficType.Guest) {
physicalNetworkId = getNonGuestNetworkPhysicalNetworkId(network); physicalNetworkId = getNonGuestNetworkPhysicalNetworkId(network);
} else { } else {
NetworkOffering offering = _configMgr.getNetworkOffering(network.getNetworkOfferingId()); NetworkOffering offering = _configMgr.getNetworkOffering(network.getNetworkOfferingId());
@ -6078,7 +6082,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
return null; return null;
} }
return _pNTrafficTypeDao.getNetworkTag(physicalNetworkId, network.getTrafficType(), hType); return _pNTrafficTypeDao.getNetworkTag(physicalNetworkId, effectiveTrafficType, hType);
} }
protected Long getNonGuestNetworkPhysicalNetworkId(Network network) { protected Long getNonGuestNetworkPhysicalNetworkId(Network network) {