How to remove pending updates in Citrix XenServer

A few weeks ago I accidentally attempted to apply a XenServer hotfix intended for XenServer 6.2 to a host running XenServer 6.5. Ever since this accidental mistake, XenCenter has been reporting that there is a new update to apply, which should not be the case. At first I thought it would go away after the next reboot or after the next hotfix had been applied and fix itself up, however this did not happen, here is how to fix it.

Applying an incorrect update

When you apply an update that is meant for a different version of XenServer you should receive a warning similar to the one below.

[root@xenserver ~]# xe patch-upload file-name=XS62ESP1027.xsupdate
06b86256-274d-444e-aa08-a635717e68d1
[root@xenserver ~]# xe patch-pool-apply uuid=06b86256-274d-444e-aa08-a635717e68d1
The patch precheck stage failed: the server is of an incorrect version.
patch: 06b86256-274d-444e-aa08-a635717e68d1 (XS62ESP1027)
found_version: 6.5.0
required_version: ^6\.2\.0$

As shown it does allow us to successfully upload the patch, however when you try to actually apply it to XenServer nodes in the pool it fails with the version check error.

At this point the patch is still uploaded and XenServer nodes within the pool will show as below through XenCenter.

XenCenter update not applied

The update that failed to apply is still listed as being not applied as it’s uploaded and still present, this is what we are going to fix.

Remove the pending update

Removing the update is actually quite simple using the command line on any XenServer node within the pool.

First you need to identify the UUID of the patch, if you uploaded it recently and still have the UUID you can use that, otherwise run the ‘xe patch-list’ command which will output all patches. You can grep for the patch using -B1 which will display the UUID.

[root@xenserver ~]# xe patch-list | grep -B1 XS62ESP1027
uuid ( RO)                    : 06b86256-274d-444e-aa08-a635717e68d1
              name-label ( RO): XS62ESP1027

With the UUID of the patch in question we can use the ‘xe patch-destroy’ command as shown below to remove the patch.

root@xenserver ~]# xe patch-destroy uuid=06b86256-274d-444e-aa08-a635717e68d1 

As soon as this is completed the patch will no longer be present on any XenServer node within the pool and XenCenter will no longer list it as an update that has not yet been applied.

Conclusion

When an incorrect patch has been uploaded it will appear as not having yet been applied, which may be true if the patch is for an incorrect version of XenServer as we have seen here. Once we confirm the UUID of the patch with ‘xe patch-list’, we can run the ‘xe patch-destroy’ command to delete the patch if it is not required.

  1. Thanks! That’s been bugging me for months (I’d updated to 6.5 after having uploaded some patches for 6.0, and there were still two 6.0 updates which hadn’t applied remaining in “nag mode”). Things look much cleaner now.

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>