Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

Upgrading Contrail Command using Backup Restore Procedure

 

You cannot use the SQL data with the new version of Contrail Command container if the database schema changes while upgrading the Contrail Command container.

You can resolve the issue by:

  1. Back up SQL database in yaml format db dump.

    Run the following docker exec contrail_command command on the Contrail Command node to backup the DB.

    Contrail Networking Release 2005 or later:

    docker exec contrail_command commandutil convert --intype rdbms --outtype yaml --out /etc/contrail/db.yml -c /etc/contrail/command-app-server.yml; mkdir ~/backups; mv /etc/contrail/db.yml ~/backups/

    Contrail Networking Release 2003 or earlier:

    docker exec contrail_command contrailutil convert --intype rdbms --outtype yaml --out /etc/contrail/db.yml -c /etc/contrail/contrail.yml; mkdir ~/backups; mv /etc/contrail/db.yml ~/backups/

  2. Upgrade the Contrail Command container.

    Specify the desired version of Contrail Command container (container_tag) in the deployer input file (command_servers.yml) and deploy playbook.

    You must use PostgreSQL in the command_servers.yml file.

    The step depends on how you have deployed the Contrail Command.

    • Contrail Command is deployed using docker installation:

      docker run -td --net host -v <ABSOLUTE_PATH_OF_COMMAND_SERVERS_FILE>:/command_servers.yml --privileged --name contrail_command_deployer_<contrail_container_tag> hub.juniper.net/contrail/contrail-command-deployer:<<contrail_container_tag>

    • Contrail Command is deployed through juju-charms:

      juju config contrail-command image-tag=<contrail_container_tag>

    The contrail_container_tag for any Contrail Release 20 software can be obtained from README Access to Contrail Networking Registry 20xx  .

  3. This step depends on your Contrail Networking release.

    Contrail Networking Release 2005 or later:

    Migrate the yaml formatted db dump to the new database schema:

    Contrail Networking Release 2003 or earlier:

    Modify the yaml-formatted db dump by adding or removing the fields per the new database schema.

  4. Restore the modified yaml formatted db dump to the SQL database.

    Contrail Networking Release 2005 or later:

    Contrail Networking Release 2003 or earlier:

Note

If the restore procedure fails because of schema mismatch, repeat Step 3 and Step 4 with incremental db dump changes.