Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 193198

How to find management IP(s) of ESXi host from VcHostSystem (vRO 7.3 and vSphere 6.0)

$
0
0

This (How to find management IP(s) of ESXi host from VcHostSystem (vRO 7.3 and vSphere 6.0) ) is being re-posted here.

 

I am trying to find the ESXi host to which a virtual machine is registered. From the vm I am able to find the host (VcHostSystem) in vRO. Searching the API it would appear that I need HostVirtualNicManagerNicType (http://pubs.vmware.com/vsphere-6-0/topic/com.vmware.wssdk.apiref.doc/vim.host.VirtualNicManager.NicType.html). The code below allows me to iterate over the virtual NICs and includes IP address information but I haven't figured out how to definitively determine which interface(s), and therefore which IP(s), are designated for ESXi management.

 

var          EsxiHostConfigNetworkdVnic = vm.runtime.host.config.network.vnic  
System.log( "EsxiHostConfigNetworkdVnic.length = " + EsxiHostConfigNetworkdVnic.length )    
for( var VnicIndex = 0 , VnicLength = EsxiHostConfigNetworkdVnic.length ; VnicIndex < VnicLength ; VnicIndex++ ){  
System.log( "EsxiHostConfigNetworkdVnic[" + VnicIndex + "] = " + EsxiHostConfigNetworkdVnic[ VnicIndex ] )  
}  

 

Thanks in advance.


Viewing all articles
Browse latest Browse all 193198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>