Bug 1572786 - [3.9] RFE - Need a way to upgrade OS during upgrade
Summary: [3.9] RFE - Need a way to upgrade OS during upgrade
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cluster Version Operator
Version: 3.9.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 3.9.z
Assignee: Scott Dodson
QA Contact: Gaoyun Pei
URL:
Whiteboard:
: 1493921 (view as bug list)
Depends On: 1559143
Blocks: 1572798
TreeView+ depends on / blocked
 
Reported: 2018-04-27 20:55 UTC by Scott Dodson
Modified: 2018-06-27 18:02 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
You may now define a set of hooks to run arbitrary tasks during the node upgrade process. To implement these hooks set openshift_node_upgrade_pre_hook, openshift_node_upgrade_hook, or openshift_node_upgrade_post_hook to the path of the task file you wish to execute. The openshift_node_upgrade_pre_hook hook is executed after draining the node and before it has been upgraded. The openshift_node_upgrade_hook is executed after the node has been drained and packages updated but before it's marked schedulable again. The openshift_node_upgrade_post_hook hook is executed after the node has been marked schedulable immediately before moving on to other nodes.
Clone Of: 1559143
: 1572798 (view as bug list)
Environment:
Last Closed: 2018-06-27 18:02:09 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:2013 normal SHIPPED_LIVE Important: OpenShift Container Platform 3.9 security, bug fix, and enhancement update 2018-06-27 22:01:43 UTC

Description Scott Dodson 2018-04-27 20:55:57 UTC
+++ This bug was initially created as a clone of Bug #1559143 +++

Description of problem:

Since the upgrade does an in-place upgrade, we would really like to be able to upgrade the base os (operating system, RHEL) while the node is drained and not running.  As it current stands, we need to drain a node 2x during an upgrade to get Openshift and then RHEL upgraded.

If we don't have an option, we'd like to have a hook that we can plug in to and run while openshift node is not running and the node is drained.

--- Additional comment from Scott Dodson on 2018-04-26 14:55:21 EDT ---

For master / 3.10

https://github.com/openshift/openshift-ansible/pull/7743
https://github.com/openshift/openshift-ansible/pull/7736

Comment 1 Scott Dodson 2018-04-27 20:57:31 UTC
community provided backport pr
https://github.com/openshift/openshift-ansible/pull/8095

Should be in openshift-ansible-3.9.27-1 and later

Comment 2 Scott Dodson 2018-05-02 17:56:15 UTC
*** Bug 1493921 has been marked as a duplicate of this bug. ***

Comment 3 Gaoyun Pei 2018-05-07 08:27:58 UTC
Verify this bug with openshift-ansible-3.9.28-1.git.0.4fc2ce4.el7.noarch

With node pre-upgrade hook, we could do OS upgrade after node is unschedulable and drained, also with upgrade hook which would run after node is upgraded and before being schedulable again, we could also finished a server reboot.


Add the hooks definition in ansible inventory  while doing upgrade:

openshift_node_upgrade_pre_hook=/root/workspace/pre_node.yml
openshift_node_upgrade_hook=/root/workspace/node.yml

[root@gpei-preserved ~]# cat /root/workspace/pre_node.yml
---
- name: Note the start of node OS upgrade
  debug:
      msg: "Node OS upgrade of {{ inventory_hostname }} is about to start"

- name: Upgrade the OS
  yum: name=* state=latest

- name: 
  debug:
      msg: "OS upgrade of {{ inventory_hostname }} finished"

[root@gpei-preserved ~]# cat /root/workspace/node.yml
- name: Note the reboot of node
  debug:
      msg: "Node {{ inventory_hostname }} is upgraded, going to be rebooted..."

- name: Restart server
  shell: sleep 2 && shutdown -r now "Ansible updates triggered"
  async: 1
  poll: 0
  become: true
  ignore_errors: true

- name: Waiting for the server to come back
  wait_for_connection:
    delay: 120
    timeout: 300

- name: Ensure that required services are running
  service:
    name: "{{ item }}"
    state: started
    enabled: yes
  with_items:
    - docker
    - atomic-openshift-node.service
    - dnsmasq



Run 3.7 -> 3.9 upgrade, /root/workspace/pre_node.yml and /root/workspace/node.yml were executed on each node successfully. And the whole upgrade is finished.

Comment 5 errata-xmlrpc 2018-06-27 18:02:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:2013


Note You need to log in before you can comment on or make changes to this bug.