IN THIS PAGE
Upgrade Procedure for RHOSP-based Contrail 3.2.x to Contrail 4.1
This section presents the steps to upgrade an OSP-based Contrail deployment from Contrail version 3.2.x to Contrail version 4.1.
Prerequisite
Ensure you have a cloud up and running with RHOSP10 Z4 and Contrail 3.2 before you proceed with the upgrade procedure.
This procedure has been validated with the following Contrail, Red Hat, and OpenStack versions.
Contrail Version | Red Hat Version | OpenStack Version |
|---|---|---|
3.2.3 | RHEL 7.3 | RHOSP10 (packages dated Apr. 15, 2017) |
3.2.6 | RHEL 7.4 | RHOSP10 (packages dated Feb. 2, 2018) |
4.1 | RHEL 7.4 | RHOSP10 (packages dated Feb. 27, 2018) |
4.1.1 | RHEL 7.5 | RHOSP10 (packages dated Jun. 4, 2018) RHOSP11 (packages dated Jun. 4, 2018) |
For Contrail Release 4.1.1, you must ensure that the OpenJDK version is java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64. This is because of a compatibility issue that the Cassandra 3.0 package has with the latest version of Open JDK provided in RHEL 7.5.
You must add the correct version of OpenJDK to the Contrail repository and remove the older version of the package from the contrail controllers and analytics database.
To upgrade to OpenStack Platform release 10, you must first apply the patch for updating puppet-tripleo. This is because of a bug in the OpenStack Platform release OSP10 z8. For more information, see https://bugzilla.redhat.com/show_bug.cgi?id=1579184. This bug has been resolved in build puppet-tripleo-5.6.8-7.el7ost; see https://access.redhat.com/errata/RHBA-2018:2101. For more information about this bug, see https://bugs.launchpad.net/tripleo/+bug/1771324.
Upgrade the Undercloud
Upgrade the undercloud to the most current RHOSP10 version.
- Log in to the undercloud as the stack user.
su – stack - Update the Contrail repositories.
sudo rm –rf /etc/yum.repos.d/*contrail*curl http://newrepo.contrail41-dev.repo -o /etc/yum.repos.d/localrepo.repo - Stop the main OpenStack platform services.
sudo systemctl stop 'openstack-*' 'neutron-*' httpd - Update the
python-tripleoclientpackage and its dependencies to ensure you have the most current scripts for the minor version update.$ sudo yum update python-tripleoclient - Upgrade the undercloud.
$ openstack undercloud upgrade - Reboot the node.
$ sudo reboot - Wait until the node reboots, then check the status of
all services.
Note It can take as much as 10 minutes or more for the
openstack-nova-computeto become active after a reboot.$ sudo systemctl list-units "openstack*" "neutron*" "openvswitch*" - Verify the version of RHEL after the undercloud upgrade.
[root@undercloud ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.4 (Maipo) [root@undercloud ~]#
- Check the versions of the RHOSP images to verify that
the new images are available.
In the following example, the new images are
rhosp-director-images-ipa-10.0-20180103.3.el7ost.noarchandrhosp-director-images-10.0-20180103.3.el7ost.noarch.[root@undercloud ~]# rpm -qa | grep -i rhosp rhosp-director-images-ipa-10.0-20180103.3.el7ost.noarch rhosp-director-images-10.0-20180103.3.el7ost.noarch rhosp-director-images-ipa-10.0-20170615.1.el7ost.noarch rhosp-director-images-10.0-20170615.1.el7ost.noarch [root@undercloud ~]#
- Verify the existence of the overcloud and its nodes.
$ openstack stack list$ ironic node-list - Review the power status, provision state, and maintenance,
ensuring:
Power state is set to Power on
Provision state is set to Active
Maintenance is set to False
- Verify that all OpenStack servers are Active.
$ openstack server listFigure 1: Server List 
Update Red Hat Director Image Archives
The undercloud update process might download new image archives from the rhosp-director images and the rhosp-director-ipa packages. You’ll want to update your existing system with any new image archives.
- Check the yum log to determine if new image archives are
available.
$ sudo grep "rhosp-director-images" /var/log/yum.log[stack@undercloud ~]$ sudo grep "rhosp-director-images" /var/log/yum.log Feb 05 16:03:59 Installed: rhosp-director-images-ipa-10.0-20180103.3.el7ost.noarch Feb 05 16:04:54 Installed: rhosp-director-images-10.0-20180103.3.el7ost.noarch [stack@undercloud ~]$
- If new image archives are available, replace your current
images with the new images. Before deploying any new images, remove
any existing images from the images undercloud on the stack user’s
home (/home/stack/images).
$ rm -rf ~/images/* - Extract the new image archives.
mkdir images cd images for i in /usr/share/rhosp-director-images/overcloud-full-latest-10.0.tar /usr/share/rhosp-director-images/ironic-python-agent-latest-10.0.tar; do tar -xvf $i; done
- Install the Contrail package on the overcloud image by
using the virt-customize command.
export LIBGUESTFS_BACKEND=direct /usr/bin/virt-customize -a /home/stack/images/overcloud-full.qcow2 \ --copy-in /etc/yum.repos.d/mylocalrepo.repo:/etc/yum.repos.d \ --run-command 'yum -y install puppet-tripleo contrail-tripleo-puppet puppet-contrail‘\ --run-command ‘ cp -r /usr/share/contrail-tripleo-puppet/ /usr/share/openstack-puppet/modules/tripleo/ ‘ \ --run-command 'rm -fr /var/cache/yum/*' \ --run-command 'yum clean all' \ --selinux-relabel
- Import the new image archives into the undercloud and
configure nodes to use the new images.
$ openstack overcloud image upload --update-existing --image-path /home/stack/images/ - Verify that the images are uploaded.
$ glance image-list
- Show the details of the new image that has been created.
The new image will be used to add a new node in the overcloud.
$ glance image-show overcloud-full
- Observe the contrail-status on all Contrail nodes. All
services in the Contrail nodes, except the controller (OpenStack),
should be up and running before proceeding with the upgrade.
[stack@undercloud ~]$ for i in $(nova list | grep contrail | awk '{print $12}' | cut -d '=' -f2); do ssh heat-admin@$i sudo contrail-status; done
Prepare Repositories on all Nodes
- Delete existing repositories on all overcloud nodes. Be
sure to verify each deletion.
for ipnode in $(nova list | sed '4,$ !d;$d'| awk -F 'ctlplane=' '{print $2}' | tr -d '|'); do echo cleaning yum repolist on $ipnode && ssh heat-admin@$ipnode 'find /etc/yum.repos.d/ ! -name 'contrail-install.repo' -type f -exec sudo rm -f {} +' ; done - Add new repositories on all overcloud nodes. Be sure to
verify each addition.
for ipnode in $(nova list | sed '4,$ !d;$d'| awk -F 'ctlplane=' '{print $2}' | tr -d '|'); do echo cleaning yum repolist on $ipnode && ssh heat-admin@$ipnode ' curl http://newrepo.contrail41-dev.repo -o /etc/yum.repos.d/localrepo.rep' ; done
Upgrade the Operating System on Contrail Nodes
- Define a list ($iplist) that contains all Contrail nodes.
Iplist=” @IPcontrailController1 @IPContrailController2 …” - Upgrade the operating system for all nodes in the iplist.
for ipnode in $iplist; do echo -e "\n\n\t******upgrade node : $ipnode ******" && ssh heat-admin@$ipnode 'sudo yum update -y --disablerepo=*contrail* --skip-broken && exit' ; done
Prepare the Contrail Packages
Check the undercloud Contrail packages versions for contrail-tripleo-puppet, puppet-contrail, and contrail-tripleo-puppet. The newest
versions of those packages must be installed before proceeding with
the overcloud upgrade. See the following example, with current packages
versions.
[root@director-ctl ~]# rpm -qa | grep contrail contrail-tripleo-puppet-4.1.0.0-8.el7.noarch contrail-tripleo-heat-templates-4.1.0.0-8.el7.noarch puppet-contrail-4.1.0.0-8.el7.noarch
Upgrade the Contrail Heat Templates
You must copy the new Contrail Heat templates package to the undercloud node, while retaining a copy of the Heat templates that were used for the existing deployment.
- Make a copy of all of the Heat templates that were used for deployment and save the copies, because the existing files will be overwritten by the new versions. The templates to copy are of the form contrail-services.yaml, contrail-net.yaml, and so on.
- Copy the new contrail-tripleo-heat templates to the undercloud
node.
cp -r /usr/share/contrail-tripleo-heat-templates/environments/contrail /home/stack/templates/openstack-tripleo-heat-templates/environments/ cp -r /usr/share/contrail-tripleo-heat-templates/puppet/services/network/* /home/stack/templates/openstack-tripleo-heat-templates/puppet/services/network
Modify the Yum Update Script for TripleO Puppet
Before starting the upgrade, a few Puppet commands must be added to the yum_update script, located at:
/home/stack/templates/openstack-tripleo-heat-templates/extraconfig/tasks/yum_update.sh
- Update the following Puppet commands in the yum_update.sh.
Refer to the following patch for details regarding the exact placement
of the commands patch: https://github.com/Juniper/contrail-tripleo-heat-templates/blob/stable/newton/environments/contrail/yum_updates.patch
yum install -y contrail-tripleo-puppet puppet-contrailrsync -a /usr/share/contrail-tripleo-puppet/ /usr/share/openstack-puppet/modules/tripleo/ - Ensure that the new version of the packages puppet-contrail
and contrail-tripleo-puppet have been installed on the Contrail nodes,
and that contrail-tripleo-puppet has been copied to openstack-puppet.
rm -rf /usr/share/openstack-puppet/modules/tripleo/contrail-tripleo-puppetcp -R /usr/share/contrail-tripleo-puppet/ /usr/share/openstack-puppet/modules/tripleo - Update the fields
*contrail versionand*contrail repoincontrail-services.yaml.Filename:
\templates/environments/contrail/contrail-services.yaml.Add the following parameters:
ContrailVersion: 4
ContrailRepo : <location of the contrail-41 repo>
Update the Overcloud Deployment Plan
- Update the current plan by rerunning the command used
for cloud deployment and adding the suffix
- -update-plan-only.<openstack overcloud deploy> –update-plan-only
Example
openstack overcloud deploy --update-plan-only --templates /home/stack/tripleo-heat-templates/ \ --roles-file /home/stack/tripleo-heat-templates/environments/contrail/roles_data.yaml \ -e /home/stack/tripleo-heat-templates/environments/puppet-pacemaker.yaml \ -e /home/stack/tripleo-heat-templates/environments/contrail/contrail-services.yaml \ -e /home/stack/tripleo-heat-templates/environments/contrail/network-isolation.yaml \ -e /home/stack/tripleo-heat-templates/environments/contrail/contrail-net.yaml \ -e /home/stack/tripleo-heat-templates/environments/ips-from-pool-all.yaml \ -e /home/stack/tripleo-heat-templates/environments/network-management.yaml \ -e /home/stack/tripleo-heat-templates/extraconfig/pre_deploy/rhel-registration/environment-rhel-registration.yaml \ -e /home/stack/tripleo-heat-templates/extraconfig/pre_deploy/rhel-registration/rhel-registration-resource-registry.yaml \ --libvirt-type qemu
- Make a copy of the existing deploy script to the
update-stack.sh. Theupdate-stack.shis the script used to update the overcloud plan, and it references the same templates that were used to deploy the stack. All files used for the overcloud update should be identical to the files used for deployment, with the exception of thecontrail-servicesfile that was updated with the latestcontrail-versionandcontrail-repo.cp deploy.sh update-stack.sh - Update the deployment plan.
./update-stack.sh
Upgrade Cautions
The steps to perform the overcloud upgrade are service disrupting, and should only be performed within a maintenance window.
Potential Packages Failures
Read the following before proceeding with the overcloud upgrade. The upgrade may fail due to packages conflicts in Contrail nodes for analytics, analytics database, and Contrail controllers. Some observed failures due to packages conflicts are detailed in this section.
OpenStack Undercloud Upgrade Failure
From Version: RHEL-7.3 with rhosp-director-images-10.0-20170228.1.el7ost.noarch
To Version: RHEL-7.5 with rhosp-director-images-10.0-20180628.2.el7ost.noarch
OpenStack undercloud upgrade may fail with the following error message:
INFO: 2018-06-13 20:17:03 - Could not retrieve fact='current_nova_host', resolution='<anonymous>': uninitialized constant Tempfile 2018-06-13 20:17:04,404 INFO: 2018-06-13 20:17:04 - ^[[1;31mError: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type sysctl::value at /etc/puppet/manifests/puppet-stack-config.pp:24 on node undercloud.example.com^[[0m
For more information about this error, see https://bugs.launchpad.net/juniperopenstack/+bug/1792036.
Contrail-api Service Not Restarted During Upgrade
Contrail-api remains in the initializing state during upgrade. Modify the puppet file as described in https://github.com/Juniper/puppet-contrail/commit/b5ec14743d6c13cf847f277f1d28a404931c7b0e.
Contrail-api Service Down After Upgrade
You can resolve this issue by removing the admin_token entry from the /etc/contrail/contrail-keystone-auth.conf file. For more information, see https://bugs.launchpad.net/juniperopenstack/+bug/1791861.
Overcloud Update Failure
Upgrade from OpenStack Platform release 10 GA image to the latest version hangs because of a systemd bug. For more information, see https://bugzilla.redhat.com/show_bug.cgi?id=1582338
Solution:
- Run the following command before you start the update:
source ~/stackrc for address in $(openstack server list -f json | jq -r -c '.[] | .Networks' | grep -oP '[0-9.]+'); do \ ssh -q -o StrictHostKeyChecking=no heat-admin@$address \ 'sudo yum install -y yum-plugin-versionlock; \ sudo yum versionlock add systemd systemd-libs libgudev1 systemd-sysv rsyslog;' done
- Run the overcloud update.
- Run the following command:
source ~/stackrc for address in $(openstack server list -f json | jq -r -c '.[] | .Networks' | grep -oP '[0-9.]+'); do \ ssh -q -o StrictHostKeyChecking=no heat-admin@$address \ 'sudo yum versionlock del systemd systemd-libs libgudev1 systemd-sysv rsyslog; sudo yum update -y' done
- Restart the node.
Analytics Database Failure
You may encounter a Cassandra package version conflict issue.
Error message: cassandra22 conflicts with cassandra-3.10-0contrail0.el7.centos.noarch
Solution: Remove the cassandra22 package.
sudo rpm -e --nodeps cassandra22-2.2.8-1.noarch
Analytics Node Failure
Error message: file /usr/lib/python2.7/site-packages/redis/__init__.py
from install of python-redis-2.10.3-3.el7ost.noarch conflicts with
file from package redis-py-0.1-2contrail.el7.noarch
Solution: Remove the redis-py package.
sudo rpm -e python-redis-2.10.3-3.el7ost.noarch
Contrail Controller Failure
Error message: cassandra22 conflicts with cassandra-3.10-0contrail0.el7.centos.noarch
Solution: Remove the cassandra22 package.
sudo rpm -e --nodeps cassandra22-2.2.8-1.noarch
You can delete redis-py from the analytics node, and delete cassandra22 from the analytics database and the Contrail controllers node.
Contrail vRouter Package Conflict
Error message: /etc/init.d/contrail-vrouter-nodemgr
conflicts between attempted installs of contrail-openstack-vrouter-4.1.0.0-8.el7.noarch
and contrail-vrouter-agent-4.1.0.0-8.el7.x86_64
Solution: Remove the contrail-openstack-vrouter.
yum remove contrail-openstack-vrouter
Analytics Node snmp-lib Version Conflict
Error message: duplicate versions of net-snmp-libs
-> net-snmp-libs-5.7.2-28.el7_4.1.x86_64 is a duplicate with 1:net-snmp-libs-5.7.2-28.el7.i686
Solution:
rpm -e --nodeps net-snmp-libs
Upgrade the Overcloud
The steps in this section are service disrupting, and should only be performed within a maintenance window.
- Update the overcloud stack.
$ openstack overcloud update stack -i overcloud2018-02-09 16:24:46Z [overcloud]: UPDATE_COMPLETE Stack UPDATE completed successfully Stack overcloud UPDATE_COMPLETE Overcloud Endpoint: http://19x.xxx.xxx.xx:5000/v2.0 Overcloud Deployed
- Verify the overcloud stack status, the contrail-status,
and the contrail-version after the upgrade.
Overcloud Stack Status
[stack@undercloud ~]$ openstack stack list+--------------------------------------+------------+-----------------+----------------------+----------------------+ | ID | Stack Name | Stack Status | Creation Time | Updated Time | +--------------------------------------+------------+-----------------+----------------------+----------------------+ | e56c5512-3e32-4940-a05a-e194f48ce67a | overcloud | UPDATE_COMPLETE | 2018-02-16T20:32:17Z | 2018-02-21T01:12:08Z | +--------------------------------------+------------+-----------------+----------------------+----------------------+ [stack@undercloud ~]$
Contrail Stack Status
for i in $(nova list | grep contrail | awk '{print $12}' | cut -d '=' -f2); do ssh heat-admin@$i sudo contrail-status; doneContrail Version Check
for i in $(nova list | grep contrail | awk '{print $12}' | cut -d '=' -f2); do ssh heat-admin@$i sudo contrail-version; done
Contrail Service Recovery After Upgrade
Upon completing the upgrade, you might have some Contrail services reporting status down on some nodes. this section provides recovery suggestions for different services.
Contrail Controller Services
In a recent upgrade, the following services were down in the Contrail controller nodes.
contrail-control — failed
contrail-dns — failed
To determine the root cause of these failures, check the Contrail
logs in /var/log/contrail/ .
In this example, it was the IFMap and Discovery services causing the failures, because those services are no longer used in the Contrail 4.x releases.
Solution
- Remove the IFMap and Discover configuration sections from:
/etc/contrail/contrail-control.conf/etc/contrail/contrail-dns.conf
- Restart the services contrail-controller and contrail-dns.
service contrail-control restart
service contrail-dns restart
- Verify that the services contrail-controller and contrail-dns
are up and running after the restart.
contrail-status
Contrail Compute Services
On the Contrail compute node, the contrail-vrouter-agent service might be down after the upgrade. The vrouter agent is dependent
on the kernel module. The RHEL7.3 has been upgraded to RHEL7.4, and
the node needs to b rebooted to ensure the correct kernel module gets
loaded.
- Reboot the node.
- After reboot, restart the vrouter service..
service supervisor-vrouter restart
- Verify that all Contrail services are up and running.
contrail-status