Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?


Upgrading Contrail Networking to Release 21.4.L3 using Ansible Deployer in Service Software Upgrade Procedure in OpenStack Environment

When to Use This Procedure?


Before performing any upgrade procedure, install Docker serially over containers. However, you can upgrade computes in parallel to Docker via script. After upgrading each docker host, verify the status of contrail and services. Do not proceed with upgrade on next hosts until all the services of contrail-status reports are running properly.

Use the following script to stop the running containers, upgrade the docker, and bring containers back:

It is recommended to use Zero Impact Upgrade (ZIU) procedures to upgrade Contrail Networking with minimal network disruption in most environments using Openstack orchestration.

To perform a ZIU upgrade, follow the instructions in How to Perform a Zero Impact Contrail Networking Upgrade using the Ansible Deployer. If you are running Red Hat Openstack 13 or 16.1, see Updating Contrail Networking using the Zero Impact Upgrade Process in an Environment using Red Hat Openstack 13 or Updating Contrail Networking using the Zero Impact Upgrade Process in an Environment using Red Hat Openstack 16.1.

The procedure in this document also provides a method of upgrading Contrail Networking with minimal network disruption using the Ansible deployer in environments using Openstack orchestration.

The procedure in this document has been validated to upgrade Contrail Networking from Release 3.2 or later to Release 5.0 or later. The starting Contrail release for this upgrade can be any Contrail Networking Release after Release 3.2, including all Contrail Networking 4, 5, 19, 20, and 21 releases. The target release for this upgrade can be any Contrail Networking Release after Release 5.0, including all Contrail Networking 5, 19, 20, and 21 releases.

Table 1: Contrail Networking Validated Upgrade Scenarios

Starting Contrail Networking Release

Target Upgraded Contrail Networking Release

Release 3.2 or Later

Any Release 4

Any Release 5

Any Release 19

Any Release 20

Any Release 21

Any Release 5

Any Release 19

Any Release 20

Any Release 21

Contrail In-Service Software Upgrade (ISSU) Overview

If your installed version is Contrail Release 3.2 or higher, you can perform an in-service software upgrade (ISSU) to perform this upgrade using the Ansible deployer. In performing the ISSU, the Contrail controller cluster is upgraded side-by-side with a parallel setup, and the compute nodes are upgraded in place.


We recommend that you take snapshots of your current system before you proceed with the upgrade process.

The procedure for performing the ISSU using the Contrail Ansible deployer is similar to previous ISSU upgrade procedures.


This Contrail ansible deployer ISSU procedure does not include steps for upgrading OpenStack. If an OpenStack version upgrade is required, it should be performed using applicable OpenStack procedures.

In summary, the ISSU process consists of the following parts, in sequence:

  1. Deploy the new cluster.

  2. Synchronize the new and old clusters.

  3. Upgrade the compute nodes.

  4. Finalize the synchronization and complete the upgrades.


The following prerequisites are required to use the Contrail ansible deployer ISSU procedure:

  • A previous version of Contrail installed, no earlier than Release 3.2.

  • There are OpenStack controller and compute nodes, and Contrail nodes.

  • OpenStack needs to have been installed from packages.

  • Contrail and OpenStack should be installed on different nodes.


Upgrade for compute nodes with Ubuntu 14.04 is not supported. Compute nodes need to be upgraded to Ubuntu 16.04 first.

Preparing the Contrail System for the Ansible Deployer ISSU Procedure

In summary, these are the general steps for the system preparation phase of the Contrail ansible deployer ISSU procedure:

  1. Deploy the new version of Contrail using the Contrail ansible deployer, but make sure to include only the following Contrail controller services:

    • Config

    • Control

    • Analytics

    • Databases

    • Any additional support services like rmq, kafka, and zookeeper. (The vrouter service will be deployed later on the old compute nodes.)


    You must provide keystone authorization information for setup.

  2. After deployment is finished, you can log into the Contrail web interface to verify that it works.

