VMware Cloud Community
TimDScott
Enthusiast
Enthusiast
Jump to solution

Derive ESXI host address from VC:VirtualMachine

Hi,

I'm trying to get the ESXI host address for a given VC:VirtualMachine, can't seem to figure this out! Any ideas?

Thanks,

Tim.

Reply
0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

Could you try also

var name = vm.runtime.host.name;

BTW, which vRO and vCenter plug-in versions do you use?

View solution in original post

Reply
0 Kudos
6 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi,

Try

var name = vm.hostName;

where vm is your VC:VirtualMachine object.

Reply
0 Kudos
TimDScott
Enthusiast
Enthusiast
Jump to solution

Thanks, that was the first thing I tried, however it's null?

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

Could you try also

var name = vm.runtime.host.name;

BTW, which vRO and vCenter plug-in versions do you use?

Reply
0 Kudos
TimDScott
Enthusiast
Enthusiast
Jump to solution

Thanks, that seems to work OK, but will this info be available if the vm is not running?

I'm using vro v7.5 with vCenter plug in v6.5.

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

Yes, I think it should work even if the vm is powered off.

Reply
0 Kudos
TimDScott
Enthusiast
Enthusiast
Jump to solution

Just tested, works fine, thanks for your help (once again!)

Reply
0 Kudos