Allow complex upgrade deployment for N to O

* Remove the all-in-one case and implement the full workflow
for N to O upgrade.
* Fix nits in overcloud-repo and add ansible-pacemaker
* Remove old and useless workaround
* Remove external dependencies, this role is a post deployment role
  it should be able to be call independently, outside of a quickstart
  deployment

Change-Id: Ia2b1f5deb58560c51046dea3fc77996b08ad75a2
This commit is contained in:
Mathieu Bultel 2017-03-01 14:44:24 +01:00 committed by Ronelle Landy
parent 9b9b49a371
commit d7ad73ed35
7 changed files with 78 additions and 77 deletions

View File

@ -0,0 +1,6 @@
---
features:
- Add support for composable upgrade since Newton release. The workflow for
composable upgrade implement also the one for making mixed upgrade
https://blueprints.launchpad.net/tripleo/+spec/tripleo-composable-upgrade-job

View File

@ -1,5 +1,4 @@
---
network_isolation: true
# pre upgrade settings:
upgrade_overcloud_dns_server: 8.8.8.8
@ -21,7 +20,7 @@ repos_url:
- https://trunk.rdoproject.org/centos7-{{ target_upgrade_version }}/{{ upgrade_delorean_hash | default('current-passed-ci')}}/delorean.repo
- https://trunk.rdoproject.org/centos7-{{ target_upgrade_version }}/delorean-deps.repo
# upgrade settings:
upgrade_working_dir: "{{ working_dir }}"
upgrade_working_dir: "{{ working_dir|default('/home/stack') }}"
tht_dir: tripleo-heat-templates
tripleo_common_dir: /usr/share/openstack-tripleo-common
# containerized upgrade settings
@ -81,7 +80,9 @@ mixed_upgrade: false
enable_ceph: false
enable_pacemaker: true
# heat workers:
set_heat_workers: true
set_heat_workers: false
# Set external route for the controller
allow_external_traffic: false
# Update:
update_heat_stack_template: update-dnsserver.yaml
# TBR:

View File

@ -14,7 +14,7 @@
- upgrade-undercloud
- include: pre-overcloud.yml
when: step_pre_overcloud_upgrade|bool and target_upgrade_version in ['mitaka', 'newton']
when: step_pre_overcloud_upgrade|bool
tags:
- pre-upgrade-overcloud

View File

@ -22,7 +22,6 @@
{{ upgrade_working_dir }}/{{ tht_dir }};
- name: Add the no ssh finger print checking into upgrade-non-controller.sh
when: step_upgrade_undercloud
become: yes
shell: >
sed -i 's/ssh/ssh -o StrictHostKeyChecking=no/' \
@ -59,16 +58,3 @@
sed -i "/#num_engine_workers/a num_engine_workers = 6" /etc/heat/heat.conf;
sed -i "s/num_engine_workers.*$/num_engine_workers = 6/" /etc/heat/heat.conf;
systemctl restart openstack-heat-engine
- name: upgrade workaround for Newton
when: major_upgrade|bool and target_upgrade_version == 'master'
shell: >
sed -i '$acrudini --set \/etc\/nova\/nova.conf DEFAULT scheduler_host_manager host_manager' /home/stack/tripleo-heat-templates/extraconfig/tasks/major_upgrade_controller_pacemaker_1.sh;
sed -i 's/nova-manage db sync/nova-manage db sync\n nova-manage api_db sync\n/' /home/stack/tripleo-heat-templates/extraconfig/tasks/major_upgrade_controller_pacemaker_2.sh;
- name: fix grep to upgrade-non-controller.sh
when: major_upgrade|bool and target_upgrade_version == 'master'
become: yes
shell: >
sudo sed -i 's/nova show \$name_or_id | grep status /nova show \$name_or_id | grep -w status /' /bin/upgrade-non-controller.sh;

View File