The detailed steps for deploying the new controller using the ansible deployer are as follows:

  1. To deploy the new controller, download contrail-ansible-deployer-release-tag.tgz onto your provisioning host from Juniper Networks.

  2. The new controller file config/instances.yaml appears as follows, with actual values in place of the variables as shown in the example:

  3. Finally, run the ansible playbooks to deploy the new controller.

After successful completion of these commands, the new controller should be up and alive.

Provisioning Control Nodes and Performing Synchronization Steps

In summary, these are the general steps for the node provisioning and synchronization phase of the Contrail ansible deployer ISSU procedure:

  1. Provision new control nodes in the old cluster and old control nodes in the new cluster.

  2. Stop the following containers in the new cluster on all nodes:

    • contrail-device-manager

    • contrail-schema-transformer

    • contrail-svcmonitor

  3. Switch the new controller into maintenance mode to prevent provisioning computes in the new cluster.

  4. Prepare the config file for the ISSU.

  5. Run the pre-sync script from the ISSU package.

  6. Run the run-sync script from the ISSU package in background mode.

The detailed steps to provision the control nodes and perform the synchronization are as follows:

  1. Pair the old control nodes in the new cluster. It is recommended to run it from any config-api container.

  2. Run the following command for each old control node, substituting actual values where indicated:

  3. Pair the new control nodes in the old cluster with similar commands (the specific syntax depends on the deployment method of the old cluster), again substituting actual values where indicated.

  4. Stop all the containers for contrail-device-manager, contrail-schema-transformer, and contrail-svcmonitor in the new cluster on all controller nodes.

  5. Perform the following steps to delete the contrail-device-manager queue from Contrail rabbitmq after the contrail-device-manager container is stopped.


    Run the commands listed in this step from only one new controller.

    1. Enter the Contrail rabbitmq container.

    2. Find the name of the contrail-device-manager queue.

    3. Delete the contrail-device-manager queue.

These next steps should be performed from any new controller. Then the configuration prepared for ISSU runs. (For now, only manual preparation is available.)


In various deployments, old cassandra may use port 9160 or 9161. You can learn the configuration details for the old services on any old controller node, in the file /etc/contrail-contrail-api.conf.

The configuration appears as follows and can be stored locally:

  1. Detect the config-api image ID.

  2. Run the pre-synchronization.

  3. Run the run-synchronization.

  4. Check the logs of the run-sync process. To do this, open the run-sync container.

Transferring the Compute Nodes into the New Cluster

In summary, these are the general steps for the node transfer phase of the Contrail ansible deployer ISSU procedure:


Before transferring the Compute Nodes into a new cluster, make sure that docker was successfully updated.

  1. Select the compute node(s) for transferring into the new cluster. This selects the virtual machines of the compute node(s).

  2. Migrate the Virtual Machines (VMs) manually from one compute node to another. The steps are as follows:


    This procedure is useful when live migration cannot be done.

    1. Identify the VM to migrate and its host. Run the following command to stop VM.

    2. Identify the VM disk image location on the source compute node where the VM instance was launched, Usually, the disk image location is:

    3. Copy this directory to the destination compute node.

    4. On the destination compute node, run the following command to change the permission of this directory:

    5. Update the nova database of this instance to new host.


    6. Run the following command to start the VM

  3. For Contrail Release 3.x, remove Contrail from the node(s) as follows:

    • Stop the vrouter-agent service.

    • Remove the vhost0 interface.

    • Switch the physical interface down, then up.

    • Remove the vrouter.ko module from the kernel.

  4. For Contrail Release 4.x and later, remove Contrail from the node(s) as follows:

    • Stop the agent container.

    • Restore the physical interface.

  5. Update docker.

  6. Remove vrouter_vrouter-agent_1 and vrouter_nodemgr_1.

  7. Stop vhost0.

  8. Add the required node(s) to instances.yml with the roles vrouter and openstack_legacy_compute.

  9. Run the Contrail ansible deployer to deploy the new vrouter and to configure the old compute service.

  10. All new compute nodes will have:

    • The collector setting pointed to the new Contrail cluster

    • The Control/DNS nodes pointed to the new Contrail cluster

    • The config-api setting in vnc_api_lib.ini pointed to the new Contrail cluster

  11. (Optional) Run a test workload on transferred nodes to ensure the new vrouter-agent works correctly.

