From e07c5580672005a4ff7e18ad845256544bd1e291 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Tue, 4 Sep 2018 16:31:32 +0100 Subject: [PATCH 01/38] Begin to add playbook to support fast forward upgrades of OSP --- .../step2-install-undercloud/osp10/tasks.yaml | 2 + ...step4-update-undercloud-and-overcloud.yaml | 6 ++ .../osp10/tasks.yaml | 74 +++++++++++++++++++ .../osp13/tasks.yaml | 0 ...tep5-upgrade-undercloud-and-overcloud.yaml | 6 ++ .../osp10_osp13/tasks.yaml | 0 6 files changed, 88 insertions(+) create mode 100644 installer/step4-update-undercloud-and-overcloud.yaml create mode 100644 installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml create mode 100644 installer/step4-update-undercloud-and-overcloud/osp13/tasks.yaml create mode 100644 installer/step5-upgrade-undercloud-and-overcloud.yaml create mode 100644 installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml diff --git a/installer/step2-install-undercloud/osp10/tasks.yaml b/installer/step2-install-undercloud/osp10/tasks.yaml index f1f7753..a8d9268 100644 --- a/installer/step2-install-undercloud/osp10/tasks.yaml +++ b/installer/step2-install-undercloud/osp10/tasks.yaml @@ -233,3 +233,5 @@ ip addr | grep -q {{ overcloud_director_ip }} || ip addr add {{ overcloud_director_ip }} dev usernet become: true + +# TODO(sambetts) Persist the network changes from above so they survive reboot diff --git a/installer/step4-update-undercloud-and-overcloud.yaml b/installer/step4-update-undercloud-and-overcloud.yaml new file mode 100644 index 0000000..e75b109 --- /dev/null +++ b/installer/step4-update-undercloud-and-overcloud.yaml @@ -0,0 +1,6 @@ +--- +- hosts: director + vars: + ansible_user: stack + tasks: + - include_tasks: "step4-update-undercloud-and-overcloud/{{ dci_topic | lower }}/tasks.yaml" diff --git a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml new file mode 100644 index 0000000..435c515 --- /dev/null +++ b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml @@ -0,0 +1,74 @@ +--- + +- hosts: director + tasks: + # 2.4. UPDATING THE CURRENT OVERCLOUD IMAGES FOR OPENSTACK + # PLATFORM 10.Z + + - name: Stop the main OpenStack Platform services + systemd: + state: stopped + name: "{{ item }}" + with_items: + - 'openstack-*' + - 'neutron-*' + - httpd + become: true + + - name: Update the python-tripleoclient package and its dependencies + yum: + name: python-tripleoclient + state: latest + become: true + + - name: Run the undercloud upgrade + shell: openstack undercloud upgrade + + - name: Reboot director to pick up updates + shell: "sleep 5 && reboot" + async: 1 + poll: 0 + become: true + + - name: Wait for director to finish rebooting + wait_for_connection: + connect_timeout: 20 + sleep: 5 + delay: 20 + timeout: 600 + + # 2.5. UPDATING THE CURRENT OVERCLOUD IMAGES FOR OPENSTACK + # PLATFORM 10.Z + + - name: Unpack the overcloud images into stack + unarchive: + remote_src: true + src: "{{ item }}" + dest: /home/stack/images + with_items: + - /usr/share/rhosp-director-images/overcloud-full-latest-10.0.tar + - /usr/share/rhosp-director-images/ironic-python-agent-latest-10.0.tar + + - name: Import the latest images into the director and configure nodes to use the new images + shell: | + source /home/stack/stackrc + openstack overcloud image upload --update-existing --image-path /home/stack/images/ + openstack overcloud node configure $(openstack baremetal node list -c UUID -f csv --quote none | sed "1d" | paste -s -d " ") + + # 2.6. UPDATING THE CURRENT OVERCLOUD PACKAGES FOR + # OPENSTACK PLATFORM 10.Z + + - name: Update the current plan using your original openstack overcloud deploy command + shell: | + source /home/stack/stackrc + openstack overcloud deploy --update-plan-only --templates \ + -e /home/stack/environments/overcloud-config.yaml \ + -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ + -e /usr/share/openstack-tripleo-heat-templates/environments/net-single-nic-with-vlans.yaml \ + -e /home/stack/environments/networking-cisco-config.yaml \ + --ntp-server 1.ntp.esl.cisco.com + + - name: Perform a package update on all overcloud nodes + shell: | + source /home/stack/stackrc + openstack overcloud update stack -i overcloud diff --git a/installer/step4-update-undercloud-and-overcloud/osp13/tasks.yaml b/installer/step4-update-undercloud-and-overcloud/osp13/tasks.yaml new file mode 100644 index 0000000..e69de29 diff --git a/installer/step5-upgrade-undercloud-and-overcloud.yaml b/installer/step5-upgrade-undercloud-and-overcloud.yaml new file mode 100644 index 0000000..f76eba8 --- /dev/null +++ b/installer/step5-upgrade-undercloud-and-overcloud.yaml @@ -0,0 +1,6 @@ +--- +- hosts: director + vars: + ansible_user: stack + tasks: + - include_tasks: "step5-upgrade-undercloud-and-overcloud/{{ dci_topic | lower }}_{{ next_topic_name | lower }}/tasks.yaml" diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml new file mode 100644 index 0000000..e69de29 From 239f15d70522db7796784f27b2a22942606d11ea Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Wed, 26 Sep 2018 15:35:47 +0100 Subject: [PATCH 02/38] Persist testbed specific network configs for DCI This ensures they survive a reboot during updates and upgrades. --- .../step2-install-undercloud/osp10/tasks.yaml | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/installer/step2-install-undercloud/osp10/tasks.yaml b/installer/step2-install-undercloud/osp10/tasks.yaml index a8d9268..0ff1166 100644 --- a/installer/step2-install-undercloud/osp10/tasks.yaml +++ b/installer/step2-install-undercloud/osp10/tasks.yaml @@ -234,4 +234,24 @@ ip addr add {{ overcloud_director_ip }} dev usernet become: true -# TODO(sambetts) Persist the network changes from above so they survive reboot +- name: Write out network config for usernet interface + copy: + dest: /etc/sysconfig/network-scripts/ifcfg-usernet + content: | + DEVICE=usernet + TYPE=Ethernet + ONBOOT=yes + BOOTPROTO=none + PREFIX={{ overcloud_director_ip | ipaddr('prefix') }} + IPADDR={{ overcloud_director_ip | ipaddr('address') }} + +- name: Write out network config for fake floating IP net interface + copy: + dest: /etc/sysconfig/network-scripts/ifcfg-{{ undercloud_fake_gw_interface }} + content: | + DEVICE={{ undercloud_fake_gw_interface }} + TYPE=Ethernet + ONBOOT=yes + BOOTPROTO=none + PREFIX={{ undercloud_fake_gw_cidr | ipaddr('prefix') }} + IPADDR={{ undercloud_fake_gw_cidr | ipaddr('address') }} From 2369afb7f0e1c65978c9fba4290a566ac0a8c4aa Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Wed, 26 Sep 2018 18:03:46 +0100 Subject: [PATCH 03/38] Ensure NetworkManager is disabled as well as stopped --- installer/step2-install-undercloud/osp10/tasks.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/installer/step2-install-undercloud/osp10/tasks.yaml b/installer/step2-install-undercloud/osp10/tasks.yaml index 0ff1166..ec8c2ba 100644 --- a/installer/step2-install-undercloud/osp10/tasks.yaml +++ b/installer/step2-install-undercloud/osp10/tasks.yaml @@ -220,6 +220,7 @@ systemd: state: stopped name: NetworkManager + enabled: no become: true - name: Add fake floating ip network gateway From 0e20d751e55cd3fc544c3cae951ad18426a63b68 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Wed, 26 Sep 2018 19:10:25 +0100 Subject: [PATCH 04/38] Use expect to walk through interactive overcloud update --- .../osp10/tasks.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml index 435c515..ddf970b 100644 --- a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml +++ b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml @@ -70,5 +70,17 @@ - name: Perform a package update on all overcloud nodes shell: | - source /home/stack/stackrc - openstack overcloud update stack -i overcloud + set timeout -1 + set end 0; + + spawn /bin/bash -c "source /home/stack/stackrc && openstack overcloud update stack -i overcloud" + + while {$end == 0} { + expect { + "Breakpoint reached" { send -- "\r" } + "update finished" { set end [ expr $end + 1 ] } + } + } + + exit 0 + executable: /usr/bin/expect From 609d0a6257697145514eb28cfaf8f1f9d62e473f Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Thu, 27 Sep 2018 12:05:22 +0100 Subject: [PATCH 05/38] Add reboot for compute and controller nodes to update process --- .../osp10/tasks.yaml | 237 +++++++++++------- 1 file changed, 153 insertions(+), 84 deletions(-) diff --git a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml index ddf970b..242d366 100644 --- a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml +++ b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml @@ -1,86 +1,155 @@ --- +# 2.4. UPDATING THE CURRENT OVERCLOUD IMAGES FOR OPENSTACK +# PLATFORM 10.Z -- hosts: director - tasks: - # 2.4. UPDATING THE CURRENT OVERCLOUD IMAGES FOR OPENSTACK - # PLATFORM 10.Z - - - name: Stop the main OpenStack Platform services - systemd: - state: stopped - name: "{{ item }}" - with_items: - - 'openstack-*' - - 'neutron-*' - - httpd - become: true - - - name: Update the python-tripleoclient package and its dependencies - yum: - name: python-tripleoclient - state: latest - become: true - - - name: Run the undercloud upgrade - shell: openstack undercloud upgrade - - - name: Reboot director to pick up updates - shell: "sleep 5 && reboot" - async: 1 - poll: 0 - become: true - - - name: Wait for director to finish rebooting - wait_for_connection: - connect_timeout: 20 - sleep: 5 - delay: 20 - timeout: 600 - - # 2.5. UPDATING THE CURRENT OVERCLOUD IMAGES FOR OPENSTACK - # PLATFORM 10.Z - - - name: Unpack the overcloud images into stack - unarchive: - remote_src: true - src: "{{ item }}" - dest: /home/stack/images - with_items: - - /usr/share/rhosp-director-images/overcloud-full-latest-10.0.tar - - /usr/share/rhosp-director-images/ironic-python-agent-latest-10.0.tar - - - name: Import the latest images into the director and configure nodes to use the new images - shell: | - source /home/stack/stackrc - openstack overcloud image upload --update-existing --image-path /home/stack/images/ - openstack overcloud node configure $(openstack baremetal node list -c UUID -f csv --quote none | sed "1d" | paste -s -d " ") - - # 2.6. UPDATING THE CURRENT OVERCLOUD PACKAGES FOR - # OPENSTACK PLATFORM 10.Z - - - name: Update the current plan using your original openstack overcloud deploy command - shell: | - source /home/stack/stackrc - openstack overcloud deploy --update-plan-only --templates \ - -e /home/stack/environments/overcloud-config.yaml \ - -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ - -e /usr/share/openstack-tripleo-heat-templates/environments/net-single-nic-with-vlans.yaml \ - -e /home/stack/environments/networking-cisco-config.yaml \ - --ntp-server 1.ntp.esl.cisco.com - - - name: Perform a package update on all overcloud nodes - shell: | - set timeout -1 - set end 0; - - spawn /bin/bash -c "source /home/stack/stackrc && openstack overcloud update stack -i overcloud" - - while {$end == 0} { - expect { - "Breakpoint reached" { send -- "\r" } - "update finished" { set end [ expr $end + 1 ] } - } - } - - exit 0 - executable: /usr/bin/expect +- name: Stop the main OpenStack Platform services + systemd: + state: stopped + name: "{{ item }}" + with_items: + - 'openstack-*' + - 'neutron-*' + - httpd + become: true + +- name: Update the python-tripleoclient package and its dependencies + yum: + name: python-tripleoclient + state: latest + become: true + +- name: Run the undercloud upgrade + shell: openstack undercloud upgrade + +- name: Reboot director to pick up updates + shell: "sleep 5 && reboot" + async: 1 + poll: 0 + become: true + +- name: Wait for director to finish rebooting + wait_for_connection: + connect_timeout: 20 + sleep: 5 + delay: 20 + timeout: 600 + +# 2.5. UPDATING THE CURRENT OVERCLOUD IMAGES FOR OPENSTACK +# PLATFORM 10.Z + +- name: Unpack the overcloud images into stack + unarchive: + remote_src: true + src: "{{ item }}" + dest: /home/stack/images + with_items: + - /usr/share/rhosp-director-images/overcloud-full-latest-10.0.tar + - /usr/share/rhosp-director-images/ironic-python-agent-latest-10.0.tar + +- name: Import the latest images into the director and configure nodes to use the new images + shell: | + source /home/stack/stackrc + openstack overcloud image upload --update-existing --image-path /home/stack/images/ + openstack overcloud node configure $(openstack baremetal node list -c UUID -f csv --quote none | sed "1d" | paste -s -d " ") + +# 2.6. UPDATING THE CURRENT OVERCLOUD PACKAGES FOR +# OPENSTACK PLATFORM 10.Z + +- name: Update the current plan using your original openstack overcloud deploy command + shell: | + source /home/stack/stackrc + openstack overcloud deploy --update-plan-only --templates \ + -e /home/stack/environments/overcloud-config.yaml \ + -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ + -e /usr/share/openstack-tripleo-heat-templates/environments/net-single-nic-with-vlans.yaml \ + -e /home/stack/environments/networking-cisco-config.yaml \ + --ntp-server 1.ntp.esl.cisco.com + +- name: Perform a package update on all overcloud nodes + shell: | + set timeout -1 + set end 0; + + spawn /bin/bash -c "source /home/stack/stackrc && openstack overcloud update stack -i overcloud" + + while {$end == 0} { + expect { + "Breakpoint reached" { send -- "\r" } + "update finished" { set end [ expr $end + 1 ] } + } + } + + exit 0 + executable: /usr/bin/expect + +# 2.7. REBOOTING CONTROLLER AND COMPOSABLE NODES + +- name: Write out playbook for rebooting a controller + copy: + dest: /home/stack/reboot_controller.yaml + content: | + --- + - hosts: all + tasks: + - name: Stop the pacemaker cluster + shell: | + pcs cluster stop + become: true + + - name: Reboot controller to pick up updates + shell: "sleep 5 && reboot" + async: 1 + poll: 0 + become: true + + - name: Wait for controller to finish rebooting + wait_for_connection: + connect_timeout: 20 + sleep: 5 + delay: 20 + timeout: 600 + + - name: Restart the pacemaker cluster + shell: | + pcs cluster start + become: true + +- name: Discover all the controller nodes and IPs + shell: | + source stackrc + openstack server list --name controller -f json -c Name -c Networks + register: controlserverlist + +- name: Parse the controller nodes into a usable fact + set_fact: + controller_nodes: "{{ controlserverlist.stdout | from_json }}" + +- name: Reboot all the controller nodes + shell: | + ansible-playbook -i "{{ item.Networks.split('=')[1] }}, " -e ansible_user=heat-admin /home/stack/reboot_controller.yaml + with_items: "{{ controller_nodes }}" + +# 2.9. REBOOTING COMPUTE NODES + +- name: Discover all the compute nodes and IPs + shell: | + source stackrc + openstack server list --name compute -f json -c Name -c Networks + register: computeserverlist + +- name: Parse the compute nodes into a usable fact + set_fact: + compute_nodes: "{{ computeserverlist.stdout | from_json }}" + +- name: Reboot the compute node + shell: | + source overcloudrc + openstack compute service set {{ item.Name }}.localdomain nova-compute --disable + nova host-evacuate-live {{ item.Name }}.localdomain + + source stackrc + openstack server reboot {{ item.Name }} + ansible all -i "{{ item.Networks.split('=')[1] }}," -e ansible_user=heat-admin -m "wait_for_connection" -a "connect_timeout=20 sleep=5 delay=20 timeout=600" + + source overcloudrc + openstack compute service set {{ item.Name }}.localdomain nova-compute --enable From 063892d6850a138e1e216992e582cc6c34538441 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Thu, 27 Sep 2018 14:25:22 +0100 Subject: [PATCH 06/38] Add tasks for fast forward upgrade from OSP10 to 13 --- .../osp10_osp13/tasks.yaml | 255 ++++++++++++++++++ 1 file changed, 255 insertions(+) diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index e69de29..f717914 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -0,0 +1,255 @@ +--- +# 3.1. UPGRADING THE UNDERCLOUD TO OPENSTACK PLATFORM 11 + +- name: Disable the OSP10 repo + rhsm_repository: + name: rhel-7-server-openstack-10-rpms + state: disabled + become: true + +- name: Enable the OSP11 repo + rhsm_repository: + name: rhel-7-server-openstack-11-rpms + state: disabled + become: true + +- name: Stop the main OpenStack Platform services + systemd: + state: stopped + name: "{{ item }}" + with_items: + - 'openstack-*' + - 'neutron-*' + - httpd + become: true + +- name: Upgrade the director’s main packages + yum: + name: '{{ item }}' + state: latest + update_cache: true + with_items: + - instack-undercloud + - openstack-puppet-modules + - openstack-tripleo-common + - python-tripleoclient + become: true + +- name: Upgrade the undercloud + shell: openstack undercloud upgrade + +# 3.2. UPGRADING THE UNDERCLOUD TO OPENSTACK PLATFORM 12 + +- name: Disable the OSP11 repo + rhsm_repository: + name: rhel-7-server-openstack-11-rpms + state: disabled + become: true + +- name: Enable the OSP12 repo + rhsm_repository: + name: rhel-7-server-openstack-12-rpms + state: disabled + become: true + +- name: Upgrade the director’s main packages + yum: + name: python-tripleoclient + state: latest + update_cache: true + become: true + +- name: Upgrade the undercloud + shell: openstack undercloud upgrade + +# 3.3. UPGRADING THE UNDERCLOUD TO OPENSTACK PLATFORM 13 + +- name: Disable the OSP12 repo + rhsm_repository: + name: rhel-7-server-openstack-12-rpms + state: disabled + become: true + +- name: Enable the OSP13 repo + rhsm_repository: + name: rhel-7-server-openstack-13-rpms + state: disabled + become: true + +- name: Upgrade the director’s main packages + yum: + name: python-tripleoclient + state: latest + update_cache: true + become: true + +- name: Upgrade the undercloud + shell: openstack undercloud upgrade + +- name: Reboot the undercloud to update the system + shell: "sleep 5 && reboot" + async: 1 + poll: 0 + become: true + +- name: Wait for director to finish rebooting + wait_for_connection: + connect_timeout: 20 + sleep: 5 + delay: 20 + timeout: 600 + +# 4.5. USING THE UNDERCLOUD AS A LOCAL REGISTRY + +- name: Create a template to upload the the images to the local registry + shell: | + source /home/stack/stackrc + openstack overcloud container image prepare \ + --namespace=registry.access.redhat.com/rhosp13 \ + --push-destination={{ undercloud_local_ip | ipaddr('address') }}:8787 \ + --prefix=openstack- \ + --tag-from-label {version}-{release} \ + --output-env-file=/home/stack/templates/overcloud_images.yaml \ + --output-images-file /home/stack/local_registry_images.yaml \ + --exclude neutron-server + when: dci_base_ip is not defined + +- name: Create a template to upload the the images to the local registry + shell: | + source /home/stack/stackrc + openstack overcloud container image prepare \ + --namespace={{ dci_base_ip }}:5000/rhosp13 \ + --push-destination={{ undercloud_local_ip | ipaddr('address') }}:8787 \ + --prefix=openstack- \ + --output-env-file=/home/stack/templates/overcloud_images.yaml \ + --output-images-file /home/stack/local_registry_images.yaml \ + --exclude neutron-server + when: dci_base_ip is defined + +- name: Pull the container images to the undercloud + shell: | + source /home/stack/stackrc + openstack overcloud container image upload \ + --config-file /home/stack/local_registry_images.yaml \ + --verbose + become: true + +# Custom for getting networking-cisco into the neutron-server container + +- name: Create the template for the neutron server images + copy: + dest: /usr/share/tripleo-common/container-images/overcloud_containers.yaml.j2 + backup: true + content: | + {% raw %} + container_images_template: + + - imagename: "{{namespace}}/openstack-neutron-server-networking-cisco-plugin:{{tag}}" + params: + - DockerNeutronApiImage + - DockerNeutronConfigImage + services: + - OS::TripleO::Services::NeutronApi + - OS::TripleO::Services::NeutronDhcpAgent + - OS::TripleO::Services::NeutronMetadataAgent + - OS::TripleO::Services::NeutronServer + {% endraw %} + register: overcloud_containers + become: true + +- block: + - name: Create a template to upload the neutron images to the local registry + shell: | + source /home/stack/stackrc + openstack overcloud container image prepare \ + --namespace=registry.hub.docker.com/bradleyjones \ + --push-destination={{ undercloud_local_ip | ipaddr('address') }}:8787 \ + --tag latest \ + --output-env-file=/home/stack/templates/overcloud_images_neutron.yaml \ + --output-images-file /home/stack/local_registry_images_neutron.yaml + + - name: Pull the neutron container images to the undercloud + shell: | + source /home/stack/stackrc + openstack overcloud container image upload \ + --config-file /home/stack/local_registry_images_neutron.yaml \ + --verbose + become: true + always: + - name: Restore the orignal overcloud_containers template + copy: + dest: /usr/share/tripleo-common/container-images/overcloud_containers.yaml.j2 + src: "{{ overcloud_containers.backup_file }}" + remote_src: true + become: true + +# CHAPTER 6. UPGRADING THE OVERCLOUD + +# 6.1. PERFORMING THE FAST FORWARD UPGRADE OF THE +# OVERCLOUD + +- name: Run the fast forward upgrade preparation command + shell: | + source stackrc + openstack overcloud ffwd-upgrade prepare --yes --templates \ + -e /home/stack/environments/node-info.yaml \ + -e /home/stack/templates/overcloud_images.yaml \ + -e /home/stack/templates/overcloud_images_neutron.yaml \ + -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ + -e /usr/share/openstack-tripleo-heat-templates/environments/net-bond-with-vlans.yaml \ + -e /home/stack/environments/networking-cisco-config.yaml \ + -e /home/stack/environments/rhel_sub_config.yaml \ + --ntp-server 1.ntp.esl.cisco.com + +- name: Run the fast forward upgrade command + shell: | + source stackrc + openstack overcloud ffwd-upgrade run --yes + +# 6.2. UPGRADING ALL CONTROLLER NODES + +- name: Run the upgrade command + shell: | + source stackrc + openstack overcloud upgrade run --roles Controller --skip-tags validation + +# 6.4. UPGRADING ALL COMPUTE NODES + +- name: Run the upgrade command + shell: | + source ~/stackrc + openstack overcloud upgrade run --roles Compute --skip-tags validation + +# 6.6. FINALIZING THE FAST FORWARD UPGRADE + +- name: Run the fast forward upgrade finalization command + shell: | + source stackrc + openstack overcloud ffwd-upgrade converge --yes --templates \ + -e /home/stack/environments/node-info.yaml \ + -e /home/stack/templates/overcloud_images.yaml \ + -e /home/stack/templates/overcloud_images_neutron.yaml \ + -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ + -e /usr/share/openstack-tripleo-heat-templates/environments/net-bond-with-vlans.yaml \ + -e /home/stack/environments/networking-cisco-config.yaml \ + -e /home/stack/environments/rhel_sub_config.yaml \ + --ntp-server 1.ntp.esl.cisco.com + +# CHAPTER 7. EXECUTING POST UPGRADE STEPS + +# 7.3. UPGRADING THE OVERCLOUD IMAGES + +- name: Unpack the overcloud images into stack + unarchive: + remote_src: true + src: "{{ item }}" + dest: /home/stack/images + with_items: + - /usr/share/rhosp-director-images/overcloud-full-latest-13.0.tar + - /usr/share/rhosp-director-images/ironic-python-agent-latest-13.0.tar + +- name: Upload overcloud images to the undercloud + shell: | + source /home/stack/stackrc + openstack overcloud image upload --update-existing --image-path /home/stack/images/ + openstack overcloud node configure $(openstack baremetal node list -c UUID -f value) From e9ab5bfdb7734afe5d3591b440ecaf90b5d625fb Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Thu, 27 Sep 2018 14:30:23 +0100 Subject: [PATCH 07/38] Fix issue with shell executable argument --- .../step4-update-undercloud-and-overcloud/osp10/tasks.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml index 242d366..c4ba34a 100644 --- a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml +++ b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml @@ -80,7 +80,8 @@ } exit 0 - executable: /usr/bin/expect + args: + executable: /usr/bin/expect # 2.7. REBOOTING CONTROLLER AND COMPOSABLE NODES From fbe23c1b1fb0ff7849b8c343060b4eb63430f6b3 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Thu, 27 Sep 2018 14:50:03 +0100 Subject: [PATCH 08/38] Ensure we install expect before trying to use it --- .../step4-update-undercloud-and-overcloud/osp10/tasks.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml index c4ba34a..462f3ec 100644 --- a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml +++ b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml @@ -65,6 +65,12 @@ -e /home/stack/environments/networking-cisco-config.yaml \ --ntp-server 1.ntp.esl.cisco.com +- name: Install expect package + yum: + name: expect + state: latest + become: true + - name: Perform a package update on all overcloud nodes shell: | set timeout -1 From 1a28165aeff24973d44fefbd0fda78da280dabee Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Thu, 27 Sep 2018 17:33:47 +0100 Subject: [PATCH 09/38] Ensure that we use sudo to write out the network scripts --- installer/step2-install-undercloud/osp10/tasks.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/installer/step2-install-undercloud/osp10/tasks.yaml b/installer/step2-install-undercloud/osp10/tasks.yaml index ec8c2ba..459c34c 100644 --- a/installer/step2-install-undercloud/osp10/tasks.yaml +++ b/installer/step2-install-undercloud/osp10/tasks.yaml @@ -245,6 +245,7 @@ BOOTPROTO=none PREFIX={{ overcloud_director_ip | ipaddr('prefix') }} IPADDR={{ overcloud_director_ip | ipaddr('address') }} + become: true - name: Write out network config for fake floating IP net interface copy: @@ -256,3 +257,4 @@ BOOTPROTO=none PREFIX={{ undercloud_fake_gw_cidr | ipaddr('prefix') }} IPADDR={{ undercloud_fake_gw_cidr | ipaddr('address') }} + become: true From 5fcddda402259b0fbfb9318e1a5bcc42bb4dee63 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Tue, 2 Oct 2018 12:04:43 +0100 Subject: [PATCH 10/38] Fix all the linters errors so the checking all the things works --- installer/step2-install-undercloud.yaml | 3 ++- installer/step3-install-overcloud.yaml | 3 ++- installer/step4-update-undercloud-and-overcloud.yaml | 3 ++- .../osp10/tasks.yaml | 2 +- .../step5-upgrade-undercloud-and-overcloud.yaml | 3 ++- .../osp10_osp13/tasks.yaml | 12 ++++++------ 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/installer/step2-install-undercloud.yaml b/installer/step2-install-undercloud.yaml index c7c1106..53fa117 100644 --- a/installer/step2-install-undercloud.yaml +++ b/installer/step2-install-undercloud.yaml @@ -49,4 +49,5 @@ vars: ansible_user: stack tasks: - - include_tasks: "step2-install-undercloud/{{ dci_topic | lower }}/tasks.yaml" + - name: Include tasks for OSP version + include_tasks: "step2-install-undercloud/{{ dci_topic | lower }}/tasks.yaml" diff --git a/installer/step3-install-overcloud.yaml b/installer/step3-install-overcloud.yaml index a7574d3..cf929be 100644 --- a/installer/step3-install-overcloud.yaml +++ b/installer/step3-install-overcloud.yaml @@ -20,4 +20,5 @@ vars: ansible_user: stack tasks: - - include_tasks: "step3-install-overcloud/{{ dci_topic | lower }}/tasks.yaml" + - name: Include tasks for OSP version + include_tasks: "step3-install-overcloud/{{ dci_topic | lower }}/tasks.yaml" diff --git a/installer/step4-update-undercloud-and-overcloud.yaml b/installer/step4-update-undercloud-and-overcloud.yaml index e75b109..aea06a4 100644 --- a/installer/step4-update-undercloud-and-overcloud.yaml +++ b/installer/step4-update-undercloud-and-overcloud.yaml @@ -3,4 +3,5 @@ vars: ansible_user: stack tasks: - - include_tasks: "step4-update-undercloud-and-overcloud/{{ dci_topic | lower }}/tasks.yaml" + - name: Include tasks for OSP version + include_tasks: "step4-update-undercloud-and-overcloud/{{ dci_topic | lower }}/tasks.yaml" diff --git a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml index 462f3ec..f876d24 100644 --- a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml +++ b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml @@ -53,7 +53,7 @@ openstack overcloud node configure $(openstack baremetal node list -c UUID -f csv --quote none | sed "1d" | paste -s -d " ") # 2.6. UPDATING THE CURRENT OVERCLOUD PACKAGES FOR -# OPENSTACK PLATFORM 10.Z +# OPENSTACK PLATFORM 10.Z - name: Update the current plan using your original openstack overcloud deploy command shell: | diff --git a/installer/step5-upgrade-undercloud-and-overcloud.yaml b/installer/step5-upgrade-undercloud-and-overcloud.yaml index f76eba8..e985164 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud.yaml @@ -3,4 +3,5 @@ vars: ansible_user: stack tasks: - - include_tasks: "step5-upgrade-undercloud-and-overcloud/{{ dci_topic | lower }}_{{ next_topic_name | lower }}/tasks.yaml" + - name: Include tasks for OSP version + include_tasks: "step5-upgrade-undercloud-and-overcloud/{{ dci_topic | lower }}_{{ next_topic_name | lower }}/tasks.yaml" diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index f717914..a471d5c 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -23,7 +23,7 @@ - httpd become: true -- name: Upgrade the director’s main packages +- name: Upgrade the director's main packages yum: name: '{{ item }}' state: latest @@ -36,7 +36,7 @@ become: true - name: Upgrade the undercloud - shell: openstack undercloud upgrade + shell: openstack undercloud upgrade # 3.2. UPGRADING THE UNDERCLOUD TO OPENSTACK PLATFORM 12 @@ -52,7 +52,7 @@ state: disabled become: true -- name: Upgrade the director’s main packages +- name: Upgrade the director's main packages yum: name: python-tripleoclient state: latest @@ -60,7 +60,7 @@ become: true - name: Upgrade the undercloud - shell: openstack undercloud upgrade + shell: openstack undercloud upgrade # 3.3. UPGRADING THE UNDERCLOUD TO OPENSTACK PLATFORM 13 @@ -76,7 +76,7 @@ state: disabled become: true -- name: Upgrade the director’s main packages +- name: Upgrade the director's main packages yum: name: python-tripleoclient state: latest @@ -84,7 +84,7 @@ become: true - name: Upgrade the undercloud - shell: openstack undercloud upgrade + shell: openstack undercloud upgrade - name: Reboot the undercloud to update the system shell: "sleep 5 && reboot" From f0e60ef977867ac5615af13cea961658da3b90f2 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Tue, 2 Oct 2018 12:04:12 +0100 Subject: [PATCH 11/38] Switch to using os-net-config to setup all the network interfaces --- .../step2-install-undercloud/osp10/tasks.yaml | 109 ++++++++++-------- 1 file changed, 62 insertions(+), 47 deletions(-) diff --git a/installer/step2-install-undercloud/osp10/tasks.yaml b/installer/step2-install-undercloud/osp10/tasks.yaml index 459c34c..807bc7c 100644 --- a/installer/step2-install-undercloud/osp10/tasks.yaml +++ b/installer/step2-install-undercloud/osp10/tasks.yaml @@ -148,7 +148,6 @@ option: dhcp_end value: "{{ undercloud_local_ip | ipaddr('network/prefix') | ipaddr('99') | ipaddr('address') }}" - - name: Set inspection ip range in undercloud.conf ini_file: path: /home/stack/undercloud.conf @@ -164,6 +163,68 @@ option: undercloud_admin_password value: password +# Based on https://github.com/openstack/instack-undercloud/blob/newton-eol/templates/net-config.json.template +# adds Cisco environment specific interfaces that need configuring +- name: Write out the undercloud net config override + copy: + dest: /home/stack/undercloud_net_config.json.template + content: | + {% raw -%} + "network_config": [ + { + "type": "ovs_bridge", + "name": "br-ctlplane", + "ovs_extra": [ + "br-set-external-id br-ctlplane bridge-id br-ctlplane" + ], + "members": [ + { + "type": "interface", + "name": "{{LOCAL_INTERFACE}}", + "primary": "true", + "mtu": {{LOCAL_MTU}}, + {% endraw %} + "hwaddr": "{{ ansible_facts['pxe_int']['macaddress'] }}" + } + {% raw %} + ], + "addresses": [ + { + "ip_netmask": "{{PUBLIC_INTERFACE_IP}}" + } + ], + "mtu": {{LOCAL_MTU}} + }, + {% endraw %} + { + "type": "interface", + "name": "usernet", + "hwaddr": "{{ ansible_facts['usernet']['macaddress'] }}", + "addresses": [ + { + "ip_netmask": "{{ overcloud_director_ip }}" + } + ] + }, + { + "type": "interface", + "name": "{{ undercloud_fake_gw_interface }}", + "hwaddr": "{{ ansible_facts[(undercloud_fake_gw_interface | replace('-', '_'))]['macaddress'] }}", + "addresses": [ + { + "ip_netmask": "{{ undercloud_fake_gw_cidr }}" + } + ] + } + ] + +- name: Set net config override in undercloud config + ini_file: + path: /home/stack/undercloud.conf + section: DEFAULT + option: net_config_override + value: "/home/stack/undercloud_net_config.json.template" + - name: Run the undercloud installation shell: openstack undercloud install @@ -212,49 +273,3 @@ source /home/stack/stackrc openstack subnet set --dns-nameserver {{ dns_server_1 }} default-subnet when: default_subnet_has_name is failed - -# Non-standard Cisco additions to the installer process from here on: - -# Cisco specific addition for fake floating ip address gateway -- name: Make sure NetworkManager is not running - systemd: - state: stopped - name: NetworkManager - enabled: no - become: true - -- name: Add fake floating ip network gateway - shell: > - ip addr | grep -q {{ undercloud_fake_gw_cidr }} || - ip addr add {{ undercloud_fake_gw_cidr }} dev {{ undercloud_fake_gw_interface }} - become: true - -- name: Add IP in overcloud routable network - shell: > - ip addr | grep -q {{ overcloud_director_ip }} || - ip addr add {{ overcloud_director_ip }} dev usernet - become: true - -- name: Write out network config for usernet interface - copy: - dest: /etc/sysconfig/network-scripts/ifcfg-usernet - content: | - DEVICE=usernet - TYPE=Ethernet - ONBOOT=yes - BOOTPROTO=none - PREFIX={{ overcloud_director_ip | ipaddr('prefix') }} - IPADDR={{ overcloud_director_ip | ipaddr('address') }} - become: true - -- name: Write out network config for fake floating IP net interface - copy: - dest: /etc/sysconfig/network-scripts/ifcfg-{{ undercloud_fake_gw_interface }} - content: | - DEVICE={{ undercloud_fake_gw_interface }} - TYPE=Ethernet - ONBOOT=yes - BOOTPROTO=none - PREFIX={{ undercloud_fake_gw_cidr | ipaddr('prefix') }} - IPADDR={{ undercloud_fake_gw_cidr | ipaddr('address') }} - become: true From 8c7bcc99c30b36c6a53348941b8dff155d5df5be Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Tue, 2 Oct 2018 13:54:36 +0100 Subject: [PATCH 12/38] Use persist_mapping instead of hwaddr --- installer/step2-install-undercloud/osp10/tasks.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/installer/step2-install-undercloud/osp10/tasks.yaml b/installer/step2-install-undercloud/osp10/tasks.yaml index 807bc7c..4fc308a 100644 --- a/installer/step2-install-undercloud/osp10/tasks.yaml +++ b/installer/step2-install-undercloud/osp10/tasks.yaml @@ -183,10 +183,8 @@ "name": "{{LOCAL_INTERFACE}}", "primary": "true", "mtu": {{LOCAL_MTU}}, - {% endraw %} - "hwaddr": "{{ ansible_facts['pxe_int']['macaddress'] }}" + "persist_mapping": "true" } - {% raw %} ], "addresses": [ { @@ -199,7 +197,7 @@ { "type": "interface", "name": "usernet", - "hwaddr": "{{ ansible_facts['usernet']['macaddress'] }}", + "persist_mapping": "true", "addresses": [ { "ip_netmask": "{{ overcloud_director_ip }}" @@ -209,7 +207,7 @@ { "type": "interface", "name": "{{ undercloud_fake_gw_interface }}", - "hwaddr": "{{ ansible_facts[(undercloud_fake_gw_interface | replace('-', '_'))]['macaddress'] }}", + "persist_mapping": "true", "addresses": [ { "ip_netmask": "{{ undercloud_fake_gw_cidr }}" From 9cecc6e856d7dd323157f4ad73de53be0ab4787d Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Tue, 2 Oct 2018 15:24:04 +0100 Subject: [PATCH 13/38] Switch to using kernel names for the network interfaces --- installer/step2-install-undercloud/osp10/tasks.yaml | 9 +++------ installer/step2-install-undercloud/osp13/tasks.yaml | 2 +- testbeds/host_vars/bxb6-DIRECTOR/vars | 5 ++++- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/installer/step2-install-undercloud/osp10/tasks.yaml b/installer/step2-install-undercloud/osp10/tasks.yaml index 4fc308a..a3b8678 100644 --- a/installer/step2-install-undercloud/osp10/tasks.yaml +++ b/installer/step2-install-undercloud/osp10/tasks.yaml @@ -104,7 +104,7 @@ path: /home/stack/undercloud.conf section: DEFAULT option: local_interface - value: pxe-int + value: "{{ undercloud_local_interface }}" - name: Set local_ip in undercloud.conf ini_file: @@ -182,8 +182,7 @@ "type": "interface", "name": "{{LOCAL_INTERFACE}}", "primary": "true", - "mtu": {{LOCAL_MTU}}, - "persist_mapping": "true" + "mtu": {{LOCAL_MTU}} } ], "addresses": [ @@ -196,8 +195,7 @@ {% endraw %} { "type": "interface", - "name": "usernet", - "persist_mapping": "true", + "name": "{{ undercloud_overcloud_interface }}", "addresses": [ { "ip_netmask": "{{ overcloud_director_ip }}" @@ -207,7 +205,6 @@ { "type": "interface", "name": "{{ undercloud_fake_gw_interface }}", - "persist_mapping": "true", "addresses": [ { "ip_netmask": "{{ undercloud_fake_gw_cidr }}" diff --git a/installer/step2-install-undercloud/osp13/tasks.yaml b/installer/step2-install-undercloud/osp13/tasks.yaml index 5e69dac..7d2677b 100644 --- a/installer/step2-install-undercloud/osp13/tasks.yaml +++ b/installer/step2-install-undercloud/osp13/tasks.yaml @@ -104,7 +104,7 @@ path: /home/stack/undercloud.conf section: DEFAULT option: local_interface - value: pxe-int + value: "{{ undercloud_local_interface }}" - name: Set local_ip in undercloud.conf ini_file: diff --git a/testbeds/host_vars/bxb6-DIRECTOR/vars b/testbeds/host_vars/bxb6-DIRECTOR/vars index 8c32dbb..53b2f8b 100644 --- a/testbeds/host_vars/bxb6-DIRECTOR/vars +++ b/testbeds/host_vars/bxb6-DIRECTOR/vars @@ -9,9 +9,12 @@ overcloud_node_prefix: "bxb6" dns_server_1: 171.70.168.183 -undercloud_fake_gw_interface: eth1 +undercloud_overcloud_interface: enp7s0 + +undercloud_fake_gw_interface: enp8s0 undercloud_fake_gw_cidr: 20.0.0.1/24 +undercloud_local_interface: enp10s0 undercloud_local_ip: 192.0.2.1/24 undercloud_network_gateway: 192.0.2.1 From 714539e1539449ea8d0aeddd67e47f561596e005 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Wed, 3 Oct 2018 10:31:47 +0100 Subject: [PATCH 14/38] Ensure that we use full path to source cloud rc files --- .../osp10/tasks.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml index f876d24..0dc8dd5 100644 --- a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml +++ b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml @@ -123,7 +123,7 @@ - name: Discover all the controller nodes and IPs shell: | - source stackrc + source /home/stack/stackrc openstack server list --name controller -f json -c Name -c Networks register: controlserverlist @@ -140,7 +140,7 @@ - name: Discover all the compute nodes and IPs shell: | - source stackrc + source /home/stack/stackrc openstack server list --name compute -f json -c Name -c Networks register: computeserverlist @@ -150,13 +150,13 @@ - name: Reboot the compute node shell: | - source overcloudrc + source /home/stack/overcloudrc openstack compute service set {{ item.Name }}.localdomain nova-compute --disable nova host-evacuate-live {{ item.Name }}.localdomain - source stackrc + source /home/stack/stackrc openstack server reboot {{ item.Name }} ansible all -i "{{ item.Networks.split('=')[1] }}," -e ansible_user=heat-admin -m "wait_for_connection" -a "connect_timeout=20 sleep=5 delay=20 timeout=600" - source overcloudrc + source /home/stack/overcloudrc openstack compute service set {{ item.Name }}.localdomain nova-compute --enable From ee65abc4f9e347ec23ff54f8750541166faf1045 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Wed, 3 Oct 2018 10:45:26 +0100 Subject: [PATCH 15/38] Switch OSP13 over to use kernel device naming too --- .../step2-install-undercloud/osp13/tasks.yaml | 76 ++++++++++++++----- 1 file changed, 57 insertions(+), 19 deletions(-) diff --git a/installer/step2-install-undercloud/osp13/tasks.yaml b/installer/step2-install-undercloud/osp13/tasks.yaml index 7d2677b..ab6caa7 100644 --- a/installer/step2-install-undercloud/osp13/tasks.yaml +++ b/installer/step2-install-undercloud/osp13/tasks.yaml @@ -171,6 +171,63 @@ option: undercloud_admin_password value: password +# Based on https://github.com/openstack/instack-undercloud/blob/newton-eol/templates/net-config.json.template +# adds Cisco environment specific interfaces that need configuring +- name: Write out the undercloud net config override + copy: + dest: /home/stack/undercloud_net_config.json.template + content: | + {% raw -%} + "network_config": [ + { + "type": "ovs_bridge", + "name": "br-ctlplane", + "ovs_extra": [ + "br-set-external-id br-ctlplane bridge-id br-ctlplane" + ], + "members": [ + { + "type": "interface", + "name": "{{LOCAL_INTERFACE}}", + "primary": "true", + "mtu": {{LOCAL_MTU}} + } + ], + "addresses": [ + { + "ip_netmask": "{{PUBLIC_INTERFACE_IP}}" + } + ], + "mtu": {{LOCAL_MTU}} + }, + {% endraw %} + { + "type": "interface", + "name": "{{ undercloud_overcloud_interface }}", + "addresses": [ + { + "ip_netmask": "{{ overcloud_director_ip }}" + } + ] + }, + { + "type": "interface", + "name": "{{ undercloud_fake_gw_interface }}", + "addresses": [ + { + "ip_netmask": "{{ undercloud_fake_gw_cidr }}" + } + ] + } + ] + +- name: Set net config override in undercloud config + ini_file: + path: /home/stack/undercloud.conf + section: DEFAULT + option: net_config_override + value: "/home/stack/undercloud_net_config.json.template" + # 4.7. INSTALLING THE DIRECTOR - name: Run the undercloud installation shell: openstack undercloud install @@ -208,25 +265,6 @@ # Non-standard Cisco additions to the installer process from here on: -# Cisco specific addition for fake floating ip address gateway -- name: Make sure NetworkManager is not running - systemd: - state: stopped - name: NetworkManager - become: true - -- name: Add fake floating ip network gateway - shell: > - ip addr | grep -q {{ undercloud_fake_gw_cidr }} || - ip addr add {{ undercloud_fake_gw_cidr }} dev {{ undercloud_fake_gw_interface }} - become: true - -- name: Add IP in overcloud routable network - shell: > - ip addr | grep -q {{ overcloud_director_ip }} || - ip addr add {{ overcloud_director_ip }} dev usernet - become: true - # Work around for python-gabbi version being out of date - name: Work around for BZ1613475 From 77f70d4e762a4a086045930c7057f2b14b10ab7c Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Wed, 3 Oct 2018 11:05:27 +0100 Subject: [PATCH 16/38] Ensure we fail the play if the update fails --- .../osp10/tasks.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml index 0dc8dd5..11cdc18 100644 --- a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml +++ b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml @@ -74,18 +74,19 @@ - name: Perform a package update on all overcloud nodes shell: | set timeout -1 - set end 0; + set end -1; spawn /bin/bash -c "source /home/stack/stackrc && openstack overcloud update stack -i overcloud" - while {$end == 0} { + while {$end == -1} { expect { "Breakpoint reached" { send -- "\r" } - "update finished" { set end [ expr $end + 1 ] } + "update finished with status COMPLETE" { set end [ expr $end + 1 ] } + "update finished with status FAILED" { set end [ expr $end + 2 ] } } } - exit 0 + exit $end args: executable: /usr/bin/expect From 1e35e77cdd30f199f6c855d6b3dd8960cc6c83a0 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Wed, 3 Oct 2018 13:48:16 +0100 Subject: [PATCH 17/38] Ensure we include rhel registration during OSP10 update --- .../step4-update-undercloud-and-overcloud/osp10/tasks.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml index 11cdc18..3c25954 100644 --- a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml +++ b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml @@ -63,6 +63,8 @@ -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/net-single-nic-with-vlans.yaml \ -e /home/stack/environments/networking-cisco-config.yaml \ + -e /home/stack/environments/rhel_sub_config.yaml \ + -e /usr/share/openstack-tripleo-heat-templates/extraconfig/pre_deploy/rhel-registration/rhel-registration-resource-registry.yaml \ --ntp-server 1.ntp.esl.cisco.com - name: Install expect package From 4ed362574ae250ec3a0ffba925b8db8fde7795ac Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Wed, 3 Oct 2018 18:38:21 +0100 Subject: [PATCH 18/38] Ensure we ssh key-scan the overcloud nodes before ansible --- .../osp10/tasks.yaml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml index 3c25954..9338bd0 100644 --- a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml +++ b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml @@ -134,6 +134,19 @@ set_fact: controller_nodes: "{{ controlserverlist.stdout | from_json }}" +- name: SSH Key scan all the controller nodes + shell: | + ssh-keyscan -t rsa {{ item.Networks.split('=')[1] }} + with_items: "{{ controller_nodes }}" + register: controller_ssh_keys + +- name: Add known host for controller nodes + known_hosts: + state: present + name: "{{ item.item.Networks.split('=')[1] }}" + key: "{{ item.stdout }}" + with_items: "{{ controller_ssh_keys.results }}" + - name: Reboot all the controller nodes shell: | ansible-playbook -i "{{ item.Networks.split('=')[1] }}, " -e ansible_user=heat-admin /home/stack/reboot_controller.yaml @@ -151,6 +164,19 @@ set_fact: compute_nodes: "{{ computeserverlist.stdout | from_json }}" +- name: SSH Key scan all the compute nodes + shell: | + ssh-keyscan -t rsa {{ item.Networks.split('=')[1] }} + with_items: "{{ compute_nodes }}" + register: compute_ssh_keys + +- name: Add known host for compute nodes + known_hosts: + state: present + name: "{{ item.item.Networks.split('=')[1] }}" + key: "{{ item.stdout }}" + with_items: "{{ compute_ssh_keys.results }}" + - name: Reboot the compute node shell: | source /home/stack/overcloudrc From f14f797da83f3f82be1c1a5e886ce1e84deac09e Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Thu, 4 Oct 2018 10:47:51 +0100 Subject: [PATCH 19/38] Ensure we with_items for compute nodes reboot script --- installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml index 9338bd0..20384aa 100644 --- a/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml +++ b/installer/step4-update-undercloud-and-overcloud/osp10/tasks.yaml @@ -189,3 +189,4 @@ source /home/stack/overcloudrc openstack compute service set {{ item.Name }}.localdomain nova-compute --enable + with_items: "{{ compute_nodes }}" From 5a38a0d64467fb36837c405ae6d3e973d7c323d8 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Thu, 4 Oct 2018 12:04:27 +0100 Subject: [PATCH 20/38] Ensure we enable the repos we meant to enable during upgrade --- .../osp10_osp13/tasks.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index a471d5c..0ee8950 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -10,7 +10,7 @@ - name: Enable the OSP11 repo rhsm_repository: name: rhel-7-server-openstack-11-rpms - state: disabled + state: present become: true - name: Stop the main OpenStack Platform services @@ -49,7 +49,7 @@ - name: Enable the OSP12 repo rhsm_repository: name: rhel-7-server-openstack-12-rpms - state: disabled + state: present become: true - name: Upgrade the director's main packages @@ -73,7 +73,7 @@ - name: Enable the OSP13 repo rhsm_repository: name: rhel-7-server-openstack-13-rpms - state: disabled + state: present become: true - name: Upgrade the director's main packages From 645d636cb9b0d90c5c6a45f3e02239cda697d73a Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Thu, 4 Oct 2018 14:55:50 +0100 Subject: [PATCH 21/38] Make sure source path for stackrc is correct during upgrade --- .../osp10_osp13/tasks.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index 0ee8950..4b8b4d6 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -190,7 +190,7 @@ - name: Run the fast forward upgrade preparation command shell: | - source stackrc + source /home/stack/stackrc openstack overcloud ffwd-upgrade prepare --yes --templates \ -e /home/stack/environments/node-info.yaml \ -e /home/stack/templates/overcloud_images.yaml \ @@ -203,28 +203,28 @@ - name: Run the fast forward upgrade command shell: | - source stackrc + source /home/stack/stackrc openstack overcloud ffwd-upgrade run --yes # 6.2. UPGRADING ALL CONTROLLER NODES - name: Run the upgrade command shell: | - source stackrc + source /home/stack/stackrc openstack overcloud upgrade run --roles Controller --skip-tags validation # 6.4. UPGRADING ALL COMPUTE NODES - name: Run the upgrade command shell: | - source ~/stackrc + source /home/stack/stackrc openstack overcloud upgrade run --roles Compute --skip-tags validation # 6.6. FINALIZING THE FAST FORWARD UPGRADE - name: Run the fast forward upgrade finalization command shell: | - source stackrc + source /home/stack/stackrc openstack overcloud ffwd-upgrade converge --yes --templates \ -e /home/stack/environments/node-info.yaml \ -e /home/stack/templates/overcloud_images.yaml \ From 5008d24f6c3136e5a46a5883d1f44629c2aebe67 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Thu, 4 Oct 2018 15:07:10 +0100 Subject: [PATCH 22/38] Output deprecated CLI options to node-info env file during upgrade --- .../osp10_osp13/tasks.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index 4b8b4d6..1b38d62 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -183,6 +183,21 @@ remote_src: true become: true +# CHAPTER 5. PREPARING FOR THE OVERCLOUD UPGRADE + +# 5.6. DEPRECATED CLI OPTIONS + +- name: Write out overcloud misc overcloud config changes + copy: + dest: /home/stack/environments/node-info.yaml + content: | + parameter_defaults: + ControllerCount: {{ overcloud_control_scale }} + ComputeCount: {{ overcloud_compute_scale }} + CephStorageCount: {{ overcloud_ceph_storage_scale }} + BlockStorageCount: {{ overcloud_block_storage_scale }} + ObjectStorageCount: {{ overcloud_swift_storage_scale }} + # CHAPTER 6. UPGRADING THE OVERCLOUD # 6.1. PERFORMING THE FAST FORWARD UPGRADE OF THE From f61488fe383c2121bb5bc787c3e9744b0db815d4 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Thu, 4 Oct 2018 17:04:30 +0100 Subject: [PATCH 23/38] Remove rhel subscription config from ffu prepare logic --- .../osp10_osp13/tasks.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index 1b38d62..8041e40 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -213,7 +213,6 @@ -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/net-bond-with-vlans.yaml \ -e /home/stack/environments/networking-cisco-config.yaml \ - -e /home/stack/environments/rhel_sub_config.yaml \ --ntp-server 1.ntp.esl.cisco.com - name: Run the fast forward upgrade command @@ -247,7 +246,6 @@ -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/net-bond-with-vlans.yaml \ -e /home/stack/environments/networking-cisco-config.yaml \ - -e /home/stack/environments/rhel_sub_config.yaml \ --ntp-server 1.ntp.esl.cisco.com # CHAPTER 7. EXECUTING POST UPGRADE STEPS From fcd1e4f94d06670dbaaf500178988636a4b4063c Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Fri, 5 Oct 2018 10:37:58 +0100 Subject: [PATCH 24/38] Ensure that the step1 cleanup tasks don't fail if server shutoff --- installer/step1-provision-undercloud-server.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/installer/step1-provision-undercloud-server.yaml b/installer/step1-provision-undercloud-server.yaml index 98d089a..d3b2696 100644 --- a/installer/step1-provision-undercloud-server.yaml +++ b/installer/step1-provision-undercloud-server.yaml @@ -1,12 +1,18 @@ --- - hosts: director + gather_facts: false tasks: - - ping: - register: connect_test + - name: Check connection to director + wait_for_connection: + timeout: 10 ignore_errors: true + register: connect_test - name: Pre-reinstall cleanup tasks block: + - name: Gather Facts + setup: + - name: Unregister system from RH if its online still redhat_subscription: state: absent @@ -31,6 +37,7 @@ when: connect_test is not failed - hosts: director + gather_facts: false tasks: - name: Trigger cobbler to reinstall the server shell: > From 1a6b5f0c4143583a6f31cb183fe1754425db9fdc Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Thu, 4 Oct 2018 17:22:56 +0100 Subject: [PATCH 25/38] Try not to delete RHEL subscription during ffu --- .../osp10_osp13/tasks.yaml | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index 8041e40..d8473e6 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -1,4 +1,75 @@ --- +# Pre upgrade step required by this automation to disable unsubscription from +# RHEL during the upgrade. + +- name: Write out environment file to disable rhel registration deletion + copy: + dest: /home/stack/environments/no_delete_rhelsub.yaml + content: | + parameter_defaults: + DeleteOnRHELUnregistration: false + rhel_reg_auto_attach: "" + rhel_reg_activation_key: "" + rhel_reg_org: "" + rhel_reg_pool_id: "{{ rh_sub_pool_id }}" + rhel_reg_repos: "rhel-7-server-rpms,rhel-7-server-extras-rpms,rhel-7-server-rh-common-rpms,\ + rhel-ha-for-rhel-7-server-rpms,rhel-7-server-openstack-10-rpms" + rhel_reg_method: "portal" + rhel_reg_sat_repo: "" + rhel_reg_base_url: "" + rhel_reg_environment: "" + rhel_reg_force: "" + rhel_reg_machine_name: "" + rhel_reg_password: "{{ rh_sub_password }}" + rhel_reg_release: "" + rhel_reg_sat_url: "" + rhel_reg_server_url: "" + rhel_reg_service_level: "" + rhel_reg_user: "{{ rh_sub_username }}" + rhel_reg_type: "" + rhel_reg_http_proxy_host: "" + rhel_reg_http_proxy_port: "" + rhel_reg_http_proxy_username: "" + rhel_reg_http_proxy_password: "" + +- name: Update the current plan using your original openstack overcloud deploy command + shell: | + source /home/stack/stackrc + openstack overcloud deploy --update-plan-only --templates \ + -e /home/stack/environments/overcloud-config.yaml \ + -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ + -e /usr/share/openstack-tripleo-heat-templates/environments/net-single-nic-with-vlans.yaml \ + -e /home/stack/environments/networking-cisco-config.yaml \ + -e /home/stack/environments/no_delete_rhelsub.yaml \ + -e /usr/share/openstack-tripleo-heat-templates/extraconfig/pre_deploy/rhel-registration/rhel-registration-resource-registry.yaml \ + --ntp-server 1.ntp.esl.cisco.com + +- name: Install expect package + yum: + name: expect + state: latest + become: true + +- name: Perform a stack update to ensure that the rhelsub changes are picked up + shell: | + set timeout -1 + set end -1; + + spawn /bin/bash -c "source /home/stack/stackrc && openstack overcloud update stack -i overcloud" + + while {$end == -1} { + expect { + "Breakpoint reached" { send -- "\r" } + "update finished with status COMPLETE" { set end [ expr $end + 1 ] } + "update finished with status FAILED" { set end [ expr $end + 2 ] } + } + } + + exit $end + args: + executable: /usr/bin/expect + + # 3.1. UPGRADING THE UNDERCLOUD TO OPENSTACK PLATFORM 11 - name: Disable the OSP10 repo @@ -266,3 +337,6 @@ source /home/stack/stackrc openstack overcloud image upload --update-existing --image-path /home/stack/images/ openstack overcloud node configure $(openstack baremetal node list -c UUID -f value) + + +# TODO(sambetts) Add code to reenable unsubscription from RHEL on delete From 52d203fa76d834ebefbe8bd380a0e35e07660582 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Fri, 12 Oct 2018 11:46:18 +0100 Subject: [PATCH 26/38] Use custom ffu repo script to remove ceph-osd repo from list --- .../osp10_osp13/tasks.yaml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index d8473e6..ee91b05 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -269,6 +269,39 @@ BlockStorageCount: {{ overcloud_block_storage_scale }} ObjectStorageCount: {{ overcloud_swift_storage_scale }} +# 5.11. CONFIGURING REGISTRATION FOR FAST FORWARD +# UPGRADES + +- name: Write out custom ffu repo script based on guide + copy: + dest: /home/stack/environments/custom_repositories_script.yaml + content: | + parameter_defaults: + FastForwardCustomRepoScriptContent: | + #!/bin/bash + set -e + case $1 in + ocata) + subscription-manager repos --disable=rhel-7-server-openstack-10-rpms + subscription-manager repos --enable=rhel-7-server-openstack-11-rpms + ;; + pike) + subscription-manager repos --disable=rhel-7-server-openstack-11-rpms + subscription-manager repos --enable=rhel-7-server-openstack-12-rpms + ;; + queens) + subscription-manager repos --disable=rhel-7-server-openstack-12-rpms + subscription-manager repos --enable=rhel-7-server-openstack-13-rpms + subscription-manager repos --disable=rhel-7-server-rhceph-2-mon-rpms + subscription-manager repos --enable=rhel-7-server-rhceph-3-mon-rpms + subscription-manager repos --disable=rhel-7-server-rhceph-2-tools-rpms + subscription-manager repos --enable=rhel-7-server-rhceph-3-tools-rpms + ;; + *) + echo "unknown release $1" >&2 + exit 1 + esac + # CHAPTER 6. UPGRADING THE OVERCLOUD # 6.1. PERFORMING THE FAST FORWARD UPGRADE OF THE @@ -284,6 +317,7 @@ -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/net-bond-with-vlans.yaml \ -e /home/stack/environments/networking-cisco-config.yaml \ + -e /home/stack/environments/custom_repositories_script.yaml \ --ntp-server 1.ntp.esl.cisco.com - name: Run the fast forward upgrade command @@ -317,6 +351,7 @@ -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/net-bond-with-vlans.yaml \ -e /home/stack/environments/networking-cisco-config.yaml \ + -e /home/stack/environments/custom_repositories_script.yaml \ --ntp-server 1.ntp.esl.cisco.com # CHAPTER 7. EXECUTING POST UPGRADE STEPS From 4b3ddd6de584272a6723328a460c4f04312466c3 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Fri, 12 Oct 2018 15:03:35 +0100 Subject: [PATCH 27/38] Enable pulling containers from RH dev repo --- .../step3-install-overcloud/osp13/tasks.yaml | 16 ++-- testbeds/host_vars/bxb6-DIRECTOR/vars | 5 ++ testbeds/host_vars/bxb6-DIRECTOR/vault | 90 +++++++++++++++---- 3 files changed, 89 insertions(+), 22 deletions(-) diff --git a/installer/step3-install-overcloud/osp13/tasks.yaml b/installer/step3-install-overcloud/osp13/tasks.yaml index 4833ac9..0c33186 100644 --- a/installer/step3-install-overcloud/osp13/tasks.yaml +++ b/installer/step3-install-overcloud/osp13/tasks.yaml @@ -35,15 +35,22 @@ # Custom for getting networking-cisco into the neutron-server container +- name: Login into the RH dev repo + docker_login: + registry: scan.connect.redhat.com + username: unused + password: "{{ rh_dev_registry_key }}" + when: rh_neutron_container_registry_namespace is search("scan.connect.redhat.com") + become: true + - name: Create the template for the neutron server images copy: dest: /usr/share/tripleo-common/container-images/overcloud_containers.yaml.j2 backup: true content: | - {% raw %} container_images_template: - - imagename: "{{namespace}}/openstack-neutron-server-networking-cisco-plugin:{{tag}}" + - imagename: "{% raw %}{{namespace}}{% endraw %}/{{ rh_neutron_container_name }}:{% raw %}{{tag}}{% endraw %}" params: - DockerNeutronApiImage - DockerNeutronConfigImage @@ -52,7 +59,6 @@ - OS::TripleO::Services::NeutronDhcpAgent - OS::TripleO::Services::NeutronMetadataAgent - OS::TripleO::Services::NeutronServer - {% endraw %} register: overcloud_containers become: true @@ -61,9 +67,9 @@ shell: | source /home/stack/stackrc openstack overcloud container image prepare \ - --namespace=registry.hub.docker.com/bradleyjones \ + --namespace={{ rh_neutron_container_registry_namespace }} \ --push-destination={{ undercloud_local_ip | ipaddr('address') }}:8787 \ - --tag latest \ + --tag {{ rh_neutron_container_tag }} \ --output-env-file=/home/stack/templates/overcloud_images_neutron.yaml \ --output-images-file /home/stack/local_registry_images_neutron.yaml diff --git a/testbeds/host_vars/bxb6-DIRECTOR/vars b/testbeds/host_vars/bxb6-DIRECTOR/vars index 53b2f8b..5865238 100644 --- a/testbeds/host_vars/bxb6-DIRECTOR/vars +++ b/testbeds/host_vars/bxb6-DIRECTOR/vars @@ -254,3 +254,8 @@ custom_pre_puppet_script: | rh_sub_username: "{{ vault_rh_sub_username }}" rh_sub_password: "{{ vault_rh_sub_password }}" rh_sub_pool_id: "{{ vault_rh_sub_pool_id }}" +rh_dev_registry_key: "{{ vault_rh_dev_registry_key }}" +rh_neutron_container_registry_namespace: "scan.connect.redhat.com/ospid-f1c22692-c965-4881-951f-62dee92268bf" +rh_neutron_container_tag: "6.1.1" +# rh_neutron_container_name: "openstack-neutron-server-networking-cisco-plugin" +rh_neutron_container_name: "partner-build-service" diff --git a/testbeds/host_vars/bxb6-DIRECTOR/vault b/testbeds/host_vars/bxb6-DIRECTOR/vault index 96b56d0..f4c3006 100644 --- a/testbeds/host_vars/bxb6-DIRECTOR/vault +++ b/testbeds/host_vars/bxb6-DIRECTOR/vault @@ -1,18 +1,74 @@ $ANSIBLE_VAULT;1.1;AES256 -36646163613538373966373666336131326439616430666133643038343631323366613131363064 -6336336238653962616237353333333531323565326333360a326132396264666566316538613134 -39316461623133643463393739393163653037383163373830656632613435313362323662616639 -3331363032303162610a376264363961363266613636356565336263653739356434366634313639 -61613231323136333063613239323964323734613261363062393834356433343731306131326262 -31376433653032303934343631343531663766313731626637663131633363336562353335636531 -66333833333262656532356563366134313438616631663135646537393764646562333565613431 -66346337653632626536356564646565636263306432353831613036303666336265613963356662 -63623566343661323431346630643239376137343738303763613134666466633338633664663036 -34373630623362393362663731396538393763396262663930326437373932383937613532376166 -62346163656430623039316635303833303965383933393431343463363162643262373061613732 -64343338363830613935653432386532326332336635393436323663313761376535383762386662 -30633961646333326137383363376361356338336336646335633936333965303831616336356435 -65366535376638333330333734373830616461353031363965636436333361636239643063613666 -66316566656566323230326461336335613463343939613036613930333636626463346337636235 -31343236633261626330303063303261346266313934333735613733363539663336376439636266 -35623438623732636164343638373537663632323439653666383938313835323565 +38646135363035316238336161643039393539333734626263386130643434353761626531376234 +6336353231313662316566393666306639346133363637330a313530343639613637383332363663 +62336230656163363939366531386264383536613832353464353966316166393335356237393862 +3537653264623134330a333434383364373761373336323831316137393432346533666630333166 +38386430363933303532363631323066376561613139393236376431626232373436656539623434 +63653965326561343665393263633665313961613730396465393933616231333361356331356365 +64616636633863623939326334336437366439613733646434366163616332646230316264303034 +33323631306334326362366232653735623530323737366165356465666232303734323930363230 +38346465343034623530653764366564633630386635613333383665376262663437386133393361 +33323431316134396634396134626630646131653134373938396634363662393037386365353162 +64333263396331666130353236353163636533356431666465376236323662346366316537653637 +62346233656138316466376630323865316635653236663331346436633238646435666263623763 +64626334626630373535656366326139656261316331393332313261393231623466373531363863 +64396363643031393832353463666431393466333263393865653536326439363232353963363338 +33396163383561353634303563353237373333313566666634356538303135613561646232646366 +36396430303266386366323962663762346332623166323734396630613137353164336136306164 +36646536646361326630623966633135663638653336313838353933363730383965623632613639 +33353939343731306636393962363230636530343464343866613434326461376361613164633434 +34303338633763316638636430663832643139323039383565666561313264366166616263343437 +66333034366161303165656237353931306631363963383131666331336333303738326630656536 +30363935613432663530313262643962383236656538613833653763363638343434393635386338 +63643437326361313535343565626533613230653438646234663031346238663838303034616364 +66363433323237633463633532313538636361616235353634343735663863636162636237653764 +35343838343933633165373265386434333562653166326161366536666531626135626666373038 +30323965663736616666353736636363623832373064343763306264343061363764353032343664 +31396664323863363230633237656262643166316266626630653561356663366332353931313266 +34666332643362363631653562356565646233313735326632333664313061616461383137353261 +64633030643130616330613035333563636531396630343430643135306234616636356466383537 +64393163393130626231623438616665653732396537316637613465626561353535613264653639 +63383739393961366339613564303838316162623331633364643162316461653134373961653965 +31623562663736346161656531653935386665643238666262643733396432613163313534323564 +66353237306663333135343134356532666635333937336161646534323036626633376633303633 +30653230356361343636363030653431393663333939626466393562386361646362343536363831 +31623737306465336230373338396533626336333631656537323936313638366465356230383733 +61383364313561636664306235346130376533626161386363613966636135316336616665656638 +33303132343035316238346334396336646332373331333031616236613863343136366665323430 +32663133343663326638653565623361346635623430363966346637633036336163346538626336 +39343965386334646231653933386131356631316631383439373137653164313530323132643931 +63376230373165353762306238343062666139646161303038346362383530343966303961393936 +31376234616531643034323030323666643235376138663534346134303537616631663335376436 +61616137376266316264623334376337323966393663393731626138623362333262373266323264 +35313835346539363131303631633137373937653135383866633530363238646561316638313131 +61643362613233356432643338366132353865326334393532366531303161663433343238613962 +63613531303635633633323539396136623437353238306364393133626337666133383536306363 +61613039376362393031653734396239656563636266613036323966663334363139653934363665 +66373265663364653266326135316564316332383838386436353235633464373337383166386133 +37306234613537346264333061623136333030623466326235643762393534333238346433643539 +31653964623564306262313961323438636262326561336532363965323939616430336439306232 +39316134623830333930346136633565656565393132303832306539316364376530636164353161 +64623166663465346564333065656237346664333439343836376439616366326238306663313661 +65366134653131643635343132643135383566303930376238303733343238366532396133633434 +62366436643739653464323235643630303263396430623661386438336162633961396662383663 +61666330316466636365363866666434643938666230396139613939386337363462386263353731 +61653636363634316366343338316232623337373864313134663837333131376363306530306333 +36626563383938383831383438303661623861656362616131363062633439373237316265363534 +31643263653337383166333661356333643765643465363937326461633961343966653262326464 +37333331333661626363333639336334613662626165363264653537396230613234633438383139 +33633739333638366561306337663535393034303265336661366161633934666230333831663233 +32653265386638616337316634383930626536326461383539393961653764393333313439646566 +65616462663330313765366535393763643738663636316531613636383037346138633535353532 +36613238663730616562633466643433653730383963353537613432363630326235336661613866 +63393764303262313732626134633436346538636466623337626335336137363038626664356662 +33646233363630323038613230623762393461663532666263636261656434313063353066653064 +63626437323832643263386135393965373238636239353332666136366563363431366538636365 +39346333313934323531383266636435353334383437343733643932396264386536363662343263 +62613930333462636533613637666336613932323862376662373865326664623266626632326165 +35356162313735636637376336383339326230303334363464336137323938656461633632303463 +38396565313535316334363363623466656437616434613165393463343539383139366564303461 +64623839343831316165353038613334663134343735396538633539643436363533356265306366 +34353763303564316566313634316136656637373162346338353737353338636634613232353034 +35353364636534366233623335346132663139643036323135613037656434346563663736356661 +30626366643661646435373739616566623830313064303733643631326361613739376634633536 +30616263616262313536623062303031323463346139323134383062346239393836 From f0c1a8953c423c8bdb09d68c9b4077edf0f5f0cb Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Fri, 19 Oct 2018 13:29:09 +0100 Subject: [PATCH 28/38] Try to work around the FFU config download issue --- .../step3-install-overcloud/osp10/tasks.yaml | 22 +- .../step3-install-overcloud/osp13/tasks.yaml | 22 +- .../osp10_osp13/tasks.yaml | 256 ++++++++++++++++-- 3 files changed, 266 insertions(+), 34 deletions(-) diff --git a/installer/step3-install-overcloud/osp10/tasks.yaml b/installer/step3-install-overcloud/osp10/tasks.yaml index 2abc18f..686a40c 100644 --- a/installer/step3-install-overcloud/osp10/tasks.yaml +++ b/installer/step3-install-overcloud/osp10/tasks.yaml @@ -195,9 +195,9 @@ deploy_stdout: value: {get_attr: [InstallOverrideDefaultPackagesController, deploy_stdout]} -- name: Write out networking-cisco specific config environment +- name: Write out networking-cisco specific config environment resources copy: - dest: /home/stack/environments/networking-cisco-config.yaml + dest: /home/stack/environments/networking-cisco-config-resources.yaml content: | resource_registry: OS::TripleO::NodeUserData: /usr/share/openstack-tripleo-heat-templates/firstboot/os-net-config-mappings.yaml @@ -205,6 +205,10 @@ OS::TripleO::AllNodesExtraConfig: /home/stack/templates/extended_nodes_extra_config.yaml OS::TripleO::NetCiscoOriginal: /usr/share/openstack-tripleo-heat-templates/puppet/extraconfig/all_nodes/neutron-ml2-cisco-nexus-ucsm.yaml +- name: Write out networking-cisco specific config environment params + copy: + dest: /home/stack/environments/networking-cisco-config-params.yaml + content: | parameter_defaults: InternalApiNetworkVlanID: {{ testbed_vlan }} StorageNetworkVlanID: {{ storage_vlan }} @@ -264,12 +268,18 @@ ComputeHostnameFormat: '{{ overcloud_node_prefix }}-%stackname%-compute-%index%' ControllerHostnameFormat: '{{ overcloud_node_prefix }}-%stackname%-controller-%index%' -- name: Write out RHEL subscription manager environment file +- name: Write out RHEL subscription manager environment file delete sub copy: - dest: /home/stack/environments/rhel_sub_config.yaml + dest: /home/stack/environments/delete_rhelsub.yaml content: | parameter_defaults: DeleteOnRHELUnregistration: true + +- name: Write out RHEL subscription manager environment file parameters + copy: + dest: /home/stack/environments/rhel_sub_config.yaml + content: | + parameter_defaults: rhel_reg_auto_attach: "" rhel_reg_activation_key: "" rhel_reg_org: "" @@ -302,7 +312,9 @@ -e /home/stack/environments/overcloud-config.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/net-bond-with-vlans.yaml \ - -e /home/stack/environments/networking-cisco-config.yaml \ + -e /home/stack/environments/networking-cisco-config-resources.yaml \ + -e /home/stack/environments/networking-cisco-config-params.yaml \ + -e /home/stack/environments/delete_rhelsub.yaml \ -e /home/stack/environments/rhel_sub_config.yaml \ -e /usr/share/openstack-tripleo-heat-templates/extraconfig/pre_deploy/rhel-registration/rhel-registration-resource-registry.yaml \ --ntp-server 1.ntp.esl.cisco.com diff --git a/installer/step3-install-overcloud/osp13/tasks.yaml b/installer/step3-install-overcloud/osp13/tasks.yaml index 0c33186..a21e17c 100644 --- a/installer/step3-install-overcloud/osp13/tasks.yaml +++ b/installer/step3-install-overcloud/osp13/tasks.yaml @@ -316,9 +316,9 @@ deploy_stdout: value: {get_attr: [InstallOverrideDefaultPackagesController, deploy_stdout]} -- name: Write out networking-cisco specific config environment +- name: Write out networking-cisco specific config environment resources copy: - dest: /home/stack/environments/networking-cisco-config.yaml + dest: /home/stack/environments/networking-cisco-config-resources.yaml content: | resource_registry: OS::TripleO::NodeUserData: /usr/share/openstack-tripleo-heat-templates/firstboot/os-net-config-mappings.yaml @@ -327,6 +327,10 @@ OS::TripleO::NetCiscoOriginal: /usr/share/openstack-tripleo-heat-templates/puppet/extraconfig/all_nodes/neutron-ml2-cisco-nexus-ucsm.yaml OS::TripleO::StringToMap: /home/stack/templates/json_converter.yaml +- name: Write out networking-cisco specific config environment params + copy: + dest: /home/stack/environments/networking-cisco-config-params.yaml + content: | parameter_defaults: InternalApiNetworkVlanID: {{ testbed_vlan }} StorageNetworkVlanID: {{ storage_vlan }} @@ -386,12 +390,18 @@ ComputeHostnameFormat: '{{ overcloud_node_prefix }}-%stackname%-compute-%index%' ControllerHostnameFormat: '{{ overcloud_node_prefix }}-%stackname%-controller-%index%' -- name: Write out RHEL subscription manager environment file +- name: Write out RHEL subscription manager environment file delete sub copy: - dest: /home/stack/environments/rhel_sub_config.yaml + dest: /home/stack/environments/delete_rhelsub.yaml content: | parameter_defaults: DeleteOnRHELUnregistration: true + +- name: Write out RHEL subscription manager environment file parameters + copy: + dest: /home/stack/environments/rhel_sub_config.yaml + content: | + parameter_defaults: rhel_reg_auto_attach: "" rhel_reg_activation_key: "" rhel_reg_org: "" @@ -426,7 +436,9 @@ -e /home/stack/templates/overcloud_images_neutron.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/net-bond-with-vlans.yaml \ - -e /home/stack/environments/networking-cisco-config.yaml \ + -e /home/stack/environments/networking-cisco-config-resources.yaml \ + -e /home/stack/environments/networking-cisco-config-params.yaml \ + -e /home/stack/environments/delete_rhelsub.yaml \ -e /home/stack/environments/rhel_sub_config.yaml \ -e /usr/share/openstack-tripleo-heat-templates/extraconfig/pre_deploy/rhel-registration/rhel-registration-resource-registry.yaml \ --ntp-server 1.ntp.esl.cisco.com diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index ee91b05..e5d93e9 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -8,29 +8,235 @@ content: | parameter_defaults: DeleteOnRHELUnregistration: false - rhel_reg_auto_attach: "" - rhel_reg_activation_key: "" - rhel_reg_org: "" - rhel_reg_pool_id: "{{ rh_sub_pool_id }}" - rhel_reg_repos: "rhel-7-server-rpms,rhel-7-server-extras-rpms,rhel-7-server-rh-common-rpms,\ - rhel-ha-for-rhel-7-server-rpms,rhel-7-server-openstack-10-rpms" - rhel_reg_method: "portal" - rhel_reg_sat_repo: "" - rhel_reg_base_url: "" - rhel_reg_environment: "" - rhel_reg_force: "" - rhel_reg_machine_name: "" - rhel_reg_password: "{{ rh_sub_password }}" - rhel_reg_release: "" - rhel_reg_sat_url: "" - rhel_reg_server_url: "" - rhel_reg_service_level: "" - rhel_reg_user: "{{ rh_sub_username }}" - rhel_reg_type: "" - rhel_reg_http_proxy_host: "" - rhel_reg_http_proxy_port: "" - rhel_reg_http_proxy_username: "" - rhel_reg_http_proxy_password: "" + +- name: Write out json converter template + copy: + dest: /home/stack/templates/json_converter.yaml + content: | + heat_template_version: 2015-04-30 + + parameters: + data: + type: json + + resources: {} + + outputs: + converted: + description: Json data + value: { get_param: data } + +- name: Write out replacement node extra config template for nexus/ucsm ml2 + copy: + dest: /home/stack/templates/new_nexus_ucsm_extra_config.yaml + content: | + heat_template_version: 2015-04-30 + + description: Configure hieradata for Network Cisco configuration + + parameters: + # Parameters passed from the parent template + servers: + type: json + + # extra parameters passed via parameter_defaults + NetworkUCSMIp: + type: string + description: Cisco UCSM IP + default: 127.0.0.1 + NetworkUCSMUsername: + type: string + description: Cisco UCSM username + default: admin + NetworkUCSMPassword: + type: string + description: Cisco UCSM password + default: '' + hidden: true + NetworkUCSMHostList: + type: string + description: > + Mac address to service profile mapping for UCSM-controlled hosts + The format is + ':, :, ...' + default: '' + NetworkUCSMSupportedPciDevs: + type: string + description: Cisco UCSM SR-IOV and VM-FEX vendors supported + default: '' + NetworkUCSMHttpsVerify: + type: boolean + description: > + Enabling/disabling UCS Manager SSL certificate verification + default: true + NetworkUCSMSpTemplateList: + type: string + description: Host to Service Profile Template mapping with its path + default: '' + NetworkUCSMVnicTemplateList: + type: string + description: > + Neutron physical network to vNIC Template mapping with its path + default: '' + NetworkNexusConfig: + type: json + description: Nexus switch configuration + default: {} + NetworkNexusManagedPhysicalNetwork: + type: string + description: The name of the physical_network + default: '' + NetworkNexusVlanNamePrefix: + type: string + description: > + This configuration item is OBSOLETE. + A short prefix to prepend to the VLAN name + default: 'q-' + NetworkNexusSviRoundRobin: + type: boolean + description: > + This configuration item is OBSOLETE. + A flag to enable round robin scheduling + default: false + NetworkNexusProviderVlanNamePrefix: + type: string + description: > + This configuration item is OBSOLETE. + A short prefix to prepend to the VLAN name. + default: 'p-' + NetworkNexusPersistentSwitchConfig: + type: string + description: > + This config item will be deprecated. + To make Nexus device persistent. + default: false + NetworkNexusNeverCacheSshConnection: + type: string + description: > + This config item will be deprecated. + Prevent Cache of ssh connection + default: false + NetworkNexusSwitchHeartbeatTime: + type: number + description: > + Time interval to check the state of the Nexus device. The units of this + object are seconds. Setting this object to a value of 0 disables the + replay feature. + default: 30 + NetworkNexusSwitchReplayCount: + type: number + description: > + This configuration item is OBSOLETE. The Nexus driver replay behavior + is to continue to attempt to connect to the down Nexus device with a + period equal to the heartbeat time interval. This was previously the + Number of times to attempt config replay. + default: 3 + NetworkNexusCfgDriver: + type: string + description: > + This will be deprecated. Lower-level configuration driver which sends + commands to the Nexus Device. Choices are 'restapi' or 'ncclient' + where the latter is being deprecated. So there is no longer a need for + this variable. + default: 'restapi' + NetworkNexusProviderVlanAutoCreate: + type: boolean + description: A flag whether to manage the creation and removal of VLANs + default: true + NetworkNexusProviderVlanAutoTrunk: + type: boolean + description: A flag whether to manage the trunk ports on the Nexus + default: true + NetworkNexusVxlanGlobalConfig: + type: boolean + description: A flag whether to manage the VXLAN global settings + default: true + NetworkNexusHostKeyChecks: + type: boolean + description: > + This config item will be deprecated. It enables strict host key + checks when connecting to Nexus switches + default: false + NetworkNexusVxlanVniRanges: + type: string + description: VXLAN Network IDs that are available for tenant network + default: '' + NetworkNexusVxlanMcastRanges: + type: string + description: Multicast groups for the VXLAN interface. + default: '' + + resources: + CollectMacHostnames: + type: OS::TripleO::MacHostname + properties: + servers: {get_param: servers} + + ProcessNexusAndUCSMMappings: + type: OS::Heat::SoftwareConfig + properties: + group: script + inputs: + - name: controller_mappings + - name: compute_mappings + - name: orig_nexus_mapping + - name: orig_ucsm_mapping + config: | + #!/bin/python + import json + import os + import ast + + heat_outputs_path = os.environ.get("heat_outputs_path") + controller_mappings = os.environ.get("controller_mappings") + compute_mappings = os.environ.get("compute_mappings") + orig_nexus_mapping = os.environ.get("orig_nexus_mapping") + orig_ucsm_mapping = os.environ.get("orig_ucsm_mapping") + + controller_mappings = ast.literal_eval(controller_mappings) + compute_mappings = ast.literal_eval(compute_mappings) + + if orig_nexus_mapping: + orig_nexus_mapping = ast.literal_eval(orig_nexus_mapping) + + # Take mapping of host to macs and convert them to a mac to host + # mapping + mac2host = {} + for mappings in [controller_mappings, compute_mappings]: + for host, data in mappings.items(): + host_macs = data.strip().split() + for mac in host_macs[1:]: + mac2host[mac] = host_macs[0] + + for nexus in orig_nexus_mapping: + server_mapping = {} + for mac, switchports in nexus['servers']: + mac = mac.lower() + if mac not in mac2host: + continue + server = mac2host[mac] + if server in server_mapping: + server_mapping[server]['ports'] += "," + switchports['ports'] + else: + server_mapping[server]['ports'] = switchports + nexus['servers'] = server_mapping + + with open('%s.%s' % (heat_outputs_path, "nexus_mappings"), 'w') as out: + out.write(json.dumps(orig_nexus_mappings)) + with open('%s.%s' % (heat_outputs_path, "ucsm_mappings"), 'w') as out: + out.write(json.dumps(ucsm_mappings)) + + +- name: Write out networking-cisco specific config environment resources + copy: + dest: /home/stack/environments/networking-cisco-config-resources-preupgrade.yaml + content: | + resource_registry: + OS::TripleO::NodeUserData: /usr/share/openstack-tripleo-heat-templates/firstboot/os-net-config-mappings.yaml + OS::TripleO::ControllerExtraConfigPre: /home/stack/templates/controller_extra_config_prepuppet.yaml + OS::TripleO::AllNodesExtraConfig: OS::Heat::None + OS::TripleO::MacHostname: /usr/share/openstack-tripleo-heat-templates/extraconfig/all_nodes/mac_hostname.yaml + OS::TripleO::StringToMap: /home/stack/templates/json_converter.yaml - name: Update the current plan using your original openstack overcloud deploy command shell: | @@ -39,8 +245,10 @@ -e /home/stack/environments/overcloud-config.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/net-single-nic-with-vlans.yaml \ - -e /home/stack/environments/networking-cisco-config.yaml \ + -e /home/stack/environments/networking-cisco-config-resources-preupgrade.yaml \ + -e /home/stack/environments/networking-cisco-config-params.yaml \ -e /home/stack/environments/no_delete_rhelsub.yaml \ + -e /home/stack/environments/rhel_sub_config.yaml \ -e /usr/share/openstack-tripleo-heat-templates/extraconfig/pre_deploy/rhel-registration/rhel-registration-resource-registry.yaml \ --ntp-server 1.ntp.esl.cisco.com From f1c7cc66b89cdf2f8193a92500c18f1c25fdf7ee Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Mon, 22 Oct 2018 10:36:13 +0100 Subject: [PATCH 29/38] Ensure ffu upgrade pre and conv command use new config files --- .../osp10_osp13/tasks.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index e5d93e9..a4331e7 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -234,7 +234,6 @@ resource_registry: OS::TripleO::NodeUserData: /usr/share/openstack-tripleo-heat-templates/firstboot/os-net-config-mappings.yaml OS::TripleO::ControllerExtraConfigPre: /home/stack/templates/controller_extra_config_prepuppet.yaml - OS::TripleO::AllNodesExtraConfig: OS::Heat::None OS::TripleO::MacHostname: /usr/share/openstack-tripleo-heat-templates/extraconfig/all_nodes/mac_hostname.yaml OS::TripleO::StringToMap: /home/stack/templates/json_converter.yaml @@ -524,7 +523,8 @@ -e /home/stack/templates/overcloud_images_neutron.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/net-bond-with-vlans.yaml \ - -e /home/stack/environments/networking-cisco-config.yaml \ + -e /home/stack/environments/networking-cisco-config-resources-preupgrade.yaml \ + -e /home/stack/environments/networking-cisco-config-params.yaml \ -e /home/stack/environments/custom_repositories_script.yaml \ --ntp-server 1.ntp.esl.cisco.com @@ -558,7 +558,8 @@ -e /home/stack/templates/overcloud_images_neutron.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/net-bond-with-vlans.yaml \ - -e /home/stack/environments/networking-cisco-config.yaml \ + -e /home/stack/environments/networking-cisco-config-resources-preupgrade.yaml \ + -e /home/stack/environments/networking-cisco-config-params.yaml \ -e /home/stack/environments/custom_repositories_script.yaml \ --ntp-server 1.ntp.esl.cisco.com From 9b8fc0b03f5bfbaa1d526a6f0f7e93ecac565cfb Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Wed, 24 Oct 2018 10:17:47 +0100 Subject: [PATCH 30/38] Ensure we change to all the OSP13 parameters for ML2 during upgrade --- .../osp10_osp13/tasks.yaml | 283 ++++-------------- 1 file changed, 65 insertions(+), 218 deletions(-) diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index a4331e7..3c2171c 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -9,224 +9,6 @@ parameter_defaults: DeleteOnRHELUnregistration: false -- name: Write out json converter template - copy: - dest: /home/stack/templates/json_converter.yaml - content: | - heat_template_version: 2015-04-30 - - parameters: - data: - type: json - - resources: {} - - outputs: - converted: - description: Json data - value: { get_param: data } - -- name: Write out replacement node extra config template for nexus/ucsm ml2 - copy: - dest: /home/stack/templates/new_nexus_ucsm_extra_config.yaml - content: | - heat_template_version: 2015-04-30 - - description: Configure hieradata for Network Cisco configuration - - parameters: - # Parameters passed from the parent template - servers: - type: json - - # extra parameters passed via parameter_defaults - NetworkUCSMIp: - type: string - description: Cisco UCSM IP - default: 127.0.0.1 - NetworkUCSMUsername: - type: string - description: Cisco UCSM username - default: admin - NetworkUCSMPassword: - type: string - description: Cisco UCSM password - default: '' - hidden: true - NetworkUCSMHostList: - type: string - description: > - Mac address to service profile mapping for UCSM-controlled hosts - The format is - ':, :, ...' - default: '' - NetworkUCSMSupportedPciDevs: - type: string - description: Cisco UCSM SR-IOV and VM-FEX vendors supported - default: '' - NetworkUCSMHttpsVerify: - type: boolean - description: > - Enabling/disabling UCS Manager SSL certificate verification - default: true - NetworkUCSMSpTemplateList: - type: string - description: Host to Service Profile Template mapping with its path - default: '' - NetworkUCSMVnicTemplateList: - type: string - description: > - Neutron physical network to vNIC Template mapping with its path - default: '' - NetworkNexusConfig: - type: json - description: Nexus switch configuration - default: {} - NetworkNexusManagedPhysicalNetwork: - type: string - description: The name of the physical_network - default: '' - NetworkNexusVlanNamePrefix: - type: string - description: > - This configuration item is OBSOLETE. - A short prefix to prepend to the VLAN name - default: 'q-' - NetworkNexusSviRoundRobin: - type: boolean - description: > - This configuration item is OBSOLETE. - A flag to enable round robin scheduling - default: false - NetworkNexusProviderVlanNamePrefix: - type: string - description: > - This configuration item is OBSOLETE. - A short prefix to prepend to the VLAN name. - default: 'p-' - NetworkNexusPersistentSwitchConfig: - type: string - description: > - This config item will be deprecated. - To make Nexus device persistent. - default: false - NetworkNexusNeverCacheSshConnection: - type: string - description: > - This config item will be deprecated. - Prevent Cache of ssh connection - default: false - NetworkNexusSwitchHeartbeatTime: - type: number - description: > - Time interval to check the state of the Nexus device. The units of this - object are seconds. Setting this object to a value of 0 disables the - replay feature. - default: 30 - NetworkNexusSwitchReplayCount: - type: number - description: > - This configuration item is OBSOLETE. The Nexus driver replay behavior - is to continue to attempt to connect to the down Nexus device with a - period equal to the heartbeat time interval. This was previously the - Number of times to attempt config replay. - default: 3 - NetworkNexusCfgDriver: - type: string - description: > - This will be deprecated. Lower-level configuration driver which sends - commands to the Nexus Device. Choices are 'restapi' or 'ncclient' - where the latter is being deprecated. So there is no longer a need for - this variable. - default: 'restapi' - NetworkNexusProviderVlanAutoCreate: - type: boolean - description: A flag whether to manage the creation and removal of VLANs - default: true - NetworkNexusProviderVlanAutoTrunk: - type: boolean - description: A flag whether to manage the trunk ports on the Nexus - default: true - NetworkNexusVxlanGlobalConfig: - type: boolean - description: A flag whether to manage the VXLAN global settings - default: true - NetworkNexusHostKeyChecks: - type: boolean - description: > - This config item will be deprecated. It enables strict host key - checks when connecting to Nexus switches - default: false - NetworkNexusVxlanVniRanges: - type: string - description: VXLAN Network IDs that are available for tenant network - default: '' - NetworkNexusVxlanMcastRanges: - type: string - description: Multicast groups for the VXLAN interface. - default: '' - - resources: - CollectMacHostnames: - type: OS::TripleO::MacHostname - properties: - servers: {get_param: servers} - - ProcessNexusAndUCSMMappings: - type: OS::Heat::SoftwareConfig - properties: - group: script - inputs: - - name: controller_mappings - - name: compute_mappings - - name: orig_nexus_mapping - - name: orig_ucsm_mapping - config: | - #!/bin/python - import json - import os - import ast - - heat_outputs_path = os.environ.get("heat_outputs_path") - controller_mappings = os.environ.get("controller_mappings") - compute_mappings = os.environ.get("compute_mappings") - orig_nexus_mapping = os.environ.get("orig_nexus_mapping") - orig_ucsm_mapping = os.environ.get("orig_ucsm_mapping") - - controller_mappings = ast.literal_eval(controller_mappings) - compute_mappings = ast.literal_eval(compute_mappings) - - if orig_nexus_mapping: - orig_nexus_mapping = ast.literal_eval(orig_nexus_mapping) - - # Take mapping of host to macs and convert them to a mac to host - # mapping - mac2host = {} - for mappings in [controller_mappings, compute_mappings]: - for host, data in mappings.items(): - host_macs = data.strip().split() - for mac in host_macs[1:]: - mac2host[mac] = host_macs[0] - - for nexus in orig_nexus_mapping: - server_mapping = {} - for mac, switchports in nexus['servers']: - mac = mac.lower() - if mac not in mac2host: - continue - server = mac2host[mac] - if server in server_mapping: - server_mapping[server]['ports'] += "," + switchports['ports'] - else: - server_mapping[server]['ports'] = switchports - nexus['servers'] = server_mapping - - with open('%s.%s' % (heat_outputs_path, "nexus_mappings"), 'w') as out: - out.write(json.dumps(orig_nexus_mappings)) - with open('%s.%s' % (heat_outputs_path, "ucsm_mappings"), 'w') as out: - out.write(json.dumps(ucsm_mappings)) - - - name: Write out networking-cisco specific config environment resources copy: dest: /home/stack/environments/networking-cisco-config-resources-preupgrade.yaml @@ -509,6 +291,71 @@ exit 1 esac +# 5.12. CHECKING CUSTOM PUPPET PARAMETERS + +- name: Write out replacement for custom ml2 config parameters + copy: + dest: /home/stack/environments/networking-cisco-config-params.yaml + content: | + parameter_defaults: + InternalApiNetworkVlanID: {{ testbed_vlan }} + StorageNetworkVlanID: {{ storage_vlan }} + StorageMgmtNetworkVlanID: {{ storage_mgmt_vlan }} + TenantNetworkVlanID: {{ tenant_network_vlan }} + EC2MetadataIp: {{ undercloud_local_ip | ipaddr('address') }} + ControlPlaneDefaultRoute: {{ undercloud_network_gateway }} + + ExternalNetCidr: {{ overcloud_external_ip_cidr }} + ExternalAllocationPools: [{'start': '{{ overcloud_external_ip_start }}', 'end': '{{ overcloud_external_ip_end }}'}] + ExternalNetworkVlanID: {{ overcloud_external_vlan }} + ExternalInterfaceDefaultRoute: {{ overcloud_external_gateway }} + + DnsServers: ["{{ dns_server_1 }}"] + + NeutronTypeDrivers: '{{ type_driver }}' + NeutronNetworkType: '{{ network_type }}' + NeutronNetworkVLANRanges: '{{ network_nexus_vlan_range }}' + NeutronTunnelTypes: '' + + NetworkUCSMIp: '{{ network_ucsm_ip }}' + NetworkUCSMUsername: '{{ network_ucsm_username }}' + NetworkUCSMPassword: '{{ network_ucsm_password }}' + NetworkUCSMHostList: '{{ network_ucsm_host_list }}' + NetworkUCSMHttpsVerify: '{{ network_ucsm_https_verify }}' + NetworkNexusConfig: {{ network_nexus_config|to_nice_json }} + + NetworkNexusManagedPhysicalNetwork: {{ network_nexus_managed_physical_network }} + NetworkNexusVlanNamePrefix: '{{ network_nexus_vlan_name_prefix }}' + NetworkNexusSviRoundRobin: '{{ network_nexus_svi_round_robin|to_json }}' + NetworkNexusProviderVlanNamePrefix: '{{ network_nexus_provider_vlan_name_prefix }}' + NetworkNexusPersistentSwitchConfig: '{{ network_nexus_persistent_switch_config|to_json }}' + NetworkNexusSwitchHeartbeatTime: {{ network_nexus_switch_heartbeat_time }} + NetworkNexusSwitchReplayCount: {{ network_nexus_switch_replay_count }} + NetworkNexusProviderVlanAutoCreate: '{{ network_nexus_provider_vlan_auto_create|to_json }}' + NetworkNexusProviderVlanAutoTrunk: '{{ network_nexus_provider_vlan_auto_trunk|to_json }}' + NetworkNexusVxlanGlobalConfig: '{{ network_nexus_vxlan_global_config|to_json }}' + NetworkNexusHostKeyChecks: '{{ network_nexus_host_key_checks|to_json }}' + NeutronNetworkVLANRanges: '{{ network_nexus_vlan_range }}' + NeutronPluginExtensions: "qos,port_security,cisco_providernet_ext" + + NetworkNexusVxlanVniRanges: '{{ vni_ranges }}' + NetworkNexusVxlanMcastRanges: '{{ mcast_ranges }}' + + ControllerExtraConfig: + neutron::plugins::ml2::mechanism_drivers: {{ network_cntlr_mech_drivers | to_json }} + neutron::config::plugin_ml2_config: {{ extra_neutron_config_osp13 | to_json }} + + NovaComputeExtraConfig: + neutron::plugins::ml2::mechanism_drivers: ['openvswitch'] + + NetConfigDataLookup: {{ overcloud_node_nic_mappings_bond | to_nice_json }} + + # Format for node hostnames Note %index% is translated into the index + # of the node, e.g 0/1/2 etc and %stackname% is replaced with the stack + # name e.g overcloud + ComputeHostnameFormat: '{{ overcloud_node_prefix }}-%stackname%-compute-%index%' + ControllerHostnameFormat: '{{ overcloud_node_prefix }}-%stackname%-controller-%index%' + # CHAPTER 6. UPGRADING THE OVERCLOUD # 6.1. PERFORMING THE FAST FORWARD UPGRADE OF THE From f39560411931008c98132772240cdf238266d1e7 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Wed, 24 Oct 2018 12:43:21 +0100 Subject: [PATCH 31/38] Remove additional resources from the preupgrade step --- .../osp10_osp13/tasks.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index 3c2171c..8c7a2ba 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -16,8 +16,6 @@ resource_registry: OS::TripleO::NodeUserData: /usr/share/openstack-tripleo-heat-templates/firstboot/os-net-config-mappings.yaml OS::TripleO::ControllerExtraConfigPre: /home/stack/templates/controller_extra_config_prepuppet.yaml - OS::TripleO::MacHostname: /usr/share/openstack-tripleo-heat-templates/extraconfig/all_nodes/mac_hostname.yaml - OS::TripleO::StringToMap: /home/stack/templates/json_converter.yaml - name: Update the current plan using your original openstack overcloud deploy command shell: | From e818178e46c0cd4dd431bd0267d46718de842644 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Thu, 25 Oct 2018 10:59:26 +0100 Subject: [PATCH 32/38] Ensure we write out configs to json during upgrade --- .../osp10_osp13/tasks.yaml | 102 +++++++++++++++++- 1 file changed, 101 insertions(+), 1 deletion(-) diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index 8c7a2ba..e45484a 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -354,6 +354,106 @@ ComputeHostnameFormat: '{{ overcloud_node_prefix }}-%stackname%-compute-%index%' ControllerHostnameFormat: '{{ overcloud_node_prefix }}-%stackname%-controller-%index%' +- name: Create extended AllNodesExtraConfig to remove domain names + copy: + dest: /home/stack/templates/extended_nodes_extra_config.yaml + content: | + heat_template_version: 2015-04-30 + + parameters: + servers: + type: json + + resources: + ConfigureML2: + type: OS::TripleO::NetCiscoOriginal + properties: + servers: {get_param: servers} + + SlurpExistingNetCiscoData: + type: OS::Heat::SoftwareConfig + properties: + group: script + outputs: + - type: Json + name: net_cisco_data + description: "The corrected net_cisco heira data" + config: | + #!/bin/python + import json + import os + + heat_outputs_path = os.environ.get("heat_outputs_path") + output_name = "net_cisco_data" + + # Load old hieradata from the config file written by the original net cisco template + with open("/etc/puppet/hieradata/neutron_cisco_data.json") as oldjson: + oldconfig = json.loads(oldjson.read()) + + # Remove mapped_data nesting as it breaks hiera since Ocata + oldconfig = oldconfig["mapped_data"] + + # Convert nexus config string into nexus config json + nexus_config = json.loads(oldconfig["neutron::plugins::ml2::cisco::nexus::nexus_config"]) + oldconfig["neutron::plugins::ml2::cisco::nexus::nexus_config"] = nexus_config + + # Remove domains from the ucsm host list + existing_ucsm_config = oldconfig["neutron::plugins::ml2::cisco::ucsm::ucsm_host_list"] + existing_ucsm_config = existing_ucsm_config.strip() + + if existing_ucsm_config: + new_ucsm_hosts = [] + for oldhost in existing_ucsm_config.split(","): + oldhost = oldhost.strip() + host, sp = oldhost.split(":") + host = host.split(".")[0] + new_ucsm_hosts.append("%s:%s" % (host, sp)) + oldconfig["neutron::plugins::ml2::cisco::ucsm::ucsm_host_list"] = ",".join(new_ucsm_hosts) + + # Write json to outputs directory + with open('%s.%s' % (heat_outputs_path, output_name), 'w') as out: + out.write(json.dumps(oldconfig)) + + SlurpExistingNetCiscoDataDeploy: + type: OS::Heat::SoftwareDeployment + depends_on: ConfigureML2 + properties: + name: SlurpExistingNetCiscoDataDeploy + server: {get_param: [servers, Controller, '0']} + config: {get_resource: SlurpExistingNetCiscoData} + actions: ['CREATE'] + + ConvertToJson: + type: OS::TripleO::StringToMap + properties: + data: {get_attr: [SlurpExistingNetCiscoDataDeploy, net_cisco_data]} + + NetworkingCiscoConfig: + type: OS::Heat::StructuredConfig + properties: + group: hiera + config: + datafiles: + neutron_cisco_data: {get_attr: [ConvertToJson, converted]} + + NetworkCiscoConfigDeployment: + type: OS::Heat::StructuredDeployments + properties: + name: NetworkCiscoDeployment + config: {get_resource: NetworkingCiscoConfig} + servers: {get_param: [servers, Controller]} + actions: ['CREATE'] + +- name: Write out networking-cisco specific config environment resources + copy: + dest: /home/stack/environments/networking-cisco-config-resources.yaml + content: | + resource_registry: + OS::TripleO::NodeUserData: /usr/share/openstack-tripleo-heat-templates/firstboot/os-net-config-mappings.yaml + OS::TripleO::AllNodesExtraConfig: /home/stack/templates/extended_nodes_extra_config.yaml + OS::TripleO::NetCiscoOriginal: /usr/share/openstack-tripleo-heat-templates/puppet/extraconfig/all_nodes/neutron-ml2-cisco-nexus-ucsm.yaml + OS::TripleO::StringToMap: /home/stack/templates/json_converter.yaml + # CHAPTER 6. UPGRADING THE OVERCLOUD # 6.1. PERFORMING THE FAST FORWARD UPGRADE OF THE @@ -403,7 +503,7 @@ -e /home/stack/templates/overcloud_images_neutron.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/net-bond-with-vlans.yaml \ - -e /home/stack/environments/networking-cisco-config-resources-preupgrade.yaml \ + -e /home/stack/environments/networking-cisco-config-resources.yaml \ -e /home/stack/environments/networking-cisco-config-params.yaml \ -e /home/stack/environments/custom_repositories_script.yaml \ --ntp-server 1.ntp.esl.cisco.com From 40ef79b0fd0ddfc6780d8b5694db6847294d6ffe Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Mon, 29 Oct 2018 16:36:18 +0000 Subject: [PATCH 33/38] Disable our drivers in neutron during the upgrade process --- .../osp10_osp13/tasks.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index e45484a..67e2f8d 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -354,6 +354,15 @@ ComputeHostnameFormat: '{{ overcloud_node_prefix }}-%stackname%-compute-%index%' ControllerHostnameFormat: '{{ overcloud_node_prefix }}-%stackname%-controller-%index%' +- name: Write out config to disable our drivers during the upgrade process + copy: + dest: /home/stack/environments/networking-cisco-disable-drivers.yaml + content: | + parameter_defaults: + ControllerExtraConfig: + neutron::plugins::ml2::mechanism_drivers: ['openvswitch'] + neutron::config::plugin_ml2_config: {{ extra_neutron_config_osp13 | to_json }} + - name: Create extended AllNodesExtraConfig to remove domain names copy: dest: /home/stack/templates/extended_nodes_extra_config.yaml @@ -470,6 +479,7 @@ -e /usr/share/openstack-tripleo-heat-templates/environments/net-bond-with-vlans.yaml \ -e /home/stack/environments/networking-cisco-config-resources-preupgrade.yaml \ -e /home/stack/environments/networking-cisco-config-params.yaml \ + -e /home/stack/environments/networking-cisco-disable-drivers.yaml \ -e /home/stack/environments/custom_repositories_script.yaml \ --ntp-server 1.ntp.esl.cisco.com From f256a1b6ed7c799bbee62f89f501718b8700b562 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Tue, 30 Oct 2018 10:27:45 +0000 Subject: [PATCH 34/38] Ensure we write out json converter template during upgrade --- .../osp10_osp13/tasks.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index 67e2f8d..69e4223 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -453,6 +453,23 @@ servers: {get_param: [servers, Controller]} actions: ['CREATE'] +- name: Write out json converter template + copy: + dest: /home/stack/templates/json_converter.yaml + content: | + heat_template_version: 2015-04-30 + + parameters: + data: + type: json + + resources: {} + + outputs: + converted: + description: Json data + value: { get_param: data } + - name: Write out networking-cisco specific config environment resources copy: dest: /home/stack/environments/networking-cisco-config-resources.yaml From 787c39a119f326fab513f3d921d6f79f91399c20 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Tue, 30 Oct 2018 11:59:30 +0000 Subject: [PATCH 35/38] Update vars for BXB12 to work with new interface programming --- testbeds/host_vars/bxb12-DIRECTOR/vars | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testbeds/host_vars/bxb12-DIRECTOR/vars b/testbeds/host_vars/bxb12-DIRECTOR/vars index 399f80e..00f31ac 100644 --- a/testbeds/host_vars/bxb12-DIRECTOR/vars +++ b/testbeds/host_vars/bxb12-DIRECTOR/vars @@ -9,9 +9,12 @@ overcloud_node_prefix: "bxb12" dns_server_1: 171.70.168.183 +undercloud_overcloud_interface: usernet + undercloud_fake_gw_interface: eth1 undercloud_fake_gw_cidr: 20.0.0.1/24 +undercloud_local_interface: pxe-int undercloud_local_ip: 192.0.2.1/24 undercloud_network_gateway: 192.0.2.1 @@ -151,4 +154,3 @@ custom_pre_puppet_script: | rh_sub_username: "{{ vault_rh_sub_username }}" rh_sub_password: "{{ vault_rh_sub_password }}" rh_sub_pool_id: "{{ vault_rh_sub_pool_id }}" - From f240e6e1eae02171637a542c66442b734cc59f39 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Tue, 30 Oct 2018 12:10:04 +0000 Subject: [PATCH 36/38] Re-enable RHEL subscription management in last step of upgrade --- .../osp10_osp13/tasks.yaml | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index 69e4223..0056a6b 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -470,6 +470,35 @@ description: Json data value: { get_param: data } +- name: Write out RHEL subscription manager environment file parameters + copy: + dest: /home/stack/environments/rhel_sub_config.yaml + content: | + parameter_defaults: + rhel_reg_auto_attach: "" + rhel_reg_activation_key: "" + rhel_reg_org: "" + rhel_reg_pool_id: "{{ rh_sub_pool_id }}" + rhel_reg_repos: "rhel-7-server-rpms,rhel-7-server-extras-rpms,rhel-7-server-rh-common-rpms,\ + rhel-ha-for-rhel-7-server-rpms,rhel-7-server-openstack-13-rpms" + rhel_reg_method: "portal" + rhel_reg_sat_repo: "" + rhel_reg_base_url: "" + rhel_reg_environment: "" + rhel_reg_force: "" + rhel_reg_machine_name: "" + rhel_reg_password: "{{ rh_sub_password }}" + rhel_reg_release: "" + rhel_reg_sat_url: "" + rhel_reg_server_url: "" + rhel_reg_service_level: "" + rhel_reg_user: "{{ rh_sub_username }}" + rhel_reg_type: "" + rhel_reg_http_proxy_host: "" + rhel_reg_http_proxy_port: "" + rhel_reg_http_proxy_username: "" + rhel_reg_http_proxy_password: "" + - name: Write out networking-cisco specific config environment resources copy: dest: /home/stack/environments/networking-cisco-config-resources.yaml @@ -532,7 +561,8 @@ -e /usr/share/openstack-tripleo-heat-templates/environments/net-bond-with-vlans.yaml \ -e /home/stack/environments/networking-cisco-config-resources.yaml \ -e /home/stack/environments/networking-cisco-config-params.yaml \ - -e /home/stack/environments/custom_repositories_script.yaml \ + -e /home/stack/environments/delete_rhelsub.yaml \ + -e /home/stack/environments/rhel_sub_config.yaml \ --ntp-server 1.ntp.esl.cisco.com # CHAPTER 7. EXECUTING POST UPGRADE STEPS @@ -553,6 +583,3 @@ source /home/stack/stackrc openstack overcloud image upload --update-existing --image-path /home/stack/images/ openstack overcloud node configure $(openstack baremetal node list -c UUID -f value) - - -# TODO(sambetts) Add code to reenable unsubscription from RHEL on delete From 2ff7b4e1f8778b770793b55b57d0d6a27c55412b Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Thu, 1 Nov 2018 10:56:40 +0000 Subject: [PATCH 37/38] Add python-gabbi workaround to osp10-13 upgrade --- .../osp10_osp13/tasks.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index 0056a6b..e11953a 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -583,3 +583,11 @@ source /home/stack/stackrc openstack overcloud image upload --update-existing --image-path /home/stack/images/ openstack overcloud node configure $(openstack baremetal node list -c UUID -f value) + +# Work around for python-gabbi version being out of date + +- name: Work around for BZ1613475 + shell: | + yum install -y python2-heat-tests-tempest + rpm -ql python2-heat-tests-tempest|xargs rm -f || true + become: true From b07af6a3ded82480c0a02b9b88e726a469323253 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Fri, 2 Nov 2018 11:15:36 +0000 Subject: [PATCH 38/38] Ensure we handle upgrading with the DCI RPM repo enabled --- .../osp10_osp13/tasks.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml index e11953a..07dddf3 100644 --- a/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml +++ b/installer/step5-upgrade-undercloud-and-overcloud/osp10_osp13/tasks.yaml @@ -65,6 +65,12 @@ state: disabled become: true +- name: Disable DCI openstack repos + file: + path: /etc/yum.repos.d/dci_repo.repo + state: absent + become: true + - name: Enable the OSP11 repo rhsm_repository: name: rhel-7-server-openstack-11-rpms @@ -133,6 +139,14 @@ name: rhel-7-server-openstack-13-rpms state: present become: true + when: dci_baseurl is not defined + +- name: Enable DCI openstack repos + get_url: + url: '{{ dci_baseurl }}/dci_repo/dci_repo.repo' + dest: /etc/yum.repos.d/dci_repo.repo + become: true + when: dci_baseurl is defined - name: Upgrade the director's main packages yum: