Merge "Add manual ovs upgrade script for workaround ovs upgrade issue"

This commit is contained in:
Jenkins 2017-04-06 10:35:52 +00:00 committed by Gerrit Code Review
commit 4fb4cc780d
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.
@ -82,3 +85,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.
@ -70,16 +74,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.