VMware Cloud Community
saiquestion
Contributor
Contributor

How to find out ESXserver details

Hi,

I am trying to get the details of the following

1.How to find out Whether a Server has ESX installed on it ?

2.How to find the list of VMs running on the ESX server ?

3.HOw to find out what is the vmware software running on the server ?

Are there any APIs for finding this information ?

0 Kudos
4 Replies
RvdNieuwendijk
Leadership
Leadership

Hi,

welcome to the VMware communities.

You can use VMware vSphere PowerCLI to answer you questions. PowerCLI is based on Windows PowerShell. So you need that as well.

1. To connect to an ESX server you can use the Connect-VIserver cmdlet:

Connect-VIserver <YourESXServer> -Credential (Get-Credential)

If you can do this, you will know it is an ESX server.

2. To find the list of VMs running on the ESX server you can use the Get-VM cmdlet:

Get-VM

3. To find out which vmware software is running on the server you can use the Get-VMHost cmdlet:

Get-VMHost | Format-List *

This gives you the version and the build of the ESX software, among many other properties.

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
mudha
Hot Shot
Hot Shot

run vmware -v for esx version and for vm's esxcfg-info get vm should work

0 Kudos
saiquestion
Contributor
Contributor

Hi Robert ,

Thanks for ur reply.

Does Vsphere expose any APIs instead of CLI to retrieve this the above information ?Like any JMX Apis or webservice APIs to retrieve the information ?

0 Kudos
RvdNieuwendijk
Leadership
Leadership

The VMware vSphere API is exposed entirely via PowerCLI. So everything you can do in the API you can do in PowerCLI.

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos