Add manual ovs upgrade script for workaround ovs upgrade issue

When we upgrade OVS from 2.5 to 2.6, the postrun package update
restart the services and drop the connectivity
We need to push this manual upgrade script and executed to the
nodes for newton to ocata

The special case is needed for 2.5.0-14 specifically see related
bug for more info (or, older where the postun tries restart).
See related review at [1] for the minor update/manual upgrade.

Related-Bug: 1669714
Depends-On: I3227189691df85f265cf84bd4115d8d4c9f979f3
Co-Authored-By: Sofer Athlan-Guyot <sathlang@redhat.com>

[1] https://review.openstack.org/#/c/450607/

Change-Id: If998704b3c4199bbae8a1d068c31a71763f5c8a2
This commit is contained in:
Mathieu Bultel 2017-02-15 16:36:17 +01:00 committed by Marios Andreou
parent 8716d9f769
commit d2d319ec0e
5 changed files with 112 additions and 26 deletions

View File

@ -82,6 +82,9 @@ resources:
DefaultPasswords: {get_param: DefaultPasswords}
EndpointMap: {get_param: EndpointMap}
OpenVswitchUpgrade:
type: ./openvswitch-upgrade.yaml
outputs:
role_data:
description: Role data for the Neutron OVS agent service.
@ -121,16 +124,22 @@ outputs:
step_config: |
include ::tripleo::profile::base::neutron::ovs
upgrade_tasks:
- name: Check if neutron_ovs_agent is deployed
command: systemctl is-enabled neutron-openvswitch-agent
tags: common
ignore_errors: True
register: neutron_ovs_agent_enabled
- name: "PreUpgrade step0,validation: Check service neutron-openvswitch-agent is running"
shell: /usr/bin/systemctl show 'neutron-openvswitch-agent' --property ActiveState | grep '\bactive\b'
when: neutron_ovs_agent_enabled.rc == 0
tags: step0,validation
- name: Stop neutron_ovs_agent service
tags: step1
when: neutron_ovs_agent_enabled.rc == 0
service: name=neutron-openvswitch-agent state=stopped
yaql:
expression: $.data.ovs_upgrade + $.data.neutron_ovs_upgrade
data:
ovs_upgrade:
get_attr: [OpenVswitchUpgrade, role_data, upgrade_tasks]
neutron_ovs_upgrade:
- name: Check if neutron_ovs_agent is deployed
command: systemctl is-enabled neutron-openvswitch-agent
tags: common
ignore_errors: True
register: neutron_ovs_agent_enabled
- name: "PreUpgrade step0,validation: Check service neutron-openvswitch-agent is running"
shell: /usr/bin/systemctl show 'neutron-openvswitch-agent' --property ActiveState | grep '\bactive\b'
when: neutron_ovs_agent_enabled.rc == 0
tags: step0,validation
- name: Stop neutron_ovs_agent service
tags: step1
when: neutron_ovs_agent_enabled.rc == 0
service: name=neutron-openvswitch-agent state=stopped

View File

@ -62,6 +62,9 @@ resources:
DefaultPasswords: {get_param: DefaultPasswords}
EndpointMap: {get_param: EndpointMap}
OpenVswitchUpgrade:
type: ./openvswitch-upgrade.yaml
outputs:
role_data:
description: Role data for the Neutron OVS DPDK Agent service.
@ -79,3 +82,5 @@ outputs:
vswitch::dpdk::socket_mem: {get_param: NeutronDpdkSocketMemory}
vswitch::dpdk::driver_type: {get_param: NeutronDpdkDriverType}
step_config: {get_attr: [NeutronOvsAgent, role_data, step_config]}
upgrade_tasks:
get_attr: [OpenVswitchUpgrade, role_data, upgrade_tasks]

View File

@ -48,6 +48,10 @@ parameters:
default: {}
type: json
resources:
OpenVswitchUpgrade:
type: ./openvswitch-upgrade.yaml
outputs:
role_data:
description: Role data for the OpenDaylight service.
@ -74,16 +78,22 @@ outputs:
step_config: |
include tripleo::profile::base::neutron::plugins::ovs::opendaylight
upgrade_tasks:
- name: Check if openvswitch is deployed
command: systemctl is-enabled openvswitch
tags: common
ignore_errors: True
register: openvswitch_enabled
- name: "PreUpgrade step0,validation: Check service openvswitch is running"
shell: /usr/bin/systemctl show 'openvswitch' --property ActiveState | grep '\bactive\b'
when: openvswitch_enabled.rc == 0
tags: step0,validation
- name: Stop openvswitch service
tags: step1
when: openvswitch_enabled.rc == 0
service: name=openvswitch state=stopped
yaql:
expression: $.data.ovs_upgrade + $.data.opendaylight_upgrade
data:
ovs_upgrade:
get_attr: [OpenVswitchUpgrade, role_data, upgrade_tasks]
opendaylight_upgrade:
- name: Check if openvswitch is deployed
command: systemctl is-enabled openvswitch
tags: common
ignore_errors: True
register: openvswitch_enabled
- name: "PreUpgrade step0,validation: Check service openvswitch is running"
shell: /usr/bin/systemctl show 'openvswitch' --property ActiveState | grep '\bactive\b'
when: openvswitch_enabled.rc == 0
tags: step0,validation
- name: Stop openvswitch service
tags: step1
when: openvswitch_enabled.rc == 0
service: name=openvswitch state=stopped

View File

@ -0,0 +1,50 @@
heat_template_version: ocata
description: >
Openvswitch package special handling for upgrade.
outputs:
role_data:
description: Upgrade task for special handling of Openvswitch (OVS) upgrade.
value:
service_name: openvswitch_upgrade
upgrade_tasks:
- name: Check openvswitch version.
tags: step2
register: ovs_version
ignore_errors: true
shell: rpm -qa | awk -F- '/^openvswitch-2/{print $2 "-" $3}'
- name: Check openvswitch packaging.
tags: step2
shell: rpm -q --scripts openvswitch | awk '/postuninstall/,/*/' | grep -q "systemctl.*try-restart"
register: ovs_packaging_issue
ignore_errors: true
- block:
- name: "Ensure empty directory: emptying."
file:
state: absent
path: /root/OVS_UPGRADE
- name: "Ensure empty directory: creating."
file:
state: directory
path: /root/OVS_UPGRADE
owner: root
group: root
mode: 0750
- name: Download OVS packages.
command: yumdownloader --destdir /root/OVS_UPGRADE --resolve openvswitch
- name: Get rpm list for manual upgrade of OVS.
shell: ls -1 /root/OVS_UPGRADE/*.rpm
register: ovs_list_of_rpms
- name: Manual upgrade of OVS
shell: |
rpm -U --test {{item}} 2>&1 | grep "already installed" || \
rpm -U --replacepkgs --notriggerun --nopostun {{item}};
args:
chdir: /root/OVS_UPGRADE
with_items:
- "{{ovs_list_of_rpms.stdout_lines}}"
tags: step2
when: "'2.5.0-14' in '{{ovs_version.stdout}}'
or
ovs_packaging_issue|succeeded"

View File

@ -0,0 +1,12 @@
---
issues:
- During the ovs upgrade for 2.5 to 2.6 we need to workaround the classic
yum update command by handling the upgrade of the package separately to not
loose the IPs and the connectivity on the nodes. The workaround is
discussed here https://bugs.launchpad.net/tripleo/+bug/1669714
upgrade:
- The upgrade from openvswitch 2.5 to 2.6 is handled gracefully and there should
be no user impact in particular no restart of the openvswitch service. For more
information please see the related bug above which also links the relevant code reviews.
The workaround (transparent to the user/doesn't require any input) is to download the OVS
package and install with --nopostun and --notriggerun options provided by the rpm binary.