2009-11-11

Patching your ESXi Host – Without vCenter

VMware Update Manager is the Enterprise tool for Patching your ESX Hosts and for some also the tool used to patch your Windows / Linux Guests as well.

This is all fine and dandy, but what is you do not have all of your ESXi hosts connected to your vCenter?

Why would you so that – you may ask? Well in my environment, we have several labs that are running their Environment on a ESXi Whitebox,with the free ESXi License. No vCenter, and central management is not that easy.

Now you could update all of these hosts with the VMware infrastructure Update Client and I showed in a previous post – how you can upgrade from ESX3i to ESX4i with this tool. To update the patches is more or less the same.

Today I was asked to automate this process for a number of ESX3i hosts that were all at
build 123629 (ESX3i U2) and update them to build 199239 (ESX3i U4).

I did this with the GUI client, but it was too cumbersome, so I looked for another method.

I downloaded the package from VMware. This contents of the zip file are below.

image

As you can see the contents of this bundle contain 3 separate Updates.

(The three ESXi patches for Firmware "I", VMware Tools "T," and the VI Client "C" are contained in a single offline "O" download file.)

After Unpacking the 3 patches I was left with this:

image 

In each folder there is an exe file:

image

The Command Syntax:

C:\ESXe350-200910402-T-BG>remoteInstall.exe

Allowed options:
  -? [ --help ]         Display program usage

  -h [ --host ] arg     ESX host name
  -u [ --userName ] arg User name
  -p [ --password ] arg Password

So all you need to do is:

remoteInstall.exe –h <HOSTNAME> –u <USERNAME> –p <PASSWORD>

While the patch is installing the output on the screen is is the progress:

progress: 0
progress: 5
progress: 7
.
.
.
progress: 100

Run this for both 3 patches, reboot your ESXi Host, and you are done

To automate the process I created  a small batch file update.bat (I did not use Powershell – because not all the end-users have Powershell installed – YET!! )

echo off

set host=%1
set user=%2
set password=%3

if "%1" == "" goto error
if "%2" == "" goto error
if "%3" == "" goto error

for /f "tokens=*" %%i in ('dir *. /b') do (
cd %%i
echo Installing patch %%i .....
remoteinstall.exe -h %host% -u %user% -p %password%
cd ..
)
echo Patching Complete !!

:error
echo ==========================================================
echo = Missing command line parameter!
echo ==========================================================
echo =
echo = Command Line Parameters:
echo =         update.bat hostname/ip username password
echo =
echo = Example:
echo =         update.bat 1.1.1.1 root 123456
echo ==========================================================
goto end

:end

 

The script accepts 3 parameters: user host password, for example:

update.bat myesxhost root 123456

Reboot your host – and yep you are upgraded.

And thanks to Dave Mishchenko for the information.