PowerCLI for basic vCenter/ESXi config management

Many admins use Host Profiles, vCM, vCOPS and the like to ensure element compliance within their VI inventory.  While these can be fine solutions, many companies do not have the luxury of owning these products.

In many cases the targeted use of powerCLI commands across your environment can help to keep things in ‘check’ and help you keep on top of some types of config drift.

An example of this could be when you deploy some new hosts into an existing environment and you’d like to ensure they have some Advanced Settings Parameters configured, a common one being to suppress the Cluster warnings when Local &/or Remote Tech Support is enabled (SSH).

Everyone has seen it;

p2  1

Note:Access to the Advanced Parameters used to be made using the ‘get-vmhostadvancedconfiguration’ command, which was deprecated as of 5.1R1. Now the “Get-AdvancedSetting” cmd-let should be used.

In this example, I’m going to query all hosts where the version is 5.5, and return the current value for the UserVars.SuppressShellWarning parameter.

p3

(this is also sorted by hostname)

To refine the output, let’s filter out superflous data and only include the hostname and the actual parameter value whilst also justifying the table output;

p4

As you can see the 2 x hosts I just added do not have the ShellWarnings suppressed (as shown by the 0 value), so let’s fix that;

p6

Done ! , but just to prove it, repeat the query to check;

p7

Looks good.

Another example  would be to ensure all hosts have VAAI support on. (why would you ever have it off on compliant Arrays !? but it can happen)

There are numerous other settings that this can be useful for, such as;

Scratch Drive Location [ScratchConfig.ConfiguredScratchLocation]; Central/Global Syslog server [Syslog.global.logHost]’

But, in general, change Advanced settings after careful consideration, particularly if you are trying to ‘tune’ performance. Ordinarily this is NOT required, can break things and may lead to other problems.

Of course, if you make changes, make them part of your build documentation.

 

Related Post

2 thoughts on “PowerCLI for basic vCenter/ESXi config management

Leave a Reply

Your email address will not be published. Required fields are marked *