Fastest way to patch Xenserver using a script

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:

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:

for PATCH in XS61E015 XS61E020 XS61E018 XS61E022 XS61E017 XS61E012 XS61E010
wget http://mywebserver/$PATCH.xsupdate 
UUID=`xe patch-upload file-name=$PATCH.xsupdate | awk '{print $2}'`
echo "$UUID"

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}'`
echo "Installing patch $UUID"
xe patch-apply host-uuid=(hostuuid) uuid=$UUID

When this script is complete, reboot the host and continue on the next host.


Um comentário sobre “Fastest way to patch Xenserver using a script

Deixe um comentário

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do

Você está comentando utilizando sua conta Sair / Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair / Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair / Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair / Alterar )

Conectando a %s