Skip to content

Latest commit

 

History

History
174 lines (126 loc) · 7.95 KB

README.md

File metadata and controls

174 lines (126 loc) · 7.95 KB

Software Update Manager (SUM)

Go

The Software Update Manager (SUM) provides ability to update a system. It could be used to perform major or minor updates. The main difference of major and minor updates is whether the update RPM contains the entire ISO contents or not. The SUM framework can be used to perform live update or an offline update (i.e., utilitizing a separate partition). It relies on Plugin Manager & Plugins to drive or replay any required configuration. The SUM architecture & workflow can be found in the following sections.

Table of Contents

Architecture

At a high-level, the SUM architecture is as shown below.

Architecture

  1. User/consumer gets the location of the staging area, and uploads the update package into staging area.

    SUM doesn't provide an upload API. The update package must be uploaded into the staging area by the consuming application/product (using appropriate authentication).

  2. Once the update package is in staging area, it must be first added it into SUM software repository. Adding it into SUM software repository also validates the update package for version compatibility with system. Once it's made available in SUM software repository, it could be listed, installed and/or deleted.
  3. User/consumer can start the installation and monitor it's status to see if it's ready for reboot.
  4. Once the system is ready for reboot, user/consumer can run prereboot operations like set-boot & reboot in to updated version immediately (or choose to do it later).
  5. When user/consumer reboots to updated version, the update will proceed with any post-reboot update actions, and update the status appropriately towards the end of the update operation.

NOTE: SUM is designed to update system locally. The rolling updates in case of cluster, should be handled by the orchestration layer.

Workflow

This section details out the design of the SUM Update Framework.

SUM Update Framework

Plugins

The SUM Framework uses Plugin Manager (PM) to perform several of it's actions, and defines the types of plugins to perform following user actions: install, reboot, rollback and commit in the below sections. The framework also defines certain variables to enable plugins to access following paths:

Environment Variable Description
${PM_LIBRARY} Plugins library path.
${VXAPP_UPGRADE_ROOT} Alternate root volume path for doing offline updates.

Install

Types File extensions Examples
Pre-install update actions .preinstall - Bind mount required file systems inside update volume before installing RPM/ISO, to share configuration that could be used during install step. One could have say mountfs.preinstall plugin to perform the same action.
- Check whether application is stopped.
Install update actions .install VUF install could be used with appropriate arguments to perform either live or offline update.

Reboot

Types File extensions Examples
Pre-reboot config, replay or validations .prereboot Copy config or keys (say ssh-keys) from current root to upgrade volume
Post-reboot config, replay or validations .postreboot Load any container images into docker registery.

NOTE: If an action can be performed before the reboot, then it is recommended to do it in the .prereboot plugin rather than a .postreboot plugin, so that if there are any failures, it can be caught before reboot which helps in avoiding downtime for customers.

Rollback

Types File extensions Examples
Prechecks before starting rollback .rollback-precheck - Check whether node is updated.
- Check whether instances are stopped.
Pre rollback actions .prerollback - Set Grub to boot to old version in case of using offline update approach.
- Revert snapshot.
Rollback actions .rollback - Remove new version container images.

Commit

Types File extensions Examples
Precheck before starting commit .commit-precheck - To check if all nodes in the cluster are updated.
- Check for applications are stopped if cluster upgrade action requires them to be stopped.
Commit actions and cleanup any remnants .commit - Remove previous version container images.
- Perform one time actions that could not be run earlier in install step as they do not support rollback. Examples:
- cluster or storage (disk/fs) protocol upgrade.

NOTE: The rollback plugins are expected to be re-runnable. In case rollback fails, rollback plugins could be executed through Plugin Manager (PM).

  • For usage details of install, rollback and commit, refer to install, rollback and commit documentation.

The update plugins must be deployed into a plugin folder under plugins library path i.e., ${PM_LIBRARY}/<plugin-folder>/. To access this path in plugins, one must use environment variable ${PM_LIBRARY} to access the plugins library location.

Generating Update RPM

An update RPM should be SUM format compliant in order for one to successfully install the update. In order to generate such an RPM, one should use SUM SDK. For more details about SDK, refer to SUM SDK.

Sample Update

A example usage of the framework can be found here: sample-update.

Usage

The following sub-sections detail out the software update manager command tool usage. The default values of some of the optional parameters are as follows:

  • repo: "/system/software/repository/"
  • output_format: "yaml"

Add software to repository

$ ${sum_binary} repo add -filepath=${software_staging_area}/${software_name}
[ -repo=${software_repo} ]

List software

$ ${sum_binary} repo list 
[ -repo=${software_repo} ]
[ -type=${software_type} ]
[ -filename=${software_name} ]

Delete software

$ ${sum_binary} repo remove
-type=${software_type}
-filename=${software_name}
[ -repo=${software_repo} ]
[ -output-file=${output_file} ]
[ -output-format=${output_format} ]

Install ${software_type} RPM

$ ${sum_binary} install
-filename=${software_name}
-type=${software_type}
[ -repo=${software_repo} ]

Commit ${software_type} RPM

$ ${sum_binary} commit
-filename=${software_name}
-type=${software_type}
[ -repo=${software_repo} ]
[ -output-file=${output_file} ]
[ -output-format=${output_format} ]

Rollback ${software_type} RPM

$ ${sum_binary} rollback
-filename=${software_name}
-type=${software_type}
[ -repo=${software_repo} ]
[ -output-file=${output_file} ]
[ -output-format=${output_format} ]