Apply Citrix XenServer patches using CLI, why?
We all have used XenCenter to apply patches to xenservers, probably because its easy. But when it comes to apply patches to a single or multiple xenservers running without xenmotion, using xencenter causes a big downtime as xenserver will reboot for every patch.
This is where CLI is handy, you apply all patches & reboot (once) at your convenience.
To apply patch you need to find out HOST UUID
Running commands on XenServer
Step 1 Find HOST UUID
xe host-list uuid ( RO) : 3f10afa2-246b-4da6-b591-a248c7f5d9ca name-label ( RW): xen-server name-description ( RW): Default install of XenServer |
Step 2 Upload Patch
xe patch-upload file-name=XS602E003.xsupdate 26b72ceb-759c-4de3-b007-e2a5fc30a93a |
here 26b72ceb-759c-4de3-b007-e2a5fc30a93a
is command output for the uploaded patch.
Step 3 Apply Patch
xe patch-apply uuid=[Patch UUID from step 2] host-uuid=[HOST-UUID from step1] e.g xe patch-apply uuid=26b72ceb-759c-4de3-b007-e2a5fc30a93a host-uuid=3f10afa2-246b-4da6-b591-a248c7f5d9ca |
You can also use windows client machines used to install XenCenter to run above mentioned commands.
Here 192.168.1.1 is server ip
Find Host UUID
cd C:\Program Files (x86)\Citrix\XenCenter xe.exe -s 192.168.1.1 -u root -pw Xenserver_Passwd host-list uuid ( RO) : 3f10afa2-246b-4da6-b591-a248c7f5d9ca name-label ( RW): xen-server name-description ( RW): Default install of XenServer |
Upload Patch
xe.exe -s 192.168.1.1 -u root -pw Xenserver_Passwd patch-upload file-name=d:\XS602E003.xsupdate The uploaded patch file already exists uuid: 26b72ceb-759c-4de3-b007-e2a5fc30a93a (XS602E003) |
Apply Patch
xe.exe -s 192.168.1.1 -u root -pw Xenserver_Passwd patch-apply uuid=26b72ceb-759c-4de3-b007-e2a5fc30a93a host-uuid=3f10afa2-246b-4da6-b591-a248c7f5d9ca |