I am trying to find out if I can figure out if a VM is in a resource pool using a remote command line. This could be as simple as getting a list of the resource pools available on a host, or listing if a VM is a member of a resource pool. Any ideas anyone?
I have tried the tools provided with vmware-viperl (guestinfo.pl and vminfo.pl) and vmware-cmd (as well as other tools that were not even close).
Thanks.
Take a look at this script which extracts this information without having to use the unsupported ESXi console:
You'll need to install the vSphere SDK for Perl OR use [vMA|http://www.vmware.com/support/developer/vima/index.html
=========================================================================
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".
I'm not sure that is it possible using a simple CLI.
See also those threads:
Andre
Try powershell . .
something like:
$report = @()
$vms = Get-VM
foreach ($vm in $vms){
foreach($hd in $vm | Get-HardDisk){
$row = "" | select VMname, VMdisksize, server, resrcepool
$row.VMname = $vm.Name
$row.VMdisksize = $hd.CapacityKB
$row.server = ($vm | Get-VMHost).Name
$row.resrcpool = ($vm | Get-ResourcePool).Name
$report += $row
}
}
$report | Export-Csv "C:\report.csv" -noTypeInformation
That's looking closer... but I forgot to mention that I wanted to do this from Linux.
Is there maybe a way to download the file /etc/vmware/hostd/pools.xml remotely? (even if it is unsupported)
Thanks.
Take a look at this script which extracts this information without having to use the unsupported ESXi console:
You'll need to install the vSphere SDK for Perl OR use [vMA|http://www.vmware.com/support/developer/vima/index.html
=========================================================================
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".
Perfect! That is exactly what I need.
Thanks.
Hello.
I've already implemented your tool ghettoVCBg2 in combination with an mail function. The only thing which I'am now need is an possibility to select my VMs via an named resource pool.
e.g. on both servers (esxi) my productive vm's are located in the pool "prod". now i want to get an list with all machines in the pool prod which I can use with ghettovcbg2
Probably it's possible to downstrip or customize your resource pl script
Thanks.
Sure, just modify the script so output a specific resource pool name. I also recommend creating a new thread and not hop onto one that's already been answered, that way you're sure someone will see this marked as a new quesiton.
=========================================================================
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".
How do I get a look at this linux script? I can't see or foolwo the links, are they dead?
That would be very helpful if the script were available. Where can I see it?
me too,
The script is not available, please fix.