Introducing VMWare snapshot management and hardware reconfiguration SBAs

We are happy to announce 5 new Script Based Actions for managing VMWare machines directly from ControlUp Console.

Snapshot management

VM snapshots are a great feature, but all too often a snapshot has been made by somebody who forgot to clean it up later. In large environments you could end up with multiple snapshots all over the place.

Finding out which snapshots exist and how much storage space they are using is a time consuming task inside vSphere. You have to check each individual machine, make a note of the the details and add up all the numbers. And then you have to start clearing them up, going to each individual machine inside vSphere.

VMware PowerCLI commands offer the ability to script many VM-related tasks, including snapshot management, but writing scripts is not always the easiest solution, especially when you have a disk space crisis on your datastores.

So I have wrapped the necessary PowerShell code into Script-based Actions, which means that if you’re using ControlUp, the following VM-related admin tasks are now a breeze:

Get VM snapshots

Check which snapshots exist for a machine by running this action against a single VM. Or, run this against multiple VMs at once to get an overview that you can export to a spreadsheet to quickly add up the amount of storage being used by all the snapshots.

Remove VM snapshot

Now that you have all your snapshot information, this action can be used to remove the unneeded individual snapshots (and their children if they have any). Just right-click the target, click Script-based Actions > Remove VM Snapshot and enter the name of the snapshot. The output will show how much space was gained by removing the snapshot..

Remove ALL VM snapshots

Often you just want to remove all snapshots of one or more VMs, and you don’t want to go through the notoriously fast vSphere interface to clean each machine. Easy, pick one or more VM and run the Remove All VM Snapshots action!

The output will show the total storage space freed up by removing the snapshots for each VM

Create VM snapshot

While we’re there, you can also create snapshots without leaving ControlUp Console. The Create VM Snapshot action will create a snapshot of the target machine. Deploying a new software package to multiple machines but you do want to have something to revert to just in case? Select several target VMs and run the SBA snapshotting all of them at once.

Remember, snapshots are not a backup strategy!

Reconfiguring VM Hardware

Changing hardware resources allocated to a VM is not a hard task in vSphere, but the following real-world procedure can be a bit of a pain, especially if you want to reconfigure several machines:

  1. Check nobody is logged on the machine, or that is running a vital piece of software that cannot be missed during production hours
  2. Power the machine down and wait for it to really power down (depending on your configuration and what you would like to change you could potentially do this without powering down but I would not go there in most cases).
  3. Go through the vSphere interface to set the new hardware configuration.
  4. Turn the machine back on.

Using the next SBA in ControlUp Console will save you a lot of time reconfiguring the amount of vCPUs, memory and HDD size allocated to VMs.

Select your target machine (or multiple targets if you like), right-click and choose Script-based Actions > Reconfigure VM hardware SBA and you can choose the desired virtual hardware settings. The script will power the machine down if required, reconfigure the hardware and power it back up. VMs that were not powered on will just have their hardware reconfigured and left shut down.

Your time spent: 10 seconds. Time the script needs: usually less than 3 minutes, in the case above the reconfiguration process was done in 54 seconds.

So there you have it, some handy VM management at your fingertips in ControlUp Console that is a real time saver. Try the scripts and let us know what you think!

NOTE: Before you can use these scripts make sure you have the VMWare PowerCLI installed on the console. The scripts have been created using version 6.5 Release 1, you can get it here: https://my.vmware.com/web/vmware/details?downloadGroup=PCLI650R1&productId=614

And of course the account you are using to run the scripts has to have the appropriate privileges in vSphere.

About the author

Ton de Vreede

Ton de Vreede has worked in IT over 20 years, 17 of those in the virtualization space. He specializes in end-user computing and RDS environments, and anything to do with virtualization. He joined ControlUp to bring you even better script actions and automation; his personal motto is: spare the admin, automate! Ton’s a PowerShell junkie, loves to work with electronics, and also plays guitar, harmonica, and keyboard (badly).