Downgrading Calico

About downgrading Calico

Under some circumstances, you may need to perform a downgrade and return your cluster to the previous version of Calico. If you need to downgrade you should do so as soon as possible to avoid an outage.

Important: After downgrading or aborting the migration it is necessary to delete the previously migrated etcd

Calico package downgrade

This procedure is the reverse of the upgrade procedure and varies slightly according to which operating system you are using.

Important: Do not use newer versions of calicoctl after the upgrade. This may result in unexpected behavior and data.

Downgrading an OpenStack cluster based on CentOS

Downgrade Calico components

The remainder of the procedure is the reverse of the upgrade procedure:

  1. Remove any upgraded calicoctl instances and install the previous calicoctl.

  2. On all nodes, change the location of the Calico packages to point to the 2.6.x repo:

    sudo sed -i 's/calico-3.1/calico-2.6/g' /etc/yum.repos.d/calico.repo 
    
  3. Downgrade the Control software:
    1. On all control nodes, wipe repo data and downgrade packages:
      sudo yum clean all
      sudo yum downgrade calico-common calico-control networking-calico
      
    2. On all control nodes, restart neutron-server:
      sudo systemctl restart neutron-server
      
  4. Downgrade the compute software

    1. On all compute nodes, remove the following line from /etc/calico/felix.cfg:
      DatastoreType = etcdv3
      

      If you changed the EtcdEndpoints address (e.g. because you installed a new etcdv3 cluster rather than upgrading your existing etcdv2 cluster), you should update the EtcdEndpoints addresses in /etcd/calico/felix.cfg at this point.

    2. On all compute nodes, update packages:
      sudo yum clean all
      sudo yum downgrade calico-common calico-compute calico-dhcp-agent calico-felix dnsmasq networking-calico
      
    3. Use the following command on the compute nodes to confirm that Felix has downgraded to v2.6.x.
      calico-felix --version
      

      It should return v2.6.x.

  5. You have completed the downgrade.

Downgrading an OpenStack cluster based on Ubuntu

  1. Remove any upgraded calicoctl instances and install the previous calicoctl.

  2. On all nodes, change the location of the Calico packages to point to the 2.6.x repo:

    sudo rm /etc/apt/sources.list.d/project-calico-calico-3_1-trusty.list 
    
  3. Downgrade the Control software:
    1. On all control nodes: Check the correct versions of downgraded packages with:
      apt-cache madison calico-control calico-common python-etcd networking-calico | grep calico-2.6
      

      Then use the available versions listed by the above command to create a downgrade command something like this:

      sudo apt-get install --reinstall \
        calico-control=1:1.1.2 \
        calico-common=2.6.5~trusty \
        python-etcd=0.4.3+calico.1-1 \
        networking-calico=1:1.4.3~trusty
      
    2. On all control nodes, restart neutron-server:
      sudo service neutron-server restart
      
  4. Downgrade the compute software

    1. On all compute nodes, remove the following line from /etc/calico/felix.cfg:
      DatastoreType = etcdv3
      

      If you changed the EtcdEndpoints address (e.g. because you installed a new etcdv3 cluster rather than upgrading your existing etcdv2 cluster), you should update the EtcdEndpoints addresses in /etcd/calico/felix.cfg at this point.

    2. On all compute nodes: Check the correct versions of downgraded packages with:
      sudo apt-get update
      apt-cache madison calico-compute calico-felix calico-common python-etcd networking-calico calico-dhcp-agent | grep calico-2.6
      

      Then use the available versions listed by the above command to create a downgrade command something like this:

      sudo apt-get install --reinstall \
        calico-compute=1:1.4.3~trusty \
        calico-felix=2.6.5~trusty \
        calico-common=2.6.5~trusty \
        python-etcd=0.4.3+calico.1-1 \
        networking-calico=1:1.4.3~trusty \
        calico-dhcp-agent=1:1.4.3~trusty
      
    3. Use the following command on the compute nodes to confirm that Felix has upgraded to v2.6.x.
      calico-felix --version
      

      It should return v2.6.x.

  5. You have completed the downgrade.