VMware {code} Community
aenagy
Hot Shot
Hot Shot
Jump to solution

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

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 (vSphere 6.0 Documentation Center). 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.

P.S. I hope I got the correct forum.

0 Kudos
1 Solution

Accepted Solutions
daphnissov
Immortal
Immortal
Jump to solution

P.S. I hope I got the correct forum.

Unfortunately, you didn't Smiley Happy This should go in the vRealize Orchestrator sub-forum where you'll get the best help.

View solution in original post

0 Kudos
2 Replies
daphnissov
Immortal
Immortal
Jump to solution

P.S. I hope I got the correct forum.

Unfortunately, you didn't Smiley Happy This should go in the vRealize Orchestrator sub-forum where you'll get the best help.

0 Kudos
aenagy
Hot Shot
Hot Shot
Jump to solution

daphnissov​:

Thanks for the feedback. I was thinking (hoping?) that this was generic to the vSphere API and not dependent on the caller (vRO).

Re-posted here:

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

0 Kudos