Managing VMware vSphere cluster configuration with the vSphere Client can be, sometimes, a tedious task. In this post I’ll show you how to use PowerCLI to manage your cluster’s configuration. I did not pretend to write a full detailed guide but just to show the most common tasks I perform at work.
The first thing to do is to properly setup the basics that will allow us to interact with the cluster. First get your cluster basic configuration and store it in a variable, $cldl380 in the example.
Use the cmdlet to Get-View to get the .Net objects of the cluster and store the result in another variable.
This variable is the base we are going to use to get the cluster configuration, now we are going to use it.
Get the cluster resources summary
Get VMware HA configuration
Get cluster advanced options
Get DRS basic configuration
Get Virtual Port Groups of the cluster
Get the Datastores configured in the cluster
Finally to ease things at work I created a bunch of scripts that implement some of the above tasks, here it is an example. The syntax I used for all of them is [script-name] <cluster-name>.
From this point I’ll leave to you to investigate all the possibilities, as always if you know a better way to do it, have any question or want to say anything about the post please comment. I’m also preparing a new post with all my small scripts and hope to publish them next week.