Hello,
I am planning to deploy Test VMs on ESXi. Because of high number of Test servers I would need them to spread across multiple ESXi servers. I don't want to licence for Vcenter. The problem without vcenter is it would be difficult to know which VM is on which ESXi host. Is there a command which i run periodically to get VM names/status (like we get in vcenter) from ESXi so that i could save that information to shared drive.
Yes, there's a few ways actually, depending how you would like to view the data and how much detail.
If you just want to list VMs residing on a particular VM, you can use vmware-cmd with the vCLI
(e.g.)
vmware-cmd --server <server> --list
There's also other canned VMware scripts to provide a little bit more detail such as vminfo.pl using vSphere SDK for Perl which is installed by default with vCLI
Remember to note, that if you're using the FREE version of ESXi, querying for information using any of the toolkits will work but if you're trying to perform any operations via the CLI, such as adding a VM or change network, it will not work as you need to be using paid licensed.
=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at:
VMware Code Central - Scripts/Sample code for Developers and Administrators
If you find this information useful, please award points for "correct" or "helpful".
Yes, here is a maodified code fragment posted by harryc:
#!/bin/sh
#
# /root/list-vms
#
# Purpose : list the vms registered on the ESX host and displays their status
#
# 2009-03-10 Harry C started
for VM in `vmware-cmd -l --server <server> `
do
echo $VM
<vminfo.pl for $VM>
done
---
iSCSI SAN software