VMware PowerCLI

Install VMware Pester PowerCLI Configuration Management

Take a look at how we can install VMware Pester PowerCLI configuration management module to establish and maintain a baseline for vSphere

PowerShell can do so many cool things for us not just from an automation standpoint but also from a configuration management standpoint. ย I wanted to help give some visibility to a great bit of PowerShell PowerCLI code called Vester that was authored by Chris Wahlย (open source with many contributors as of today). ย Many know of Chris in the VMware and PowerShell world as he has contributed greatly to many different projects aside from Vester. ย Vester uses PowerCLI and the PowerShell Pester module for configuration management in VMware vSphere environments. ย However, how do we install VMware Pester PowerCLI configuration management? ย Consider our run through below as a summary of sorts.

Install VMware Pester PowerCLI Configuration Management

To get started, let me mention prerequisites. ย You need to have PowerCLI installed of course, and need to be running the latest and greatest – 6.5.1. ย There is a new way to install PowerCLI, so if you haven’t heard about that, you can read our post here on the new process. ย Also, make sure you are running Windows Management Framework 5.1 for the latest PowerShell environment. ย Finally, we need Pester installed. ย To get Pester installed, you can simply run theย install-module commandlet to pull down the module. ย As you can see below, I am using theย -Force parameter as I already had an older version installed, so to allow multiple versions to be installed, you can use the additional -Force parameter.

install-module Pester
install-module Pester -Force (if older version is installed)
install-module Pester -Force -SkipPublisherCheck (skips publisher cert check)

Additionally, I had a catalog publisher error below which was resolved with theย SkipPublisherCheck. ย This may have had to do with the older version I had installed, but I didn’t test this on a clean system so your results may vary.

pester05

After I installed the Pester module, it was on to installing Vester. ย To install Vester, the process is the same. ย Simply use the install-module commandlet.

install-module Vester

pester06

Connect vCenter and Create your JSON file

The first commandlet to run after you have established connectivity to your vCenter server is theย new-vesterconfig commandlet. ย This is the commandlet that creates your JSON file that acts as your baseline configuration template. ย You can also choose to change the scope of any of the default values in your Datacenter as well. ย Here I am simply accepting the defaults.

pester07

After the new-vesterconfig commandlet runs, we get the notice that ourย config.json file is created in theย C:Program FilesWindowsPowerShellModulesVester1.0.1Configsย folder.

pester08

We can take a look at the json file if we wish. ย Below is a snippet of the file that was created for my environment.

pester09

If you want to remediate any changes in the environment, you can use theย invoke-vest -remediate commandlet. ย It is wise here as well to use theย -whatif commandlet to see what changes will be made if we remediate.

pester10

To test changes being picked up, I changed the NTP settings for my host. ย When I ran the invoke-vester -remediate -whatifย commandlet, the changes were picked up and as you can see the -whatif operation was performing theย Set NTP Servers operation.

pester11

After I ran the -remediate without the -whatif parameter, the changes were made, and another run of Vester indeed showed the NTP settings to be in line with the config.json.

pester12

You can also create your own Vester tests as well. ย So the sky is the limit with the configuration management possibilities with this module.PowerPo

Thoughts

Hopefully this short run through of how to install VMware Pester PowerCLI configuration management will shed light on this great FREE tool for configuration management in your vSphere environment. ย This project is constantly changing and being improved upon by those in the community. ย Take a look at Chris Wahl’s post here on Vester for more background on the project. ย Also, you can check out the project on Github.

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.