Skip to content

Provision a Contrail Cluster Using SM Lite

Nitish Krishna edited this page Sep 15, 2017 · 36 revisions

Server Manager Lite Overview

Server Manager Lite is a "no-frills" version of Server Manager. Except for reimage, rest of the functionality is same as Server Manager.

User can choose any server/node to install SM Lite. There are multiple options to run SM Lite as given below.

  • a single node (or VM) to provision contrail, then user might install SM Lite on the same node and perform contrail provisioning.
  • a separate node (or VM) to install SM Lite, and provision contrail with the rest of nodes.
  • choose a node (or VM) which might have contrail roles to install SM Lite (typically config node)

testbed.py or the same sample JSONs used with regular Server Manager can be used to specify servers and associated contrail roles along with cluster details.

The image details will come from the image JSON.

Note:

If you are installing SM lite on a VM spawned from Horizon or any other VM spawned from Ubuntu cloud image please follow the below steps

Verify that the VM has been setup correctly with the correct hostname/domain details. For this domain name should be present in /etc/hosts and /etc/resolv.conf. Examples are below:

/etc/hosts has to have a line:

<Host non mgmt IP> <server hostname>.<domain_name> <server hostname>

/etc/resolv.conf has to have a line:

search <domain_name>

"hostname -f" should return < hostname >.< domain_name >

Before you install the SM lite 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.

**As of now, SM lite install is only supported on Ubuntu 14.04.5 and 16.04.2 **

If you are installing SM lite on a multi-interface system, please add -ip option to provision_containers.sh script and give the IP that you want the SM to listen on. This IP must be reachable from all nodes in the cluster.

SM installer

Use regular contrail-server-manager-installer debian package. Example package is contrail-server-manager-installer_2.22~juno_all.deb

dpkg –i </github-build/mainline/<build_number>/ubuntu-14-04/mitaka/artifacts/contrail-server-manager-installer_4.0.0.0-<build-number>~mitaka_all.deb>

SM-Lite install/provision

Help:
`/opt/contrail/contrail_server_manager/provision_containers.sh -h`  
`-h --help`  
`-cj <cluster json path>` 
`-sj <server json path>`
`-ij <image json path>`
`-t|--testbed <testbed.py path>`
`-c <contrail cloud docker package path>`
`-cid|--cluster-id <cluster-id>`  
`-ni|--no-install-sm-lite`

-ni option is used to reprovision an existing cluster, create a new cluster, or upgrade an existing cluster with a different version.

Option 1: Using JSONS

a) If you are using R4.0 release package, then use the following command

/opt/contrail/contrail_server_manager/provision_containers.sh -cj <cluster json path> -sj <server json path> -ij <image json path>

b) If you are using post R4.0 release packages, then use the following command

/opt/contrail/contrail_server_manager/provision_containers.sh -j <combined json path>

Option 2: Using testbed.py and contrail-cloud-docker tgz

REMEMBER TO CHANGE ROLES as per this file

Testbed.py has been deprecated as an input to provision_containers script. Please use the below steps to convert testbed.py to combined JSON:

cd /opt/contrail/contrail_server_manager/packages
export DEBIAN_FRONTEND=noninteractive
dpkg -i python-paramiko_*.deb python-ecdsa_*.deb python-crypto_*.deb libgmp10_*.deb

After this, convert the file as below:

python /opt/contrail/contrail_server_manager/testbed_parser.py -t <path to testbed.py> -c <path to contrail-package> --cluster-id <any_name_you_want>

This will create a file combined.json in whichever folder you choose to run the script from. Now you can issue provision_containers using that json file:

/opt/contrail/contrail_server_manager/provision_containers.sh -j <combined json path>

NOTE: SMlite's provisioning logs can be seen at /var/log/contrail-server-manager/debug.log

provision_containers.sh tool tasks are -

  1. Install sm-lite (includes sm client, sm webui, sm monitoring/inventory)
  2. Prepare the targets for provision by running preconfig.py script on them
  3. Add server manager objects - cluster, server, image - from the JSONs or Testbed.py provided
  4. The docker containers get loaded and pushed to registry in the background
  5. Once this is done, issue contrail provision using server-manager client cli

The sample JSONS are provided below:

Sample JSONs for all in one node

Sample Combined JSON for all in one node

Sample JSONs for a Multi-Node Contrail-HA cluster

Sample JSONs for a Multi-Node Contrail-HA and OpenStack-HA cluster

Sample Tested.py file

Known issues:

Clone this wiki locally