Xesxupdate.pl 1.2
UPDATE2: Version 1.3 is out
UPDATE: This version is out of date. See http://www.jeremypries.com/?p=50
Credit goes to Vincent @ Virtrix for some ideas and some code.
This version works with both file and http based repositories. It might work with https, I haven’t tried yet. I’m not sure if anyone cares about FTP – leave a comment if you do.
I think the most important feature added is order. It will figure out the proper order to install the patches. Official word from VMware is that order does not matter due to the fact that patches are stand-alone. Unfortunately, I don’t know that this is documented publicly. I have also had VMware support tell me that order does matter. I do know that the same RPMs are updated by multiple patches, if you install newest to oldest there will be failures and you will waste time figuring out what happened. So, I apply them oldest to newest to be safe. This tool will order them for you. It uses the date returned by using an esxupdate info command.
Another feature is the ability to compare an ESX host to your repository to see what patches you are missing.
To use the script you need to do the following to prep your environment:
- Copy the script to your ESX host(s) and make sure it is executable (or put it on a shared filesystem)
- Open the script in a text editor and change the user variables for your environment. This is lines 54-72.
- Prepare a repository. See below for details
Usage
usage: ./Xesxupdate.pl [-q] [-c]
-q [optional] – quiet; supress confirmation
-c [optional] – check; Will list patches missing and patches installed. All other optional are ignored and no patches are installed.
./Xesxupdate.pl -h will display this message
If you do not add the -q, it will show what patches need to be installed and ask if you are sure.
Script does not reboot, you should do it after.
Repository
HTTP
IIS - See here for some info on MIME types.
Apache – I didn’t need to do anything special on my Ubuntu server kickstart appliance.
After the web server is configured, you need to designate a spot to hold your patches and extract them here. Now create a file in this patches directory that contains a list of patches. You may name this file whatever you want, but the script’s $patchListFile must match. Order does not matter. The default name is updates.list. Here is a current file for ESX 3.0.1 as of Mar 23 2007
NFS
This is not just for NFS, but any filesystem that you can access from the service console. Designate a directory to hold your patches and extract them here. Now create a file in this patches directory that contains a list of patches. You may name this file whatever you want, but the script’s $patchListFile must match. Order does not matter. The default name is updates.list. Here is a current file for ESX 3.0.1 as of Mar 23 2007
Example listing of my patches directory:
root@kickstart-appliance:/kickstart/ks-oses/esx-301/patches# ls -l
total 84
drwxr-xr-x 3 root root 4096 2006-11-29 11:06 ESX-1006511
drwxr-xr-x 3 201 201 4096 2007-01-03 19:36 ESX-1271657
drwxr-xr-x 3 root root 4096 2006-11-29 09:32 ESX-1410076
drwxr-xr-x 3 201 201 4096 2006-12-27 17:34 ESX-1917602
drwxr-xr-x 3 201 201 4096 2006-12-27 17:29 ESX-2031037
drwxrwxr-x 3 201 201 4096 2006-12-04 19:24 ESX-2066306
drwxr-xr-x 3 201 201 4096 2006-12-27 17:23 ESX-2092658
drwxr-xr-x 3 root root 4096 2007-02-22 18:50 ESX-2158032
drwxrwxr-x 3 201 201 4096 2007-02-27 16:46 ESX-3199476
drwxr-xr-x 3 201 201 4096 2006-12-27 17:17 ESX-3996003
drwxr-xr-x 3 201 201 4096 2007-02-05 15:54 ESX-5031800
drwxr-xr-x 3 201 201 4096 2007-01-02 13:45 ESX-5497987
drwxr-xr-x 3 201 201 4096 2007-02-05 15:45 ESX-5885387
drwxrwxr-x 3 201 201 4096 2007-03-01 13:13 ESX-6050503
drwxr-xr-x 3 201 201 4096 2007-01-22 12:43 ESX-6075798
drwxrwxr-x 3 201 201 4096 2007-03-01 13:25 ESX-6856573
drwxrwxr-x 3 201 201 4096 2006-12-04 19:51 ESX-6921838
drwxrwxr-x 3 201 201 4096 2006-12-04 18:48 ESX-8173580
drwxrwxr-x 3 201 201 4096 2007-02-28 11:46 ESX-9865995
drwxr-xr-x 3 201 201 4096 2006-12-05 13:42 ESX-9986131
-rw-r--r-- 1 root root 240 2007-03-23 16:36 updates.list
One final note. If you prefer a GUI instead, you may be interested in this. After typing this message, I noticed the announcement posted at virtualization.info