For those of us who do not jump around from environment to environment often forget how lucky we are to know the details of our servers intimately. Over time you come to know what to expect and when something is just not right.
For those that were too busy on Tuesday looking at the shiny Apple, VMware released updates for a few of their products including PowerCLI. Following in the footsteps of the vCloud Suite, the latest version of PowerCLI is now 5.8.
Recently I had to grab some general info on a group of VMs in a particular folder within vSphere. Typical stuff like, Guest OS, # vCPUs, RAM, Disk, etc. I looked around my scripts folder as I was sure I had written a small script to accomplish this task previously but came up empty. No problem, I’ll just whip something up I thought. Then my mind starts racing, will the script output to csv? html? Excel? Word? I could include all options (and code) and let the user choose? What parameters will I need and how will I validate them? This script was getting cumbersome already and I hadn’t even thought about the simple info I needed to query. Then it dawned on me…all I needed was the data. I decided to strip the function down to simply gathering the information I needed. If I wrote a proper advanced function, then I could just return the gathered objects down the pipeline and from there format the output as needed.
Simply put, an advanced function acts very much like a standard cmdlet.
Early in my journey to learn PowerShell, I came across a hurdle that many people do when learning something new – how can I use it? What can it do for me? I stumbled on this for a while. I needed something that I could do to practice and help realize just what is possible with PowerShell.
I’ve gotten some great feedback from my original PowerShell/PowerCLI script to deploy multiple VMs asynchronously via a CSV file found here. I decided a minor update was needed to employ these new ideas along with a few I had myself.
One of those ideas was to require the usage of the new PowerCLI 5.5 R2 features which allows the script to run without the need for a 32bit PowerShell console.
- Cleaned up code / Minor bug fixes
- Added CSV field descriptions to notes section
- Removed requirement for 32bit PowerShell
- Added requirement for PowerCLI 5.5 R2 or later
- Added Boot parameter to determine whether or not to power on new VMs
- Added OS Customization Spec to CSV (previously was hard coded in user variables)
- Fixed logic for vSS vs vDS – Added parameter to CSV
- Added ability to use DHCP instead of just static IPs
- Renamed a few CSV fields to better describe parameter
- Added progress bar to indicate status
As a VMware admin there are a plethora of tools to assist you in gaining visibility into your virtual environment. I’ve seen folks layer on three or four tools at a time in an attempt at getting the best insight into what is going on under the virtual covers. Some of these tools excel in different areas though I have rarely found one that fits all needs. Almost all will have some sort of alerting capability to let you know when something has gone south and many of these products cost in the tens of thousands of dollars.
If there was one tool that was an absolute must have for me – vCheck – hands down.
And the best part? It’s free!
Now, vCheck is not going to replace all those shiny, expensive tools but for a single report that gives you an overview of what you are walking into in the morning, it can not be beat.