Importing a Canonical Openstack Deployment Into Contrail Command
This document provides the steps needed to import a Canonical Openstack deployment into Contrail Command.
This procedure assumes that Contrail Command is already running in your Contrail Networking environment that is using Canonical Openstack as it’s orchestration platform. See How to Deploy Contrail Command and Import a Cluster Using Juju if you’d like to deploy Contrail Command and import the Contrail cluster into Contrail Command in an environment using Contrail Networking and Canonical Openstack.
Overview: Canonical Openstack Deployment into Contrail Command
Starting in Contrail Networking Release 2003, Canonical Openstack deployments can be managed using Contrail Command.
This document provides the steps needed to import a Canonical Openstack deployment into Contrail Command. Contrail Command can be used to manage the Canonical Openstack deployment after this procedure is complete.
This document makes the following assumptions about your environment:
A Canonical Openstack deployment managed by Contrail Networking is already operational.
Contrail Command is running in your environment. See Installing Contrail Command.
Contrail Command has access to the Juju jumphost and the Juju cluster.
Canonical Openstack is imported into Contrail Command using Juju in this procedure.
Importing Canonical Openstack Into Contrail Command
To import Canonical Openstack into Contrail Cloud:
- Install and start the Docker Engine.
There are multiple ways to perform this step. In this example, Docker Community Edition version 18.03 is installed using yum install and yum-config-manager commands and started using the systemctl start docker command.
yum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo yum install -y docker-ce-18.03.1.ce systemctl start docker
- Retrieve the contrail-command-deployer Docker
image by logging into hub.juniper.net and entering
the docker pull command.
docker login hub.juniper.net --username <container_registry_username> --password <container_registry_password> docker pull hub.juniper.net/contrail/contrail-command-deployer:<container_tag>
where <container_tag> is the container tag for the Contrail Command (UI) container deployment for the release that you are installing.
The <container_tag> for any Contrail Release 20xx image can be found in README Access to Contrail Registry 20XX
- Update the config.yml configuration file on the Contrail Command server.
The configuration of the config.yml file is unique to your environment and complete documentation describing all config.yml configuration options is beyond the scope of this document.
The following configuration parameters must be present in the config.yml file to support Canonical Openstack in Contrail Command:
The NTP_IP variable is the IP address of the NTP server.
The VROUTER_GATEWAY_IP variable is the IP address of the vRouter gateway. The vrouter_gateway: parameter can be left empty, but it must be present.
The CONTAINER_REGISTRY variable is the path to the container registry. The CONTAINER_REGISTRY is hub.juniper.net/contrail in most deployments.
The COMMAND_BUILD_TAG variable is the Contrail Command (UI) container deployment for the release that you are installing. For any Contrail Release 20xx image, you can retrieve this value from README Access to Contrail Registry 20XX
The CONTRAIL_BUILD_TAG variable is the Contrail build container for the release that you are installing. For any Contrail Release 20xx image, you can retrieve this value from README Access to Contrail Registry 20XX
- Run the Contrail Command deployer.
docker run -t --net host -e action=import_cluster -e orchestrator=juju -e juju_controller=<juju_controller> [-e juju_model=<juju_model_name> ] [-e juju_controller_user=<juju_controller_user>] [-e juju_controller_password=<juju_controller_password>] [-e delete_db=<delete_db>] [-e persist_rules=<persist-rules>] -v <config_file>:/cluster_config.yml --privileged --name contrail_command_deployer <CCD_image>
In the following example, Contrail Command is deployed from the Juju jump host at 172.31.40.101.
docker run -td --net host --privileged -e action=import_cluster -e orchestrator=juju -e juju_model=controller -e juju_controller=172.31.40.101 -e juju_controller_user=ubuntu -e juju_controller_password=password -v /home/ubuntu/contrail-command-deployer/config.yaml:/cluster_config.yml -v /root/.ssh:/root/.ssh contrail-command-deployer:latest
The command variables:
juju_controller—(Required) The IP address of the Juju jump host. We define the Juju jump host in this context as the device that has installed the Juju CLI and is being used to run Juju commands. The Contrail Command server must have access to the Juju jump host at this IP address.
config_file—(Required) The path to the configuration file. This configuration file was created in the previous step of this procedure.
CCD_image—(Required) The Contrail Command deployer image.
delete_db—(Optional) Specifies whether the PostgreSQL database is deleted during the process. The PostgreSQL database is deleted by default. Enter no in this field if you do not want the PostgreSQL database deleted.
persist-rules—(Optional) Specify whether IP rules remain persistent across reboots.
juju_model_name—(Optional) The name of the Juju model. The name can be retrieved by entering the juju show-models command.
juju_controller_user—(Optional) The username of the Juju user on the Juju jump server.
juju_controller_password—(Optional) The password for the Juju user on the Juju jumpbox. This password is used if no SSH keys have been installed.
- (Optional) Track the progress of step 4.
docker logs -f contrail_command_deployer
- Verify that the Contrail Command containers are running:
[root@centos254 ~]# docker ps -a CONTAINER ID IMAGE <trimmed> STATUS <trimmed> NAMES 2e62e778aa91 hub.juniper.net/... Up <trimmed> contrail_command c8442860e462 circleci/postgre... Up <trimmed> contrail_psql 57a666e93d1a hub.juniper.net/... Exited <trimmed> contrail_command_deployer
The contrail_command container is the GUI and the contrail_psql container is the database. Both containers should have a STATUS of Up.
The contrail-command-deployer container should have a STATUS of Exited because it exits when the installation is complete.
- Open a web browser and enter https://<Contrail-Command-Server-IP-Address>:8079 as a URL. The Contrail Command home screen appears.
Choose token from the drop-down menu. Enter the username and password combination to Juju as the credentials, and use admin_domain as the domain.