Updating a new or existing Xenserver with multiple updates, is a time consuming task, as the GUI only allows to install one by one patch, and reboots between every patch. Some of the patches is also included with newer patches, so you may save some time by walking through each one from the newest to find out which one is included.
I found a Xenserver script to download and install on the fly by Sean Flattery: http://forums.citrix.com/thread.jspa?threadID=307074&tstart=0
I’ve modified this script to first download, and then apply them in as separate script. This is because if a patch is already there, the script will fail to install the patch. You need to download all patches and unzip them to a webfolder before running the script. Enter the URL to the webfolder in the script. I’m using a public dropbox folder for this, but then the Xenservers needs to have internet access. You can use this powershell script to download and unzip all kinds of Citrix hotfixes, directly from Citrix support website: http://virtexperience.com/2012/11/30/ctxupdate-a-powershell-script-to-download-any-citrix-updates/
for PATCH in XS61E015 XS61E020 XS61E018 XS61E022 XS61E017 XS61E012 XS61E010
do
wget http://mywebserver/$PATCH.xsupdate
UUID=`xe patch-upload file-name=$PATCH.xsupdate | awk '{print $2}'`
echo "$UUID"
done
You only need to download patches once for each pool. The patch list above is all you need for Xenserver 6.1, to download all 6.02 patches, replace the first line with this:
for PATCH in XS602E006 XS602E010 XS602E019 XS602E021 XS602E023
When download is complete, these patches will now be ready for installation in the Xenserver pool. You may now apply all patches to a specific host and then reboot later. Remember if this is a pool, you need to do this on the master first, and remember to migrate off all workloads from this host manually first. Please replace hostuuid in the script with the UUID of the host you want to patch. User xe host-list to get host UUID
PATCHLIST=`xe patch-list | grep "uuid ( RO) " | awk '{print $5}'`
for UUID in $PATCHLIST
do
echo "Installing patch $UUID"
xe patch-apply host-uuid=(hostuuid) uuid=$UUID
done
When this script is complete, reboot the host and continue on the next host.