@ -21,15 +21,17 @@ onerror(){
}
trap onerror ERR
{% if target_upgrade_version == 'newton' %}
# Note, tripleo-heat-templates rdo package is not up to date.
# It simlpier to clone the stable branch instead, while waiting of the
# latest fixes.
rm -rf "{{ working_dir }}/tripleo-heat-templates"
git clone https://github.com/openstack/tripleo-heat-templates.git -b stable/newton
{% endif %}
### --start_docs
## Upgrade the overcloud
## ==========================================
## Prepare Your Environment
## ------------------------
## * Source in the undercloud credentials.
## ::
source {{ upgrade_working_dir }}/stackrc
{% if target_upgrade_version in ['mitaka', 'newton'] %}
{% if target_upgrade_version == 'mitaka' %}
if heat stack-show overcloud | grep "stack_status " | egrep "(CREATE|UPDATE)_COMPLETE"; then
@ -129,8 +131,42 @@ if heat stack-show overcloud | grep "stack_status " | egrep "(CREATE|UPDATE)_COM
-e {{ tht_dir }}/environments/major-upgrade-pacemaker.yaml
fi
if heat stack-show overcloud | grep "stack_status " | egrep "(CREATE|UPDATE)_COMPLETE"; then
{% endif %}
{% if target_upgrade_version in ['ocata', 'master'] %}
## * Upgrade the controlplane.
## This step, set the Overcloud yum repository to the next release,
## then upgrade the control plane.
## ::
if openstack stack show -c stack_status overcloud -f value | egrep "(CREATE|UPDATE)_COMPLETE"; then
echo "execute overcloud upgrade"
openstack overcloud deploy --templates {{ tht_dir }} \
-e {{ tht_dir }}/overcloud-resource-registry-puppet.yaml \
{% if network_isolation|bool == true %}
-e {{ tht_dir }}/environments/network-isolation.yaml \
-e {{ tht_dir }}/environments/net-single-nic-with-vlans.yaml \
-e ~/network-environment.yaml \
{% endif %}
{% if enable_pacemaker|bool %}
-e {{ tht_dir }}/environments/puppet-pacemaker.yaml \
{% endif %}
-e {{ tht_dir }}/environments/major-upgrade-composable-steps.yaml \
{% for item in upgrade_custom_templates_script_delivery %}
-e {{ item }} \
{% endfor %}
{% for item in upgrade_custom_templates %}
-e {{ item }} \
{% endfor %}
fi
{% endif %}
if heat stack-show overcloud | grep "stack_status " | egrep "(CREATE|UPDATE)_COMPLETE"; then
## * Upgrade the non controller nodes.
## This step upgrade the non controller nodes to the next release and run
## the puppet converge step on nodes.
## ::
echo "get compute uuid and update compute"
for compute in $(nova list | grep compute | awk '{ print $2; }'); do
echo "Run upgrade on $compute"
@ -146,6 +182,8 @@ if heat stack-show overcloud | grep "stack_status " | egrep "(CREATE|UPDATE)_COM
{{ upgrade_non_controller_script }} --upgrade $ceph
done
fi
### --stop_docs
{% if target_upgrade_version not in ['ocata', 'master'] %}
if heat stack-show overcloud | grep "stack_status " | egrep "(CREATE|UPDATE)_COMPLETE"; then
echo "execute converge"
@ -162,33 +200,6 @@ if heat stack-show overcloud | grep "stack_status " | egrep "(CREATE|UPDATE)_COM
-e ~/network-environment.yaml
{% endif %}
fi
{% endif %}
{% if target_upgrade_version in ['ocata', 'master'] %}
if openstack stack show -c stack_status overcloud -f value | egrep "(CREATE|UPDATE)_COMPLETE"; then
echo "execute overcloud upgrade"
openstack overcloud deploy --templates {{ tht_dir }} \
-e {{ tht_dir }}/overcloud-resource-registry-puppet.yaml \
{% if network_isolation|bool %}
-e {{ tht_dir }}/environments/network-isolation.yaml \
-e {{ tht_dir }}/environments/net-single-nic-with-vlans.yaml \
-e ~/network-environment.yaml \
{% endif %}
{% if enable_pacemaker|bool %}
-e {{ tht_dir }}/environments/puppet-pacemaker.yaml \
{% endif %}
-e {{ tht_dir }}/environments/major-upgrade-all-in-one.yaml \
{% for item in upgrade_custom_templates_script_delivery %}
-e {{ item }} \
{% endfor %}
{% for item in upgrade_custom_templates %}
-e {{ item }} \
{% endfor %}
fi
{% endif %}

