Script for Patching XenServer 6.5

Script for Patching XenServer 6.5

Here’s a little script that you can run at the dom0 console to automate loading patches on a fresh installation of XenServer 6.5 up to patch XS65E005. If they add more patches, just add more lines referencing the new patch name (e.g. XS65E006, etc) starting with the “wget command and ending with the “rm -f .xsupdate” command.

#!/bin/bash

wget http://downloadns.citrix.com.edgesuite.net/akdlm/10194/XS65E001.zip

unzip XS65E001.zip

xe patch-apply uuid=`xe patch-upload file-name=XS65E001.xsupdate 2>&1|tail -1|awk -F” ” ‘{print $NF}’` host-uuid=`grep -B1 -f /etc/hostname <(xe host-list)|head -n1|awk ‘{print $NF}’`

rm -f *.zip

rm -f *.xsupdate

wget http://downloadns.citrix.com.edgesuite.net/akdlm/10195/XS65E002.zip

unzip XS65E002.zip

xe patch-apply uuid=`xe patch-upload file-name=XS65E002.xsupdate 2>&1|tail -1|awk -F” ” ‘{print $NF}’` host-uuid=`grep -B1 -f /etc/hostname <(xe host-list)|head -n1|awk ‘{print $NF}’`

rm -f *.zip

rm -f *.xsupdate

wget http://downloadns.citrix.com.edgesuite.net/akdlm/10196/XS65E003.zip

unzip XS65E003.zip

xe patch-apply uuid=`xe patch-upload file-name=XS65E003.xsupdate 2>&1|tail -1|awk -F” ” ‘{print $NF}’` host-uuid=`grep -B1 -f /etc/hostname <(xe host-list)|head -n1|awk ‘{print $NF}’`

rm -f *.zip

rm -f *.xsupdate

wget http://downloadns.citrix.com.edgesuite.net/akdlm/10201/XS65E005.zip

unzip XS65E005.zip

xe patch-apply uuid=`xe patch-upload file-name=XS65E005.xsupdate 2>&1|tail -1|awk -F” ” ‘{print $NF}’` host-uuid=`grep -B1 -f /etc/hostname <(xe host-list)|head -n1|awk ‘{print $NF}’`

rm -f *.zip

rm -f *.xsupdate

Changing IP Addresses on a XenServer 6.5 Pool

Changing IP Addresses on a XenServer 6.5 Pool

To change the ip addresses on a XenServer 6.5 pool, start with the slaves, and use the following xe commands:

Remember: Slaves first, then the Master

NOTE: There is no need to change the IP from the Management Console.

Find the UUID of the Host Management PIF:

xe pif-list params=uuid,host-name-label,device,management

You will see a big list. Find the UUID for the slave that you’re working on. Use the “more” pipe if the UUID for your particular slave scrolls off the screen:

xe pif-list params=uuid,host-name-label,device,management | more

Change the IP Address on the first slave:

xe pif-reconfigure-ip uuid=<UUID of host management PIF> IP=<New IP> gateway=<GatewayIP> netmask=<Subnet Mask> DNS=<DNS Lookup IPs> mode=<dhcp,none,static>

Then:

xe-toolstack-restart

Verify the new address with ifconfig, and/or ping it from a workstation.

Point the slave to the new Master IP Address:

xe pool-emergency-reset-master master-address=NEW_IP_OF_THE_MASTER

Repeat the commands above on all slaves.

On the Master:

xe pif-list params=uuid,host-name-label,device,management

xe pif-reconfigure-ip uuid=<UUID of host management PIF> IP=<New IP> gateway=<GatewayIP> netmask=<Subnet Mask> DNS=<DNS Lookup IPs> mode=<dhcp,none,static>

xe-toolstack-restart

DO NOT run the emergency-reset-master command on the Master.

Reboot the Master, then reboot the Slaves and verify that they can find the Master.

Matt Long

04/06/2015

Call Now Button(208) 344-1115

SIGN UP TO
GET OUR 
FREE
 APP BLUEPRINT

Join our email list

and get your free whitepaper