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

NX/XD flag setting report

Michael asked if it was possible to produce a report that showed the NX/XD flag setting for all the guests.

Piece of cake I thought, but it turned out to be a bit more complex than that. If you don’t set the NX/XD flag (expose or hide) explicitly on the guest, the hyper-visor will use a default that is defined per OS you can have on the guest.

In the end I think I came up with a script that seems to handle all the different possibilities I encountered.

Continue reading NX/XD flag setting report

Debugging function – verbose vpxd logging

Today Steve Jin published a post called How to Enable ESX Server Logs for Troubleshooting. A very useful tip when you are looking for those hard-to-find “features” in your script.

Steve’s tip  reminded me that I have a similar small function in my toolchest to do something similar for the vCenter log.

The function allows you to switch the vCenter log between “warning” and “verbose” on the fly. No need to go into the vCenter client to change the logging option anymore while debugging.

Continue reading Debugging function – verbose vpxd logging

Changing VMware Tools scripts

There was another interesting question on the PowerCLI community. Mike was wondering if it would be possible to change the VMware Tools scripts with a PowerCLI script. As far as I can see there are two options available with the VMware Tools scripts.

  1. You can run the default scripts that are installed on the guests when you install VMware Tools
  2. You can use Custom scripts and you have to specify the path of these scripts to VMware Tools

To use the 2nd option you will need, as William already pointed out, the VIX APIs.

But if you can live with the first option, and reuse the default scripts, the current PowerCLI build has all you need.

Continue reading Changing VMware Tools scripts

We’re writing a book!

Some of you might be interested to know, Alan and Luc are writing a PowerCLI book.

We don’t have many more details at the moment but wanted to let you know, as we are both very excited (and nervous by the amount of work) about this project.

As you know we both live and breathe PowerCLI. And we want to share our knowledge to help others achieve the level of PowerCLI automation we both know is possible.

One thing you can expect from this book is a practical approach with examples galore. We aim to cover most of the common configuration/troubleshooting and reporting areas with easy to understand examples and explanations.
Continue reading We’re writing a book!

Find unused portgroups in a cluster

Triggered by a recent post, see get-virtualportgroup, in the PowerCLI Community, I had a closer look at the Get-VirtualPortgroup cmdlet.

This cmdlet returns a VMware.VimAutomation.Types.Host.VirtualPortGroup object, which contains a very useful property called Ports. In that property it lists all the guests that are connected to a port on the portgroup. That would be the solution to find unused portgroups, I thought. But while the vSphere Client also shows powered off guests that are connected, the Port property returned by the Get-VirtualPortgroup cmdlet doesn’t. 🙁

So the question at hand required a bit more scripting than I originally thought.

Continue reading Find unused portgroups in a cluster

LUN report – datastore, RDM and node visibility

When you are running multi-node vSphere clusters, you probably already had the experience that one or more of your LUNs were not visible on all nodes. Now you can try to find out which LUN is missing on which node the hard way through the vSphere client. Or you can use the force of PowerCLI and run a script that will report all this in a handy spreadsheet.

To make the script as flexible as possible it should be able to handle any n-node cluster. And as you some of you might know, the Export-CSV cmdlet has some problems with variable length rows. Luckily there is a handy solution I already used in my yadr – A vDisk reporter post.

Continue reading LUN report – datastore, RDM and node visibility

UML diagram your VM, vdisks and snapshots

After my yadr – A vdisk reporter post I received an email from Dennis Zimmer, known from VMachine blog and as the IcomaSoft CTO. He pointed me to the yUML website and suggested that I could perhaps use part of the yadr script to produce an UML diagram.

As it happended there were already some PowerShell scripts that used the functionality offered by the yUML website to produce UML diagrams. Have a look for example at Use PowerShell and yUML to Create Diagrams by Doug Finke and Create Database Diagrams with Powershell + yUML by Chad Miller.

As you probably guessed by now I was sold to the idea.

Continue reading UML diagram your VM, vdisks and snapshots

yadr – A vdisk reporter

I know there are already numerous scripts to report on virtual hard disks and most of them without a doubt much better then what I came up with for this post.

The reason I started with this script was a question in the PowerCLI Community from Alan in his Thin Provisioned Disks post. He wanted to know if you could get the provisioned and the allocated disk size for a thin provisioned virtual disk.

Continue reading yadr – A vdisk reporter