fabricesforzani
Contributor
Contributor

on which host a vm is running

Hello

We are looking for a script solution to know on which host a Linux/unix VM is running

this script must be run in the VM inside

Example : I have 10 unix linux VMs

and I want to run a script inside the 10 vm that give me the name of the esk host

0 Kudos
4 Replies
ab_lal
Enthusiast
Enthusiast

Is it possible to get the ESX name from linux... what is the command to get the ESX name from inside the Linux VM.

0 Kudos
schepp
Leadership
Leadership

It's not possible to find out the ESX hostname from inside the VM, see: http://communities.vmware.com/message/953913

You could do it the other way round. You can run a script on your ESX hosts that uses the command "vmware-cmd -l" to show what vms are running on that host. Now you need to grep for your Linux-VM-Names, etc.

Greets

0 Kudos
kish09
Enthusiast
Enthusiast

Hi,

Go to your virtual center client ...>select datacenter---> and then on right side -> select virtual machine tab->right click on that bar and select guest os,esx host ,ip address option from list and uncheck unnecessary option .---->click on guest os tab .u will get the vms with os type...

Get a list of them by exporting list.File-->export->export list.

This is the simplest way,in few click u will get a list distingiushed by os with esx host name/ip.

If you found this or any other answer useful please consider the use of the Helpful or correct

buttons to award points.

thnx.

0 Kudos
AntonVZhbankov
Immortal
Immortal

I know how to do it from Windows VM (with PowerShell), but could you please explain what for?


---

MCSA, MCTS, VCP, VMware vExpert '2009

http://blog.vadmin.ru

EMCCAe, MCITP: SA+VA, VCP 3/4/5, VMware vExpert http://blog.vadmin.ru
0 Kudos