Skip to content

Provision a Contrail Cluster using Server Manager

Nitish Krishna edited this page Sep 14, 2017 · 16 revisions

Introduction

This document describes step by step instructions to provision contrail docker containers using server manager. This WIKI describes provisioning all roles in one or more target nodes using build 3053 contrail images/containers. The following steps are covered as part of the end-to-end deployment process. Some of the steps are needed to be done only once, some other steps would need to be repeated for every new provisioning and there are certain manual steps described below, which are primarily to work around issues present, which would be addressed either as part of bug fixes available in later builds or changes to the deployment process itself.

  1. Installing Server Manager
  2. Creating objects - clusters, servers, images, containers - in server manager database, using SM rest api calls.
  3. Preparing target systems for provisioning
  4. Provisioning Contrail

Part 1: Installing Server Manager

Installing contrail server manager can be accomplished using standard SM installation process on a server running Ubuntu distribution of linux.

Before you install the SM package please ensure that the sources.list is empty and present and /etc/apt/sources.list.d/ is not pointing to any external or local repos.

  1. First install the Server Manager installer wrapper package which is of the form contrail-server-manager-installer_[version~sku].deb dpkg -i contrail-server-manager-installer_[version~sku].deb

  2. Install server manager using the following command: cd /opt/contrail/contrail_server_manager/; ./setup.sh --all --hostip=[IP Address of SM] This will install server manager and all its dependent packages including docker-engine and cobbler. ** NOTE: ** If the installation is over an existing Server Manager installation, the setup.sh script might fail to start the docker registry. In case this error is encountered, the workaround is i. to comment out the line containing the "docker run" command in the setup.sh script, ii. dpkg --purge contrail-server-manager and re-run the setup.sh as above.

  3. After the install completes, modify the dhcp template located at /etc/cobbler/dhcp.template to have the details of the subnet you are trying to reimage/provision including DNS details. Please note: the container hosts are expected to have internet connectivity to launch the containers as of now.

  4. Now you can start server manager process service contrail-server-manager start

For further details about installing Server Manager please refer to the Server Manager Install documentation here: [Server Manager Install] (http://www.juniper.net/techpubs/en_US/contrail3.0/topics/task/installation/install-server-manager-vnc.html#jd0e93)

This will complete the server manager installation and we are ready to start using server-manager commands to proceed with container provisioning.

Part 2: Creating objects

Once server manager is installed, create objects in SM database using following steps. The controller, analytics and analyticsDB services are all provisioned using contrail containers while the agent service is configured directly on the bare-metal target host.

Sample JSONs for all the below objects can be found here: Sample JSONs for an All-In-One-Node cluster

Or for a multi-node cluster involving 2 nodes, a variant of the JSONs are found here: Sample JSONs for a Multi-Node cluster

Or for a multi-node cluster with both Openstack and Contrail HA follow this sample which uses 9 nodes: Sample JSONs for a Multi-Node Contrail HA Cluster

1. Configure different images needed for reimaging and provisioning purpose as follows:

        i. Add Ubuntu Image from JSON (Used for reimaging). 
        server-manager add image –f image-ubuntu-14.04.04.json

        ii. Add Contrail Debian Image and containers from JSON 

        server-manager add image –f contrail_image.json

        Note: The above command continues in the background and might take up to 5 minutes depending on 
        the CPU load/capability. For now, there is no command to track the status of the command other than to 
        tail the contents of /var/log/contrail-server-manager/debug.log. 
        Please wait for "Image add/Modify success" in the log before proceeding.
2. Configure cluster and server

        server-manager add cluster -f multi_node_cluster.json

        Please note the keystone admin password if generated.

        server-manager add server -f contrail_server.json
        (Depending on the number of servers in the cluster, repeat the server 
         addition step for each server with appropriate server.json file)

Part 3: Preparing target systems for provisioning

This would involve reimaging the target systems (both openstack server and contrail server) with base Ubuntu OS. Please use following steps to accomplish this.

        i. server-manager reimage --cluster_id multi_node ubuntu_image

Part 4: Start provisioning

        Use following command to start the provisioning.

        i. server-manager provision —-cluster_id multi_node combined_image_mainline
   
        After this step, SM will first provision the "openstack" role using the traditional
        SM model involving puppet manifests and following that, it will start provisioning 
        contrail docker containers and computes on the appropriate nodes in the cluster based on
        the roles defined in each server configuration.

        The provisioning logs can be monitored by following the 
        /var/log/contrail-server-manager/debug.log

Provisioning is now complete. You can confirm this by creating VN and spawning VMs from the openstack node.

Known Issues

Clone this wiki locally