Posts

Showing posts with the label vsphere

Quick and Easy Datastore Usage Discovery

Have you ever had a full datastore and needed to easily discover which folder was the main culprit?  I’m sure that there are a thousand ways to do this, but one easy one is available from the ESXi host command line.  Either pull up the local console (with the local Shell enabled) or open an SSH session remotely (I know, we’re not supposed to do that anymore!).  Then, navigate to the datastore that you wish to examine with a command like: cd /vmfs/volumes/MyDatastore Once you’re on the datastore, use the “du” command to display disk usage.  If you use the command by itself, it will recursively display the disk usage of all folders/subfolders from your current location in kilobytes.  While that’s useful, it’s not the most user friendly thing in the world.  Instead, I like to use this command: du –m –d 1 That will display the disk usage in megabytes (it would be nice if it had a gigabytes option, but oh well) and will only display the total s...

vSphere Environment Analysis

vSphere Infrastructure analysis is important, so I wrote this script to help me to easily get a quick understanding of a given environment.  This grew out of the CPU Ready script that I wrote several months ago, in addition to CPU Ready detection, it can check for Memory problems as well as report the maximum CPU Usage and Active Memory for every VM in an environment. Usage:  vm-analyze.ps1 -Stat <metric to examine> -VM <VM to examine> -Days <# of days to examine> -Threshold <Threshold % as an integer above which to report CPU Ready> The script accepts the following for the Stat option: cpuReady memProblem cpuMax memMax The -VM option is optional - if it is included (as the name of a VM), the script will perform its work on that specific VM, otherwise it will analyze all VMs in the inventory.  The -Days option specifies how far back to analyze; it defaults to 6 days if not specified.  This can be important to play around with, as ...