Follow these steps to rollback a compute node, if needed:

  1. Move the workload from the compute node.

  2. Stop the new Contrail containers.

  3. Ensure the network configuration has been successfully reverted.

  4. Deploy the previous version of Contrail using the deployment method for that version.

The detailed steps for transferring compute nodes into the new cluster are as follows:


After moving workload from the chosen compute nodes, you should remove the previous version of contrail-agent. For example, for Ubuntu 16.04 and vrouter-agent installed directly on the host, these would be the steps to remove the previous contrail-agent:

For other kind of deployments remove the vrouter-agent and vrouter-agent-nodemgr containers, and disable vhost0 interface.

  1. The new instance should be added to instances.yaml with two roles: vrouter and openstack_compute_legacy. To avoid reprovisioning the compute node, set the maintenance mode to TRUE. For example:

    Make sure that instances.yaml nodes definition includes only the compute nodes you want to upgrade. All other nodes should be commented out.

  2. Run the ansible playbooks.

  3. The contrail-status for the compute node appears as follows:

  4. Restart contrail-control on all new controller nodes after the upgrade is complete:
  5. After upgrading the compute nodes, XMPP goes down due to SSLhandshake issue. Example:

    The steps to bring up XMPP are as follows:

    1. Copy the following two files from new control node to upgraded compute node:
    2. Restart the VRouter agent of upgraded compute node.

  6. Check status of new compute nodes by running contrail-status on them. All components should be active now. You can also check the status of the new instance by creating AZ/aggregates with the new compute nodes and run some test workloads to ensure it operates correctly.

Finalizing the Contrail Ansible Deployer ISSU Process

Finalize the Contrail ansible deployer ISSU as follows:

  1. Stop the issu-run-sync container.

  2. Run the post synchronization commands.

  3. Run the following commands on all the new controller nodes.

  4. Restart the container.

  5. Disengage maintenance mode and start all previously stopped containers. To do this, set the entry MAINTENANCE_MODE in instances.yaml to FALSE, then run the following command from the deployment node:

    During this step, only compute nodes should be included in the instances.yaml, and other nodes should be commented out.

  6. Clean up and remove the old Contrail controllers. Use the script called from the config-api container with the config issu.conf. Replace the credential variables and API server IP with appropriate values as indicated.


    Currently, the previous step works only with hostname and not with IP Address.

  7. Run the following commands from any controller node.


    All *host_info parameters should contain the list of new hosts.

  8. Servers can be cleaned up if there are no other services present.

  9. Navigate to the following path in old controller:
  10. Modify the api_server_ip and analytics_api_ip addresses with the new controller IP addresses.

  11. Restart the neutron-server container in old controller.

  12. Go to neutron_server container in the old control node. Verify whether the ContrailPlugin.ini file contains new controller IP's or not. It should contain new controller IP's.

  13. The heat configuration needs the same changes. Locate the parameter [clients_contrail]/api_server and change it to point to the list of the new config-api IP addresses.

  14. To resync the database:

    1. Login to the zookeeper container.

    2. Go to the bin directory.

    3. Connect to zookeeper.

    4. Delete the lock on zookeeper container.

    5. Quit and exit from the zookeeper container.

    6. Restart the Config API server container and wait for the Contrail status to be up.

    7. Restart the Control container.

Troubleshooting link-loop in Release 21.4.L2

The ansible deployer of Contrail Networking Release 21.4.L2 introduces link-loop in the /var/log/contrail directory present in the contrail config nodes. This happens every time the Contrail Networking Release 21.4.L2 ansible deployer is started. Re-running ansible deployer playbooks fails due to mentioned recursion. This issue is resolved in Contrail Networking Release 21.4.L3. However, for Contrail Networking Release 21.4.L2, it requires a manual intervention to follow the given workaround.

Workaround: Manually remove the incorrect symlink from all contrail config nodes: