Datastore usage statistics

An interesting question came up in the PowerCLI Community. Can one extract the datastore statistics, that are used for the space utilization graphs in the vSphere Client, with PowerCLI ? The graph in question, which you find in the Datastores Inventory view under the Performance tab, looks something like this.

Continue reading Datastore usage statistics

dvSwitch scripting – Part 9 – Traffic Shaping

Another interesting feature of a dvSwitch is the ability to use bidirectional traffic shaping. Besides the outbound traffic shaping that is available on regular virtual switches, with the dvSwitches we can also have inbound traffic shaping. The traffic shaping is defined with the three known, classical values: average bandwidth, peak and burst size.

Recently there were some threads in the PowerCLI Community that asked how to do this with PowerCLI. Time to add this to our repertoire of PowerCLI dvSwitch functions.

Continue reading dvSwitch scripting – Part 9 – Traffic Shaping

ThinApp Repository Report

When you’re using ThinApp to package your software packages you are bound to end up with a huge repository after some time. Of course you have documented each ThinApp package you made, but sometimes you will need to produce a quick-and-dirty report. Then it’s handy to fire up a PowerShell script, instead of reading through all the packaging documentation.

With the help of the ThinApp SDK it’s quite easy to produce such a report.

Continue reading ThinApp Repository Report

Orphaned files and folders – Spring cleaning

In our PowerCLI book we presented a Delete-Harddisk function in Chapter 7.

One of our readers asked if that function could be used to remove orphaned VMDK files from one or more datastores. Now unfortunately that is not the case since the function we presented in chapter 7 uses the ReconfigVM_Task method to remove the harddisk.

In the PowerCLI Community there are some thread that provide scripts to report on orphaned VMDK files, but most of these are quite old.

So I decided to write a new script that would report on orphaned folders and VMDK files and that would have an option to remove these folders and files.

Continue reading Orphaned files and folders – Spring cleaning

Get the maximum IOPS

A quick post that is triggered by a tweet from @GernotNusshall I saw passing today. He wanted to know how to find the maximum IOPS values over the last 5 minutes for a number of VMs. The IOPS values are readily available from the vSphere statistics but the problem is that the values are returned as summation values over the measuring interval and that you have a read and a write value.

An ideal job for PowerShell to get the values Gernot was after.

Continue reading Get the maximum IOPS

Hitchhiker’s Guide to Get-EsxTop – Part 2 – The wrapper

In an earlier post, see Hitchhiker’s Guide to Get-EsxTop – Part 1, I described my first experiences with the new Get-EsxTop cmdlet. While the use of the cmdlet is rather straightforward, the data it returns is not so easy to interprete. Luckily Carter intercepted a secret cable that allows us to actually use the data returned by the cmdlet.

The following is my first attempt to write a wrapper around the Get-EsxTop cmdlet. The idea is to have a script that produces statistical data similar to what resxtop produces.

Continue reading Hitchhiker’s Guide to Get-EsxTop – Part 2 – The wrapper

Virtual Machine logging

I recently received an interesting question in my mailbox. Someone wanted to know if it was possible to enable/disable the logging for a Virtual Machine through PowerCLI. These Virtual Machine logs can be a handy resource when analysing problems.
This logging option is available through the vSphere client when you select Edit Settings and then Options-Advanced-General. In that form there is a checkbox that allows you to enable/disable the virtual machine logging.

Afaik, this feature is not yet available through a PowerCLI cmdlet. But it is easily accessible through the VirtualMachine object.

Continue reading Virtual Machine logging

PowerCLI Book Update 2

What started of as a very hazy concept about a year ago, now became something very concrete.
Our PowerCLI book will be released from the Sybex warehouses on March 28th.

About a week later you should see it appearing in a store near you ;-).

We set up a dedicated website  at https://powerclibook.com.

For now that site is read-only, but we will open up the forum soon, so you will be able to leave comments and ask questions concerning the book.

Small hint, on that site you will also find a number of links to pre-order the book!