Automatically Detecting Available Updates
When developing a product for a platform, one of the most important tasks is to ensure that your product is up to date with respect to the platform patch level. Doing so will help ensure that not only is the platform correctly patched, but also that your product is able to work with those patches. Given the stability of XenServer, it's not uncommon for customers to run XenServer hosts for significant periods of time without patching them, but your product was tested with more current patch levels.
Occasionally there is a bug and a hotfix that is particularly relevant to a particular area of functionality and therefore certain types of products written for XenServer. If you are developing a product for XenServer it can cut out support work and increase customer satisfaction by ensuring customers have applied the best hot-fixes to protect them.
How to Receive Automatic Alerts of HotFix Availability
It's a good idea for developers, customers and vendors to keep up-to-date with new hotfixes and what issues they address. XenServer is commercial supported product available from Citrix and hotfixes are issued via Citrix's support portals. Users wanting notification of new hotfixes should visit http://support.citrix.com/profile/watches/ (ensure they are logged in). The instructions there detail how to sign-up for automatic alerts when HotFixes are released for XenServer by version. Partners may wish to forward such alerts to customers particularly if a hotfix is particularly relevant to the area of functionality exercised by their products.
Programmatically Obtaining Update Information
One strategy we adopt within our own products such as XenCenter is to check whether a custoemrs system has been fully patched programmatically. It's functionality some vendors also incorporate within their products to help ensure customers install relevent updates. It is a technique that can also be used by vendors when their product is installed to ensure users have applied the same patches that a vendor tested with.
The following steps (described in terms of the java API, but you can choose whichever API binding you prefer) should enable an application to notify the user that relevent updates are available. A software vendor might want to provide their own update list to filter the list of identified hot-fixes to those know to be relevant to their product.
To alert a user of all the hotfixes available for their specific version of XenServer, follow these steps:
- Download the XML document from http://updates.xensource.com/XenServer/updates.xml to get the information about the XenServer Versions, details of all the patches available and also to get the list of patches available per XenServer version.
- Fetch the information about the XenServer version of the host by calling the Xenserver java SDK API(Host.getAllRecords) under Host class.
- Fetch the information about the already applied patches by calling the XenServer java SDK API(PoolPatch.getAllRecords) under PoolPatch class.
- Map the XenServer version of the host to the versions listed in the XML document and fetch the corresponding list of available patches.
- Compare this list of available patches with the list of already applied patches.
- Prepare a list of patches that are not yet applied.
- Map these patches with the contents in the XML document to get more detailed information related to the patches like name-description, timestamp, after-apply-guidance etc.