Java 类com.vmware.vim25.HostIpConfig 实例源码

项目:cloudstack    文件:HostMO.java   
public String getHostManagementIp(String managementPortGroup) throws Exception {
    HostNetworkInfo netInfo = getHostNetworkInfo();

    List<HostVirtualNic> nics = netInfo.getVnic();
    for (HostVirtualNic nic : nics) {
        if (nic.getPortgroup().equals(managementPortGroup)) {
            HostIpConfig ipConfig = nic.getSpec().getIp();

            return ipConfig.getIpAddress();
        }
    }

    return null;
}