Anyone have simple script that can make a list of all VMs and total the amount of disk space allocated by each one, preferably including snapshot size if one exists. I'm not as concerned about white space per drive. I'd just like to see what VMs are using the most space by totalling space allocated of each VM.
Thanks. Still trying to learn powershell when I can find the time!
Here you go. This was a rough draft that we created last week. It will give up to 3 VMDK's for each VM in an excel workbook. Change the vc_server var. Hope it helps.
Have a look at .
It doesn't do exactly what you ask for but if you create your guest in a "standard way" it shows you the size of your guest (snapshots included).
With the "standard way" I mean:
- guest folder on level 1 of the datastore
- virtual disk(s) stored with the guest
- swap file stored with the guest
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi cknox,
your script is nearly perfekt for me, thanx this way !!!!
But one question still on... how is it possible to list the snapshots (name, creation date, allocated space) to every VM ?
Greets,
Michael
Easiest way is to use the get-snapshot cmdlet.
get-vm | get-snapshot
I know,
but i was not able to implement it in the script (shame on me.....:()
Maybe you can give me a hint....
Greets,
Michael
I'm fairly lazy so I would just export to a csv file.
get-vm | get-snapshot | export-csv -path C:\temp\snapshot.csv
My Problem still exist...
What i need is the allocated space for each Snapshot!!!
With the script from cknox, i get all Harddisks form the VM´s. and like the
allocated space from the HD´s i need the allocated space for each Snapshot.
So what i really look for is a hint how i can manage to get all Informations in one xls or cvs...
The attached script puts all the information in one HTML document..
Rob tool www.robware.net is also very usefull...
Cheers
Hi
This script works very well. I do have a question there are 2 columns that the script builds owner and dept.
Where does it pull this information from. How can I add that to my vc so the spreadsheet will populate
those 2 pieces of information.
thanks
Is this directed @ the script I attached??
Nice script. Thanks for posting.
Yes the script you attached. Where the 2 fields added note and annotations to virtual center to read from.
Or are they just the 2 lines in the script that add the fields to the spreadsheet
thanks