Some thing every VMWare admin will end up doing at some point is orpahen file hunting. That fun task of hunting down unused VM disks hopefully before your datastore is out of space. Working for a cloud provider, wasted space is always a problem and RVTools has been my tool of choice for years. RVTools…
Category: PowerShell
Powershell Splatting
This post will explain how to splat in Powershell. Splatting is basically using an array or a hash table as the attributes of a command.As with most things in Powershell, its best demonstrated by an example or two. Example 1 In my day job I have an ESXi build script, part of that is to…
VMWare tasks
Some thing I always send a lot of time doing is looking for old tasks in vCenter. When using the web client or even Powershell you get a list of active tasks and some old ones before they disappear. You can go back through the Event list but sometimes you need to see the tasks….
VM clone script
This is a VM clone/”backup” script that I use in my home lab. I schedule this script to make a clone of important VMs (works with vCenter) and clones them to another datastore. Obveusly this is not a proper backup but if I make a config change or lose a datastore then this will (and…
File deletion scripts
I get asked quite alot at work to monitor folders and delete files older then x days or stop them growing out of control. These folders are normaly FTP backups of things that do not age out. Like config backups (NSX im looking at you). There are a couple of ways to do this. The…
NetApp performance monitoring using Powershell
I recently had to run some monitoring commands to gather information while a backup was running. So I used Powershell. I needed to SSH on to the FAS and run the following: So why should I do that when I can get Powershell to do it. Here is a quick bit of Powershell to SSH…
Snapshot Deletion script
This is a script I wrote to delete snapshots over a certian age wth an override. The override is in the name of the snapshot, so the snapshot can be deleted after x days or after a date. If the snapshot is named “my snapshot _ DeleteAfter60days” the script will look for “DeleteAfter” or “DA”…
Manual unMap
This is a script I put together to manually run the unmap to all shared iSCSI datastores from all hosts in a vCenter. After doing this your SAN should report the correct block usage ie more space! With VMFS 6 this is not really needed but there may be times when you need to know…
Tutorial, Using Credentials
A common problem I have is that the account that runs a powershell script does not have the required rights on a remote computer to do its job. It could be because the remote “thing” only has local accounts or is a windows computer on a different domain. The old way of getting round this…
Report VM reconfigurations
One this that has always bugged me with vCenter UIs is seeing a reconfigure VM task but not being able to tell what was changed. Some times in an investigation this can be very important. While looking at Event objects one day I discovered an attribute called configchanges on a reconfigured event object. In there…