Automate SIOC

With vSphere 4.1 came 150+ new features. One of these is called Storage IO Control or SIOC.And it has been a very popular subject in the last weeks. Just a small selection of blog posts on the subject:

The only thing missing was a way to automate everything surrounding SIOC. And so I decided to write a couple of functions to fill that gap.

Continue reading Automate SIOC

Nearly real time monitoring

The VMTN Communities have always been a useful source of inspiration for writing scripts. This week, for example, there was an intriguing question raised in the Onyx Community. The user wanted to know if it was possible to monitor changes in the vSphere environment in real time.

As far as I know there is no API in the vSphere SDK to do real time monitoring. But the EventHistoryCollector can deliver something that I prefer to call nearly real time monitoring. The following script is a very basic function, written primarily to show that this principle of nearly real time monitoring works. The function displays some selected properties of each event it sees.
Continue reading Nearly real time monitoring

Finding Thin disks

Last Sunday there appeared an interesting thread in the VMTN PowerCLI Community where one the questions was how to find all ‘Thin‘ virtual disks without passing via a virtual machine. The reason for this question was that most of the user’s virtual machines in Lab Manager are not registered on the vCenter Server.

My first idea was to use ‘Get-Datastore | Get-Harddisk‘ and then use the Extensiondata property to query the thinProvisioned property. Something like Arne did in his PowerCLI: Virtual Machine Disk (VMDK) info post. But that, unfortunately, doesn’t work since the Extensiondata property is $null in this case.

Continue reading Finding Thin disks

Taking the new Onyx 2.0 for a spin

One of the announcements during VMworld 2010 in San Francisco that perhaps got a bit obscured by the other “big” announcements, was the release of Onyx 2.0. For those of you that hadn’t heard of Project Onyx before, this nifty little tool captures all SOAP traffic that is passed between your vSphere client or PowerCLI session and the vCenter or ESX(i) server to which you are connected.

And that’s not all, the Onyx program will translate the captured SOAP traffic into PowerShell code. This allows you to see which vSphere APIs are used and how parameter objects for these methods are constructed.

Update September 16th 2010: the Onyx Development Team has just released a new build (2.0.3910.32223) that fixes some issues when using Onyx with the PowerCLI client.  Congratulations to the Onyx Development Team for this quick resolution of the problem !

Continue reading Taking the new Onyx 2.0 for a spin

Script vSphere 4.1 AD Authentication

One of the new features that came with vSphere 4.1 was the ability to use Active Directory Authentication on ESX(i) servers for permissions, console access and ssh access.This is a great feature that you will probably want to activate on all your ESX(i) servers.

Unfortunately this new feature is not available in PowerCLI 4.1. That means you can’t set this up in your configuration scripts through a PowerCLI cmdlet. In most such cases you can fall back on one of the SDK APIs to bypass this lack of a cmdlet. But unfortunately the new “managers”, of which HostActiveDirectoryAuthentication is one, are not available in the VMware.Vim assembly either.

Rob raised this in a recent PowerCLI Community thread. Yasen, one of the PowerCLI Dev Team members, provided a bypass. To make this bypass a bit more accessible, I decided to roll it up in a PowerShell function.

Continue reading Script vSphere 4.1 AD Authentication

Create VMFS datastores on “free space” partitions

The New-Datastore cmdlet allows you to easily create VMFS datastores on a free LUN or local disk. But what if you want to create a VMFS datastore on that free partition you have left on a LUN or on a local disk ? These free GBs could come in handy and it’s a shame letting them go to waste. Unfortunately, the New-Datastore cmdlet doesn’t have an option (yet) to handle “free space” partitions.

Exactly such a question was raised by Alasdair in his thread new-datastore on ESX4i Installable local disk in the PowerCLI Community recently.

Continue reading Create VMFS datastores on “free space” partitions

Events – Part 8 – vMotion history

Another idea triggered by a post in the PowerCLI Community. Lars wanted to know where his VMs had been running in the past.

Since vSphere doesn’t maintain any historical data with the guests themselves, we have to fall back on the Tasks and Events to create such a report. The basic algorithm to query the tasks, and their related events, is already published in Events – Part 3 : Auditing VM device changes. But to get a historical record of the servers where your guests have been hosted requires a bit more logic in the script.

Continue reading Events – Part 8 – vMotion history

Script ‘esxupdate -query’

I received an interesting comment on my Events – Part 7 : Working with extended events – Update Manager post from Suresh. He wanted to know if it was possible to create a similar report with the vCenter Update Manager PowerCLI cmdlets as you can get with the esxupdate query command.

Continue reading Script ‘esxupdate -query’

Events – Part 7 : Working with extended events – Update Manager

As I already mentioned in my previous post, Events – Part 6 : Working with extended events – Converter, another
add-on that produces extended events, is the Update Manager.

With the recent introduction of the vCenter Update Manager PowerCLI snapin, it is now fairly easy to automate all aspects of patch and update management in your vSphere environment. And with the help of the extended events produced by Update Manager, you can easily produce reports. This post shows one way of doing this.

Continue reading Events – Part 7 : Working with extended events – Update Manager

Events – Part 6 : Working with extended events – Converter

In a previous post, called Events, Dear Boy, Events – Part 2, I mentioned that some tools/add-ons use a special event type called ExtendedEvent. Two classic examples are the Converter and the Update Manager. If you want to compile a report for any these tools it’s important to understand what is available in the extended events they produce.

If you want to know if there are any other tools/add-ons in your vSphere environment that produce extended events, then you can use the first script from the Events, Dear Boy, Events – Part 2 post to get a complete list of all available extended events.

In this post I’ll show how to use the Converter extended events.

Continue reading Events – Part 6 : Working with extended events – Converter