View File

@ -3,27 +3,26 @@ parameter_defaults:
set -e
pushd /etc/yum.repos.d/
rm -rf delorean*
{% if upgrade_delorean_hash == 'current-passed-ci' %}
curl -O -L https://buildlogs.centos.org/centos/7/cloud/x86_64/rdo-trunk-{{ target_upgrade_version }}-tested/delorean.repo
{% if target_upgrade_version == 'master' %}
curl -O -L https://trunk.rdoproject.org/centos7/current/delorean.repo
curl -O -L https://trunk.rdoproject.org/centos7/delorean-deps.repo
{% else %}
curl -O -L https://buildlogs.centos.org/centos/7/cloud/x86_64/rdo-trunk-{{ target_upgrade_version }}/delorean.repo
{% endif %}
{% if upgrade_delorean_hash == 'current-passed-ci' %}
curl -O -L https://trunk.rdoproject.org/centos7-{{ target_upgrade_version }}/current-passed-ci/delorean.repo
{% else %}
curl -O -L https://trunk.rdoproject.org/centos7-{{ target_upgrade_version }}/current/delorean.repo
{% endif %}
curl -O -L https://trunk.rdoproject.org/centos7-{{ target_upgrade_version }}/delorean-deps.repo
{% endif %}
popd
yum clean all
{% if target_upgrade_version in ['ocata', 'master'] %}
yum install -y python-heat-agent-*
yum install -y ansible-pacemaker
# update ansible.cfg
# FIXME: Workaround for bigswitch vendor pluging
# we need to remove those package which is broken with Ocata neutron python code
yum remove -y python-UcsSdk openstack-neutron-bigswitch-agent python-networking-bigswitch openstack-neutron-bigswitch-lldp python-networking-odl
crudini --set /etc/ansible/ansible.cfg DEFAULT library /usr/share/ansible-modules/
# Ref https://review.openstack.org/#/c/392615 disable the old hiera hook
# FIXME - this should probably be handled via packaging?
rm -f /usr/libexec/os-apply-config/templates/etc/puppet/hiera.yaml
rm -f /usr/libexec/os-refresh-config/configure.d/40-hiera-datafiles
rm -f /etc/puppet/hieradata/*.yaml
{% endif %}

View File

@ -3,17 +3,15 @@
set -eux
# Undercloud upgrade script.
# Those steps is for the major mariadb upgrade in mitaka
{% if target_upgrade_version == 'mitaka' and major_upgrade|bool %}
sudo systemctl stop openstack-*
sudo systemctl stop neutron-*
sudo systemctl stop 'openstack-*'
sudo systemctl stop 'neutron-*'
sudo systemctl stop httpd
#if you are going to do a backwards compatibility install save the old tht dir
# cp -r /usr/share/openstack-tripleo-heat-templates ~/tht
# update instack-undercloud and friends before running the upgrade
sudo yum -y update instack-undercloud openstack-puppet-modules openstack-tripleo-common python-tripleoclient
{% endif %}
{% if target_upgrade_version in ['newton', 'master'] and major_upgrade|bool or mixed_upgrade|bool %}
sudo yum -y update python-cachetools
sudo yum clean all && sudo yum clean metadata && sudo yum clean dbcache && sudo yum makecache
sudo systemctl stop openstack-*
sudo systemctl stop neutron-*
sudo yum -y update
{% endif %}
echo "Upgrade the undercloud"
openstack undercloud upgrade