I apologize for my very basic question.
I need to produce a file (better if an Excel file) with the list of all the VMs in a simple vSphere 5.x infrastructure including 2 VMare ESXi 5.x servers and the disk space used (not allocated, just used) by each VM.
The simplest way looks to list the VMs from the vSphere client and export the list as an .xls file.
It looks simple, but when I look at the file I see either a lot of VMs missing and/or a lot of values missing for many VMs (just blank cells).
Is it a problem related to my vSphere client?
I attempted to create a PowerCli script using the "Get-VM | select-object Name" command, but my limited skill don't let me extract the used space value.
Can anybody please provide a PowerCli sample I can just copy and use?
Is there any other way to get the information I need?
Regards
marius
.
Not knowing if you have setup a cluster or just standalone hosts, here is a simple one liner...
Get-VMHost -Name <ESXi hostname> | get-vm | select name,usedspaceGB
From here, you can do some formatting, get total usage etc.
Not knowing if you have setup a cluster or just standalone hosts, here is a simple one liner...
Get-VMHost -Name <ESXi hostname> | get-vm | select name,usedspaceGB
From here, you can do some formatting, get total usage etc.
Great!!!!
In Italian we say "Appetite comes with eating"...
Can I get the datastore name, the folder name and the allocated space as well?
Even better, where can I locate a list of values I can get?
Thank you in advance
marius
To look at the values that are available on a vm object...get-vm -Name <vmname> | get-view
For example,
$vm = Get-VM -name <vm name> | Get-View
$vm.Storage.PerDatastoreUsage
provides this output:
Datastore | : <Datastore Name> |
Committed | : 39015129982 |
Uncommitted | : 59726761984 |
Unshared | : 39015129982 |
LinkedView | : |
DynamicType | : |
DynamicProperty :
There are a lot of values per object available to drill into. Explore!