Search in sources :

Example 11 with HostNetworkInfo

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");
    }
}
Also used : HostNetworkInfo(com.vmware.vim25.HostNetworkInfo) HostOpaqueNetworkInfo(com.vmware.vim25.HostOpaqueNetworkInfo)

Example 12 with HostNetworkInfo

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;
}
Also used : HostNetworkInfo(com.vmware.vim25.HostNetworkInfo) HostPortGroup(com.vmware.vim25.HostPortGroup) HostPortGroupSpec(com.vmware.vim25.HostPortGroupSpec)

Aggregations

HostNetworkInfo (com.vmware.vim25.HostNetworkInfo)12 HostPortGroup (com.vmware.vim25.HostPortGroup)6 HostPortGroupSpec (com.vmware.vim25.HostPortGroupSpec)6 HostVirtualNic (com.vmware.vim25.HostVirtualNic)5 HostIpConfig (com.vmware.vim25.HostIpConfig)2 VirtualNicManagerNetConfig (com.vmware.vim25.VirtualNicManagerNetConfig)2 HostNetworkSystem (com.vmware.vim25.mo.HostNetworkSystem)2 AboutInfo (com.vmware.vim25.AboutInfo)1 ElementDescription (com.vmware.vim25.ElementDescription)1 HostOpaqueNetworkInfo (com.vmware.vim25.HostOpaqueNetworkInfo)1 HostServiceTicket (com.vmware.vim25.HostServiceTicket)1 HostVirtualNicSpec (com.vmware.vim25.HostVirtualNicSpec)1 ManagedObjectReference (com.vmware.vim25.ManagedObjectReference)1 PerfCounterInfo (com.vmware.vim25.PerfCounterInfo)1 PerfEntityMetric (com.vmware.vim25.PerfEntityMetric)1 PerfMetricId (com.vmware.vim25.PerfMetricId)1 PerfMetricIntSeries (com.vmware.vim25.PerfMetricIntSeries)1 PerfProviderSummary (com.vmware.vim25.PerfProviderSummary)1 PerfQuerySpec (com.vmware.vim25.PerfQuerySpec)1 VimPortType (com.vmware.vim25.VimPortType)1