Pass neutron-ovs.yaml environment in upgrade prepare.

If the environmet is deployed in Rocky with OVS then we need to pass
the neutron-ovs.yml environment file for the upgrade prepare and converge
steps to work. Otherwise, as OVN is the Neutron engine by default in
Stein it will try to deploy with OVN and the upgrade will fail.

Also, the containers-prepare-parameter.yaml is shared between the UC
and the OC upgrade. For the case of the UC, there is no possibility to
deploy with ovn, so we force the neutron_driver option (defaulted to ovn
when creating the default containers-prepare-parameter.yaml file) to
openvswitch. However, for the OC, we need to identify if it was deployed
with the OVN service enabled and if so, set the netron_driver to ovn instead.

In summary, we first upgrade from Rocky with OVS to Stein with OVS and
if required, a post-upgrade step to upgrade from OVS to OVN would be
performed. In the case the Rocky deployment was with OVN enabled we
perform a Rocky with OVN to Stein with OVN upgrade.

Change-Id: I21bbf9cda977a1c269e2c1caad4bf88d3f6173b0
This commit is contained in:
Jose Luis Franco Arza 2019-07-10 12:55:06 +02:00
parent 5537b13ea4
commit bb44ee55a3
5 changed files with 43 additions and 2 deletions

View File

@ -12,9 +12,25 @@
failed_when: false
register: pacemaker_present
- name: set deployment_with_ha fact
- name: Check if overcloud deployed with neutron ovn engine
shell: |
source {{ undercloud_rc }}
openstack stack output show {{ overcloud_stack_name }} EnabledServices | grep 'neutron_plugin_ml2_ovn'
failed_when: false
register: neutron_ovn_present
- name: Check if overcloud deployed with neutron ovs engine
shell: |
source {{ undercloud_rc }}
openstack stack output show {{ overcloud_stack_name }} EnabledServices | grep 'neutron_ovs_agent'
failed_when: false
register: neutron_ovs_present
- name: set deployment_with_ha and deployment_with_ovs fact
set_fact:
deployment_with_ha_upstream: "{{ is_upstream.rc == 0 and pacemaker_present.rc == 0 }}"
deployment_with_ovs: "{{ neutron_ovs_present.rc == 0 }}"
deployment_with_ovn: "{{ neutron_ovn_present.rc == 0 }}"
- name: get network-data-file
shell: |

View File

@ -37,7 +37,6 @@
section: DEFAULT
option: container_images_file
value: "{{ working_dir }}/{{ uc_containers_prepare_file }}"
when: custom_uc_containers.stat.exists
- name: get namespaces from {{ uc_containers_prepare_file }}
shell: |
@ -57,6 +56,12 @@
value: "{{ def_namespace }},{{ ceph_namespace }}"
when: defined_container_registry.stdout_lines|length == 0
- name: Set the neutron_driver to openvswitch for the Undercloud
replace:
path: "{{ working_dir }}/{{ uc_containers_prepare_file }}"
regexp: '^(\s*neutron_driver\s*:)(.*)'
replace: '\1 openvswitch'
when: custom_uc_containers.stat.exists
- name: adjust existing container_insecure_registries for undercloud upgrade

View File

@ -3,6 +3,20 @@
include_tasks: ../common/adjust-roles-data.yaml
when: custom_roles_used|bool
- name: check customized {{ uc_containers_prepare_file }} exists
stat:
path: "{{ working_dir }}/{{ uc_containers_prepare_file }}"
register: custom_uc_containers
- name: Set the neutron_driver to ovn for the Overcloud upgrade if deployed with OVN
replace:
path: "{{ working_dir }}/{{ uc_containers_prepare_file }}"
regexp: '^(\s*neutron_driver\s*:)(.*)'
replace: '\1 ovn'
when:
- custom_uc_containers.stat.exists
- deployment_with_ovn
- name: add upgrade init script to upgrade prepare params
set_fact:
upgrade_prepare_extra_params: "{{ upgrade_prepare_extra_params + [upgrade_init_command_dest] }}"

View File

@ -69,6 +69,9 @@ openstack overcloud {% if ffu_overcloud_upgrade %} ffwd-upgrade {% else %} upgra
-e {{working_dir}}/ceph-ansible-env.yaml \
{% endif -%}
{% endif -%}
{% if deployment_with_ovs|default(true)|bool -%}
-e {{ tht_directory }}/environments/services/neutron-ovs.yaml \
{% endif -%}
-e {{ working_dir }}/{{ uc_containers_prepare_file }} \
{% if (not ffu_overcloud_upgrade or roles_data != default_roles_data) %}--roles-file {{ roles_data }}{% endif %} 2>&1

View File

@ -46,6 +46,9 @@ openstack overcloud{% if ffu_overcloud_upgrade %} ffwd-upgrade {% else %} upgrad
{% if use_oooq|default(false)|bool -%}
-e {{ working_dir }}/disable-leapp.yaml \
{% endif -%}
{% if deployment_with_ovs|default(true)|bool -%}
-e {{ tht_directory }}/environments/services/neutron-ovs.yaml \
{% endif -%}
{% if upgrade_prepare_extra_params and upgrade_prepare_extra_params|string -%}
-e {{ upgrade_prepare_extra_params }} \
{% elif upgrade_prepare_extra_params and upgrade_prepare_extra_params|list -%}