3

I looked and looked but probably overlooked . I have a vsphere cloud with over 300 virtual machines. Each machine name as it appears in the vsphere client is actually the hostname of each machine (I have done this manually). Those machines sometimes have to change their hostname. At this time I hope there is a way to obtain/get/read the guest machine name from the machine itself, and then if there is a mismatch, then I'll know and modify the machine name when needed.

So, vmware-toolbox-cmd or other tool (from the linux open-vm-tools) can retrieve that info, the machine name ?

1 Answers1

0

I don't normally use the ESXi host directly to retrieve information about the guest VMs, but you should be able to do something like: vmware-toolbox-cmd config get guestinfo hostname

This is sourced from the API docs for GuestInfo

Kyle Ruddy
  • 1,886
  • 1
  • 7
  • 5
  • 2
    I know the hostname inside the machine. Also the [-(~)> vmware-toolbox-cmd config get guestinfo hostname < provides the reply : [guestinfo] hostname UNSET . I need to be able to retrieve the vm name ( as it appears in the esxi repo ) – Zander Steriadi Jun 25 '20 at 14:40