Home > Command Line > Virtual Machine Sizes

Virtual Machine Sizes

This can be useful to keep track of what people are creating. Get an index of the Virtual Machine sizes and the free space in the datastores (very important).

[root@esx007 root]# cat size_servers.sh
#!/bin/sh

date > /root/size_servers.txt
echo ——————– >> /root/size_servers.txt
echo Virtualised Servers and Datastores >> /root/size_servers.txt
echo ——————– >> /root/size_servers.txt
ls -1F /vmfs/volumes/ | grep @ | cut -d @ -f 1 | while read dir; do
 ls -lah /vmfs/volumes/${dir}/* >> /root/size_servers.txt
done
echo ——————– >> /root/size_servers.txt
echo “Free Space | Percentage Free | Volume” >> /root/size_servers.txt
echo ——————– >> /root/size_servers.txt
/usr/sbin/vdf -h | grep volumes | grep -v local | grep -v “-” | cut -c 34-40,41-44,59-100 >> /root/size_servers.txt

VN:F [1.9.11_1134]
Rate this post:
Rating: 0.0/10 (0 votes cast)

  1. No comments yet.
  1. No trackbacks yet.

Bad Behavior has blocked 1176 access attempts in the last 7 days.

© 2009-2012 Chris Kranz All Rights Reserved
This site is not affiliated or sponsored in anyway by NetApp or any other company mentioned within.