VMware Cloud Community
Garrett_M_
Contributor
Contributor
Jump to solution

How to do a Host Summary Reports on whole inventory?

We have lots and lost of hosts and would like to do a Host Summary Report across the board. From VIC I can only do this one host at a time. it would be nice to select a Datacenter or the whole inventory and run this report. Any ideas on how to do something like this?

Regards,

Garrett

0 Kudos
1 Solution

Accepted Solutions
vmmeup
Expert
Expert
Jump to solution

What specifics are you looking for in the host summary report? It is fairly simple to write powershell scripts using the VI toolKit and export whatever data you like to a csv file.

Here is a simple script that will give you inforamtion about a vm. It will give you the Name, host, powerstate, memory, numcpu, IP, & hostname.

$IPprop = @{ Name = "IP Address"; Expression = { $_.Guest.IpAddress } }

$HostNameProp = @{ Name = "Hostname"; Expression = { $_.Guest.Hostname } }

Get-VM | select name, host, powerstate, MemoryMB, numCPU, $IPprop, $HostNameProp | export-csv c:\vm_info.csv

-Sid Smith

http://www.dailyhypervisor.com

Sid Smith ----- VCP, VTSP, CCNA, CCA(Xen Server), MCTS Hyper-V & SCVMM08 [http://www.dailyhypervisor.com] - Don't forget to award points for correct and helpful answers. 😉

View solution in original post

0 Kudos
3 Replies
harryc
Enthusiast
Enthusiast
Jump to solution

I would use scripting, this one shows which VM is on a host, and it's state.

root@vmhost01 root# cat list-vms

#!/bin/sh

#

  1. /root/list-vms

#

  1. Purpose : list the vms registered on the ESX host and displays their status

#

  1. 2009-03-10 Harry C started

for VM in `vmware-cmd -l | cut -f5,6 -d"/" `

do

echo $VM

VMX=`ls -d /vmfs/volumes/[vV]*/$VM`

vmware-cmd $VMX getstate

done

root@vmhost01 root#

you could replace vmware-cmd ... getstate with whatever more verbose command you would like - any inputs on which command would give the most (useful) info ?

vmmeup
Expert
Expert
Jump to solution

What specifics are you looking for in the host summary report? It is fairly simple to write powershell scripts using the VI toolKit and export whatever data you like to a csv file.

Here is a simple script that will give you inforamtion about a vm. It will give you the Name, host, powerstate, memory, numcpu, IP, & hostname.

$IPprop = @{ Name = "IP Address"; Expression = { $_.Guest.IpAddress } }

$HostNameProp = @{ Name = "Hostname"; Expression = { $_.Guest.Hostname } }

Get-VM | select name, host, powerstate, MemoryMB, numCPU, $IPprop, $HostNameProp | export-csv c:\vm_info.csv

-Sid Smith

http://www.dailyhypervisor.com

Sid Smith ----- VCP, VTSP, CCNA, CCA(Xen Server), MCTS Hyper-V & SCVMM08 [http://www.dailyhypervisor.com] - Don't forget to award points for correct and helpful answers. 😉
0 Kudos
Garrett_M_
Contributor
Contributor
Jump to solution

Ahhh! Powershell and the VI toolkit... Good answer. Since the VI DB is SQL I wonder if we could use SQL Reporting Services as well.

Thanks,

Garrett

0 Kudos