• Twitter

Scenario: Maybe you are a medium size enterprise with 25, 50, or even 100 ESXi hosts and you are really not sure when the best time to upgrade your hosts.  This is always a difficult question to answer based on bug fixes in not only ESXi code but also in VMware Tools code or even new feature sets.  I have personally always found that you postpone until last minute or when absolutely necessary due to the amount of work and effort in upgrading — especially if you have 3rd party plugins installed and working with your VC.

What Now?: Ultimately my suggestion is do not procrastinate based off of the work you believe it will entail.  VMware has proved us with some very nifty tools such as ESXi Builder as blogged about by our very own @virtual_cj here.  Additionally with the support of PowerCLI your options are endless with workflow, logic, and script automation.  A good example of taking some code that you may have already used and updating it to suit your needs can be found in the Reboot Automation script that we walked through before.

Let’s Get To Work!: Using the previous code as a sample and @virtual_cj’s ESXi Builder tutorial we can see that we only need to make a few minor code changes before we are on our way.  Let’s start by taking a look at the “Reboot VMHost and Wait” portion of code as this is the code block that we will want to substitute out and replace with host remidation.

As you can see this code block is useless is and easily replaced with a one line that will transform our script into an ESXi Host upgrading machine.  The one important section to note is the contains function of the where loop.  It is very important to place your baseline that you wish to remediate against your ESXi Hosts there.

There you have it. A PowerCLI VMHost remediating machine that can be ran all via copy and paste.

Closing Thoughts: It’s always hard to make the right decision based on what you need and when you need it regarding your ESXi Hosts; however, you should never let your thought process of when to upgrade be based on the amount of work that must go into your change.  Instead look on the bright side and enjoy some cleaver PowerCLI scripting and let your handy work do all of the mundane tasks that you don’t want too.

About the author

@VirtualizedCJ CJ is a virtualization professional that loves automation -- maybe a little to much.

2 Responses so far.

  1. jre says:

    hey, do you have a twitter?

Leave a Reply to @virtual_cj