ESXi CLIativity – Part 2

01/07/2018

In my previous post, I showed you how to run scripts on the ESXi CLI with minimal intervention. In this episode, I will show you another example, which will also make use of PowerCLI and one of the PuTTY utilities.

The scenario; Now and then servers need all kind of upgrades; BIOS, NIC and HBA firmware to name a few. Hardware vendors usually offer multiple ways and additional tooling to perform those updates. As an example HPE provides packages, called Smart Components which can be installed from the Operating System layer, in the past limited to Windows and some Linux flavours, today also for ESXi.

Smart Components for ESXi come in the form of a .zip file, named CPxxxxxx.zip . The .zip contains an executable called: CPxxxxxx.vmexe, the firmware CPxxxxxx.vmfile, some additional .xml and .json files and a README.txt with installation instructions. Chances are that during an upgrade cycle of a cluster multiple components need a firmware upgrade, it will become clear that this is a time consuming task. So time for some automation!

Read the rest of this entry »


ESXi CLIativity – Part 1

30/05/2018

As I showed in a previous post, it is possible to do pretty awesome actions using the ESXi Shell.

By using VMware PowerCLI and some other tools, you can further extend these possibilities.
In this example we use a Windows workstation and the tool Plink.
Plink comes with the well known PuTTY utility and is a command-line connection tool similar to ssh and very useful for automated operations.

As an example, we use the unmap script from this post, the goal is to minimize manual actions. The first step is to deploy and start the unmap script on a more convenient way, without logon to the ESXi host.

Read the rest of this entry »


Get-ClusterRules

16/06/2017

I recently encountered an interesting question, maybe not the one you will see every day. A vCenter Center server runs a large number of Clusters; the VMs on those clusters are controlled by a considerable number of DRS rules. The question that raised; “How do we know if the DRS rules we once designed are still in place?” In the course of time, rules can be disabled, VM or Host groups does not match any more. Trying to answer this question by going through the vCenter Server configuration is not the way to go.

Thankfully, the VMware PowerCLI contains a useful Cmdlet Get-DrsRule that enables you to create a dump of the configured rules for each cluster. This makes checking your configuration a lot easier.

But there is another thing, now we know about the configuration, but what do we know about the actual situation? For instance, VM to Host affinity has “should” and “must” rules, but to what extent is a “should” rule fulfilled?

So time to create a PowerShell script which performs the following tasks; for each Cluster within a vCenter Server, a dump of the configured DRS rule is made. The second part of the script determines on which host a VM is running and compares it to the configured rules. The script will also report if a DRS rule is disabled and displays the power state of each VM. You will probably worry less about a powered down VM.

The script can be found here on GitHub.

I am aware that the script and my programming skills are far from perfect, so expect updated versions in the future.


Review: Trainsignal VMware vSphere PowerCLI Training

05/07/2011

Recently, Trainsignal presented a new episode in its VMware Training Videos series entitled “VMware vSphere PowerCLI Training”. The training is presented by Mr. Hal Rottenberg, a well known member in the PowerShell and VMware community. He is a vExpert and MVP on Windows PowerShell.


Read the rest of this entry »