LUN juggling in vSphere 5

Buried in the massive amount of new features introduced with vSphere 5 there are several new API methods on the HostStorageSystem managed object.

Two of these API methods will allow you to automate the new Attach/Detach LUN feature from the vSphere Client. It concerns the AttachScsiLun and DetachScsiLun methods. Until this new feature is available natively in PowerCLI, you can use the following functions.

Continue reading LUN juggling in vSphere 5

Storage Views – Datastores

In the vCenter Client, since vSphere 4, you can find a Storage Views tab on several of the VI containers. The data in these Storage Views is collected and provided by the vCenter Storage Monitoring plug-in.

Have a look at David Davis‘s post, called Using VMware vSphere Storage Views, for more information on what you can do with the Storage Views.

Some time ago I got a question from Andrew how the Multipathing Status presented in the Storage Views could be detected and reported upon by a PowerCLI script. What looked rather simple at first, turned out to be a bit more difficult than I anticipated.

Continue reading Storage Views – Datastores

PowerCLI at VMworld US

Last year’s sessions by Alan and myself definitely was one of the highlights of my year. And judging by the comments and scores we received, it didn’t go down that badly with the attendees either. So this year we want to “raise the bar”. We have some fantastic sessions planned and hope you will come and see some of the things we have organised.

If I had to use one word to describe our sessions this year it would be “Super”. After you have seen the sessions you will understand why.

So to give you an idea of what we have planned we decided to give you a quick outline of our sessions and also a mention some of the other PowerShell and PowerCLI based sessions at VMworld….

And don’t forget to register in time !

Continue reading PowerCLI at VMworld US

VIProperties in a Module

Judging from the number of hits, the VIProperties page seems to be rather popular.
The number of entries on that page increases nearly on a daily basis.And judging by the list of people who submitted New-VIProperty entries, this particular feature of PowerCLI is in use all over the place.
Recently my co-author of the PowerCLI book, Jonathan Medd, had a brilliant idea.

Why not bundle all the VIProperties in a module ? The user would just have to do an Import-Module, instead of a copy/paste on each of the entries.

So for the 100th post on my blog I decided to bring you the VIProperty module.

Update August 25th 2011: added the use of the PowerCLI 5 Get-VIProperty cmdlet.

Continue reading VIProperties in a Module

VMX Raiders Revisited

This afternoon news of a new (and interesting) blog post from Julian Wood hit the Twitter-verse.

He took part from the logic of my Raiders of the Lost VMX script and used the relatively new VMFilePath parameter of the New-VM cmdlet, to shorten my script considerable. Well done, great job !

But I was intrigued by a remark in Julian’s post. He was obviously not too fond of using MoRefs in a script. But in Julian’s final script I still saw a Get-View cmdlet and the use of the HostDatastoreBrowser. Remembering a remark from one of my co-authors on the PowerCLI book, that the Get-View cmdlet would disappear, once the PowerCLI snapin would be sufficiently evolved, I decided to tackle Julian’s script and give it another simplification treatment and make it more PowerCLI 😀

Continue reading VMX Raiders Revisited

The making of a New-VIProperty called lunID

An interesting question arrived in my mailbox this morning. Robert wanted to know what was the most efficient way to create a new property, called lunID,  for the objects returned by the Get-ScsiLun cmdlet.

The new property had to show the lunID, as it is returned in the LUN column in the vSphere client.

Continue reading The making of a New-VIProperty called lunID

Discover Memory Overallocations

With the vSphere 5 licensing buzz from the past days and the incredibel number of hits on my Query vRAM post, I considered that a script to help you discover your memory overallocations might be useful.

The script uses the metric mem.usage.average to find out what amount of it’s allocated memory a guest is actually using. The script produces a report that will help you to determine which guests would be good candidates to lower their memory allocation.

Continue reading Discover Memory Overallocations

PowerCLI & vSphere statistics – Part 5 – Rollup Types

In my previous posts in this series, I showed how you can use metrics to produce statistical reports.

One aspect of the metrics that we haven’t touched till now is the roll up types for metrics. If we look in the PerfCounterInfo object under the rollupType property, we discover that there are several of roll up types available. The enumeration lists the following: average, latest, minimum, maximum, none and summation.

What do all these types mean, and more importantly how do we handle these in our scripts ?

That is the subject of this episode in the statistics series.

Continue reading PowerCLI & vSphere statistics – Part 5 – Rollup Types

Who acknowledged that alarm ?

Sometimes a solution to a problem is just staring you in the face.
While writing the PowerCLI book, I spent quite a bit of time on how to find which user acknowledged an alarm.
Today Eric “Scoop” Sloof launched the same question on Twitter. While I thought it was not possible, based on my past investigations, I decided to have a second look.

And of course now I found in a matter of minutes what had cost me fruitless hours before.

Continue reading Who acknowledged that alarm ?