docs/doc/source/updates/kubernetes/removing-reboot-required-software-updates.rst
Ron Stone f125a8b892 Remove spurious escapes (r8,dsR8)
This change addresses a long-standing issue in rST documentation imported from XML.
That import process added backslash escapes in front of various characters. The three
most common being '(', ')', and '_'.
These instances are removed.

Signed-off-by: Ron Stone <ronald.stone@windriver.com>
Change-Id: Id43a9337ffcd505ccbdf072d7b29afdb5d2c997e
2023-03-01 11:19:04 +00:00

4.2 KiB

Remove Reboot-Required Software Updates

Updates in the Applied or Partial-Apply states can be removed if necessary, for example, when they trigger undesired or unplanned effects on the cluster.

Rolling back updates is conceptually identical to installing updates. A roll-back operation can be commanded for an update in either the Applied or the Partial-Apply states. As the update is removed, it goes through the following state transitions:

Applied or Partial-Apply to Partial-Remove

An update in the Partial-Remove state indicates that it has been removed from zero or more, but not from all, the applicable hosts.

Use the command sw-patch remove to trigger this transition.

Partial-Remove to Available

Use the command sudo sw-patch host-install-async <hostname> repeatedly targeting each one of the applicable hosts in the cluster. The transition to the Available state is complete when the update is removed from all target hosts. The update remains in the update storage area as if it had just been uploaded.

Note

The command sudo sw-patch host-install-async <hostname> both installs and removes updates as necessary.

The following example describes removing an update that applies only to the controllers. Update removal can be done using the Horizon Web interface as discussed in Install Reboot-Required Software Updates Using Horizon <installing-reboot-required-software-updates-using-horizon>.

  1. Log in as Keystone user admin to the active controller.

  2. Verify the state of the update.

    ~(keystone_admin)]$ sudo sw-patch query Patch ID Patch State ========================= =========== --PATCH_0001 Applied

    In this example the update is listed in the Applied state, but it could alo be in the Partial-Apply state.

  3. Remove the update.

    ~(keystone_admin)]$ sudo sw-patch remove --PATCH_0001 --PATCH_0001 has been removed from the repo

    The update is now in the Partial-Remove state, ready to be removed from the impacted hosts where it was currently installed.

  4. Query the updating status of all hosts in the cluster.

    ~(keystone_admin)]$ sudo sw-patch query-hosts
    
      Hostname      IP Address     Patch Current  Reboot Required  Release  State
    ============  ===============  =============  ===============  =======  =====
    worker-0      192.168.204.179       Yes             No          nn.nn   idle
    worker-1      192.168.204.173       Yes             No          nn.nn   idle
    controller-0  192.168.204.3         No              No          nn.nn   idle
    controller-1  192.168.204.4         No              No          nn.nn   idle
    storage-0     192.168.204.213       Yes             No          nn.nn   idle
    storage-1     192.168.204.181       Yes             No          nn.nn   idle

    In this example, the controllers have updates ready to be removed, and therefore must be rebooted.

  5. Remove all pending-for-removal updates from controller-0.

    1. Swact controller services away from controller-0.

    2. Lock controller-0.

    3. Run the updating (patching) sequence.

      ~(keystone_admin)]$ sudo sw-patch host-install-async controller-0
    4. Unlock controller-0.

  6. Remove all pending-for-removal updates from controller-1.

    1. Swact controller services away from controller-1.

    2. Lock controller-1.

    3. Run the updating sequence.

    4. Unlock controller-1.

      ~(keystone_admin)]$ sudo sw-patch host-install-async controller-1

The cluster is up to date now. All updates have been removed, and the update --PATCH_0001 can be deleted from the storage area if necessary.