CLOUDSTACK-3468 Failed to Deploy Instances with multiple VMWARE clusters when DVS is enabled at the Zone level

Fixing cluster level override of zone level specified vSwitch settings.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
This commit is contained in:
Sateesh Chodapuneedi 2013-07-29 03:04:23 +05:30
parent faeddc15ff
commit 7ba5d9910b
1 changed files with 7 additions and 5 deletions

View File

@ -3245,6 +3245,12 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
// return Pair<switch name, vlan tagging>
private Pair<String, String> getTargetSwitch(NicTO nicTo) throws Exception {
if (nicTo.getType() == Networks.TrafficType.Guest) {
return new Pair<String, String>(_guestTrafficInfo.getVirtualSwitchName(), Vlan.UNTAGGED);
} else if (nicTo.getType() == Networks.TrafficType.Public) {
return new Pair<String, String>(_publicTrafficInfo.getVirtualSwitchName(), Vlan.UNTAGGED);
}
if(nicTo.getName() != null && !nicTo.getName().isEmpty()) {
String[] tokens = nicTo.getName().split(",");
// Format of network traffic label is <VSWITCH>,<VLANID>,<VSWITCHTYPE>
@ -3261,12 +3267,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
}
}
if (nicTo.getType() == Networks.TrafficType.Guest) {
return new Pair<String, String>(_guestTrafficInfo.getVirtualSwitchName(), Vlan.UNTAGGED);
} else if (nicTo.getType() == Networks.TrafficType.Control || nicTo.getType() == Networks.TrafficType.Management) {
if (nicTo.getType() == Networks.TrafficType.Control || nicTo.getType() == Networks.TrafficType.Management) {
return new Pair<String, String>(_privateNetworkVSwitchName, Vlan.UNTAGGED);
} else if (nicTo.getType() == Networks.TrafficType.Public) {
return new Pair<String, String>(_publicTrafficInfo.getVirtualSwitchName(), Vlan.UNTAGGED);
} else if (nicTo.getType() == Networks.TrafficType.Storage) {
return new Pair<String, String>(_privateNetworkVSwitchName, Vlan.UNTAGGED);
} else if (nicTo.getType() == Networks.TrafficType.Vpn) {