General Reporting

Top 3 Scripts and Tools for July 2014

July_Scripts

Another month has come and gone and it’s due time that I post this months script spotlights. There are three scripts that I am excited to highlight this month. So let’s get down to business.

1. vCheck

I had several people reach out to me telling me that vCheck should be placed in the spotlight. This was already on my list for “Top 3 Scripts” posts. However, all of the messages I received from members of the community has since pushed this to be the #1 script for July.

What is vCheck?

vCheck, created by Alan Renouf (@alanrenouf), is a script that gives great depth and vision into your environment. vCheck can be run as a scheduled task that can email you a very neatly-formatted report.
vcheck_report

What does it check?

The following is a list of items that are reported on via vCheck:

  • General Details
    • Number of Hosts
    • Number of VMs
    • Number of Templates
    • Number of Clusters
    • Number of Datastores
    • Number of Active VMs
    • Number of Inactive VMs
    • Number of DRS Migrations for the last days
  • Snapshots over x Days old
  • Datastores with less than x% free space
  • VMs created over the last x days
  • VMs removed over the last x days
  • VMs with No Tools
  • VMs with CD-Roms connected
  • VMs with Floppy Drives Connected
  • VMs with CPU ready over x%
  • VMs with over x amount of vCPUs
  • List of DRS Migrations
  • Hosts in Maintenance Mode
  • Hosts in disconnected state
  • NTP Server check for a given NTP Name
  • NTP Service check
  • vmkernel warning messages ov the last x days
  • VC Error Events over the last x days
  • VC Windows Event Log Errors for the last x days with VMware in the details
  • VC VMware Service details
  • VMs stored on datastores attached to only one host
  • VM active alerts
  • Cluster Active Alerts
  • If HA Cluster is set to use host datastore for swapfile, check the host has a swapfile location set
  • Host active Alerts
  • Dead SCSI Luns
  • VMs with over x amount of vCPUs
  • vSphere check: Slot Sizes
  • vSphere check: Outdated VM Hardware (Less than V7)
  • VMs in Inconsistent folders (the name of the folder is not the same as the name)
  • VMs with high CPU usage
  • Guest disk size check
  • Host over committing memory check
  • VM Swap and Ballooning
  • ESXi hosts without Lockdown enabled
  • ESXi hosts with unsupported mode enabled
  • General Capacity information based on CPU/MEM usage of the VMs
  • vSwitch free ports
  • Disk over commit check
  • Host configuration issues
  • VCB Garbage (left snapshots)
  • HA VM restarts and resets
  • Inaccessible VMs

I have to say, if I could have a “Script of the Year” it would be vCheck. Recently at the Salt Lake City VMware User Conference I asked the group I was presenting to if they had used vCheck. only a handful knew what it was, but those who did raved about it. Many hats off to Alan for the time he took to create this handy script.

You can find out more about vCheck HERE. – Alan Renouf www.virtu-al.net

2. Migrate cluster from one vCenter to another vCenter

Have you ever wanted or needed to move a cluster from one vCenter to another? Mark Chuman has written a nice script and included functions to do just that! Some of the settings this script deals with include:

  • HA settings
  • DRS Settings
  • EVC
  • DRS vm rules (affinity/anti-affinity)
  • folder import/export
  • Permissions

(Note*: this does not deal with Distributed virtual Switches as they use standard vSwitches)

The script is as easy as unzipping the directory and running with PowerCLI

vC Cluster 2 vc Cluster

You can download the script and give a shoutout to Mark for his script HERE. – Mark Chuman

3. Get VM ToolsVersion –

This last month I was in the middle of writing up a blog post on this great new feature of PowerCLI 5.5 r2, where ‘ToolsVersion’ property was added to VMGuest, which returns the version as a string (If you have tried to script this before, you’ll remember that previously this had to be done using views), when I saw that Eric Shanks beat me to the punch by about 10 minutes! (Good for you Eric!)

Although this script is not as long or as robust as the previous two scripts highlighted this month, this has come as a much welcomed update to PowerCLI. In Eric’s post, he shows both the old way and the new way of returning the VMTools Version.

Screenshot 2014-08-05 19.37.41

You can read Eric’s post HERE to see how he returns the ToolsVersion value of VMs in his environment. – Eric Shanks – www.theithollow.com

SUMMARY

Another great month of activity around PowerCLI in the community. If you have a favorite script that you think should be featured in an upcoming “Top 3 Scripts” post, you can comment below or message @vTagion on Twitter.

(Note*: As always, you should NEVER run these scripts unless you have looked through the code and completely understand what they do.)