use of com.vmware.vim25.HostNetworkInfo in project cloudstack by apache.
the class HostMO method hasOpaqueNSXNetwork.
public boolean hasOpaqueNSXNetwork() throws Exception {
HostNetworkInfo netInfo = getHostNetworkInfo();
List<HostOpaqueNetworkInfo> opaqueNetworks = netInfo.getOpaqueNetwork();
if (opaqueNetworks != null) {
for (HostOpaqueNetworkInfo opaqueNetwork : opaqueNetworks) {
if (opaqueNetwork.getOpaqueNetworkId() != null && opaqueNetwork.getOpaqueNetworkId().equals("br-int") && opaqueNetwork.getOpaqueNetworkType() != null && opaqueNetwork.getOpaqueNetworkType().equals("nsx.network")) {
return true;
}
}
throw new Exception("NSX API VERSION >= 4.2 BUT br-int (nsx.network) NOT FOUND");
} else {
throw new Exception("NSX API VERSION >= 4.2 BUT br-int (nsx.network) NOT FOUND");
}
}
use of com.vmware.vim25.HostNetworkInfo in project cloudstack by apache.
the class HostMO method getPortGroupVirtualSwitchName.
public String getPortGroupVirtualSwitchName(String portGroupName) throws Exception {
HostNetworkInfo hostNetInfo = getHostNetworkInfo();
List<HostPortGroup> portGroups = hostNetInfo.getPortgroup();
if (portGroups != null) {
for (HostPortGroup portGroup : portGroups) {
HostPortGroupSpec spec = portGroup.getSpec();
if (spec.getName().equals(portGroupName))
return spec.getVswitchName();
}
}
return null;
}
Aggregations