You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 23 Next »

Introduction

Purpose

Currently if an admin wants to update the hosts connected to Cloudstack. he needs to search the released updates from a given source URL and check the updates as per the applicable XenServer version. Then admin needs to compare them with the already applied patches to find out the available updates. To reduce this effort we are adding this feature to Cloudstack.

This feature will list the available patches/hotfixes for hypervisors connected to Cloudstack and the Cloudstack admin will be able to see the available updates on Cloudstack UI, this is functional specification of feature "XS alert hotfix notification" which has Jira ID CLOUDSTACK-192

References

Feature Specifications

  • Requirements
    • Search available updates released for applicable XenServer versions and display them on CloudStack dashboard so that admin can see the available updates and apply them manually.
  • Non-requirements
    • Cloudstack will only list the available updates and it is not responsible for applying the updates on the host.
  • Test guidelines
    • Functional test
  • Configuration
    • There are two global configuration parameters:
      • xen.update.url - URL to get latest Xenserver Updates. Default value for it is http://updates.xensource.com/XenServer/updates.xml;
      • update.check.interval (in sec) - How frequently should CloudStack check for Xenserver Updates. By default CloudStack will check for new updates once a week.
  • User permission
    • Root-Admin would have privilege to list the available updates.

Use Cases

*Admin can check the updates available to any host and install them manually.

*Admin can decide on how frequently he wants Cloudstack to check for updates and set the interval by changing the global config parameter update.check.interval .

Architecture and Design description

Search for Host Updates

At regular intervals, update.check.interval, management server will look for all available updates for a Hypervisior. For Xenserver, it'll downloads the latest update information from http://updates.xensource.com/XenServer/updates.xml. The location is configurable through xen.update.url in global configuration.

  • Search the released patches for applicable XenServer version.
  • Fetch the information about the already applied patches from the agent.
  • Compare the list of available patches with the list of already applied patches.
  • Prepare a list of patches that are not yet applied.
  • Fill/update the patch details into host_updates table.
  • Make a corresponding entry into host_updates_ref table.

Admin can change the time interval to check the updates by changing the value of update.check.interval global config parameter(by default interval is set to check for updates once a week).

List Host Updates

DB Schema changes

New tables

  • host_updates (id, uuid, label, description, label, url, timestamp) :  This table contains the details about the patches for different XenServers versions.

    Field

    Type

    NULL

    Key

    Default

    Extra

    id

    bigint(20) unsigned

    NO

    PRI

    NULL

    auto_increment

    uuid

    varchar(40)

    NO

     

    NULL

     

    description

    varchar(999)

    YES

     

    NULL

     

    label

    varchar(40)

    YES

     

    NULL

     

    timestamp

    timestamp

    YES

     

    NULL

     

    url

    varchar(999)

    YES

     

    NULL

     

  • host_updates_ref (id, host_id,patch_id, update_applied) : This table maps the hosts from host table with the applicable patches from host_updates table.

    Field

    Type

    NULL

    Key

    Default

    Extra

    id

    bigint(20) unsigned

    NO

    PRI

    NULL

    auto_increment

    host_id

    bigint(20) unsigned

    NO

    MUL

    NULL

     

    patch_id

    bigint(20) unsigned

    NO

     

    NULL

     

    update_applied

    tinyint(1)

    NO

     

    0

     

New client APIs

ApiName

Request parameters

Response parameters

Available to regular user

listHostUpdates

  • id
  • hostid (required)
  • applied
  • id
  • update Label
  • description
  • update URL
  • timestamp
  • isApplied

No

In the above mentioned API, only hostid is required parameter and the other parameters (id and applied) are optional. If admin wants to list all the patches that are not yet applied to a host, set the applied parameter as false and if admin wants to list the applied ones, set the applied parameter as true. If applied parameter is not passed with the API, it will return the list of all applied and not applied patches. To get the details about the single patch, admin need to pass the id (uuid)* *of the patch.

New classes for client APIs

  • ListHostUpdatesCmd.java
  • HostUpdatesResponse.java

New objects interfaces:

  • HostUpdatesRef.java

New VO and Dao objects:

  • HostUpdatesDao.java
  • HostUpdatesDaoImpl.java
  • HostUpdatesVO.java
  • HostUpdatesRefDao.java
  • HostUpdatesRefDaoImpl.java
  • HostUpdatesRefVO.java

New managers interfaces and implementation:

  • HostUpdatesManager.java
  • HostUpdatesManagerImpl.java

Changes to Existing Files:

  • Add a new method "searchForHostUpdates" in ManagementService.java and implemented in ManagementServerImpl.java
  • Add a new method* in CitrixResourceBase.java to get the information about the applied patches to a host using XAPI *calls.
  • Add a call in ResourceManagerImpl.java to delete the update entries from patch_host_ref table only if admin removes the associated host.
  • Add new call createHostUpdateResponse in interface ResponseGenerator.java *and implemented it in *ApiResponseHelper.java .
  • Add a new component HostUpdatesManager.

New Agent APIs:

  • hostUpdatesCommand.java
  • hostUpdatesAnswer.java

Logging and Debugging

All logs will go to management-server.log

Current limitations

  • Initial implementation will be there only for Xenserver hypervisor. Going forward, this feature can be made available for other hypervisors.

UI flow

This is the mockup UI, will modify it as per the suggestions.

Step 1: Navigate to the detailView page of a host, there you will find a new tab "Updates".

Step 2: Click on* "Updates"* tab to get a list of updates for this host.

  • No labels