Juniper/Contrail_Ansible_TP_Integration

Name: Contrail_Ansible_TP_Integration

Owner: Juniper Networks

Description: Contrail Ansible for Third-party OS

Forked from: gokulpch/Contrail_Ansible_TP_Integration

Created: 2018-02-06 20:27:41.0

Updated: 2018-02-06 20:27:44.0

Pushed: 2017-09-25 18:47:45.0

Homepage: null

Size: 659

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Contrail_Ansible_TP_Integration

Contrail Ansible for Third-party OS

Preperation of Hosts
Install initial Dependencies on the servers that host the Containers (these are not required for the compute nodes)

Install the following packages on all the nodes where the containers are created:

install kernel-devel kernel-headers nfs-utils socat wget git patch ntp createrepo -y && reboot
Install latest Docker on the nodes

This can be done using Ansible which installs a previous version (yum) which is not supported by contrail. Copy and paste the lines below on all the nodes intended for the Containers:

 "Installing Latest Docker Version"
 yum check-update
-get installs older version of docker when used yum install
 -fsSL https://get.docker.com/ | sh;
rt docker-engine service
 "Start Docker Engine"
 systemctl start docker;
ck status docker-engine service
 "Displaying the status of docker"
 systemctl status docker;
ble the docker-engine service
 "Check Docker Status and Enable the Service"
 systemctl enable docker;
sh iptables temporarily
bles --flush;
Ansible Configuration
Clone Ansible Repository
clone https://github.com/gokulpch/Contrail_Ansible_TP_Integration.git
Create a Directory in Contrail_Ansible_TP_Integration/contrail-ansible/playbooks for Container Images

By default ansible picks up the images from this path if no Docker repo information is specified in all.yaml

r -p Contrail_Ansible_TP_Integration/contrail-ansible/playbooks/container_images
Place all the container images in the directory created above

Following are the images that are needed for the install (sample):

@hostx# tar -xzvf contrail-docker-images_4.0.1.0-32.tgz
@hostx:~/Contrail_Ansible_TP_Integration/contrail-ansible/playbooks/container_images# ls -lrth
l 3.5G
r--r-- 1 33694  757 638M Sep 23 03:17 contrail-controller-ubuntu16.04-4.0.1.0-32.tar.gz
r--r-- 1 33694  757 247M Sep 23 03:17 contrail-analytics-ubuntu16.04-4.0.1.0-32.tar.gz
r--r-- 1 33694  757 276M Sep 23 03:17 contrail-agent-ubuntu16.04-4.0.1.0-32.tar.gz
r--r-- 1 33694  757 496M Sep 23 03:17 contrail-analyticsdb-ubuntu16.04-4.0.1.0-32.tar.gz
r--r-- 1 33694  757 109M Sep 23 03:17 contrail-lb-ubuntu16.04-4.0.1.0-32.tar.gz

Untar the archive with the images.

Following are the Configuration parameters that has to be changed as required hosts (Contrail_Ansible_TP_Integration/contrail-ansible/playbooks/inventory/my-inventory/hosts)

This is the Ansible Hosts file which defines the nodes role and IP information.

able contrail-repo when required - this will start a contrail apt or yum repo container on specified node
is repo will be used by other nodes on installing any packages in the node
tting up contrail-cni need this repo enabled
TE: Repo is required only for mesos and nested mode kubernetes
ntrail-repo]
.168.0.24

trail-controllers]
7.1.54
7.1.61
7.1.56

trail-analyticsdb]
7.1.54
7.1.61
7.1.56

trail-analytics]
7.1.54
7.1.61
7.1.56

trail-compute]


trail-lb]
7.1.57


ly enable if you setup with openstack (when cloud_orchestrator is openstack)

enstack-controllers]
.168.0.23

bernetes Nested Mode.
derlay Contrail Api Server to which kubernetes instance should
nnect to. This is to be set for ONLY for nested kubernetes installation.
bernetes-contrail-controllers]
.168.0.24

bernetes Nested Mode.
derlay Contrail Analytics Server to which kubernetes instance should
nnect to. This is to be set for ONLY for nested kubernetes installation.
bernetes-contrail-analytics]
.168.0.24
all.yml (Contrail_Ansible_TP_Integration/contrail-ansible/playbooks/inventory/my-inventory/group_vars/all.yml)

This is the Central configuration file for various contrail related parameters. The cloned repo already has a sample file, following are the parametes that are to be changed as required.

Run Ansible

Path: Contrail_Ansible_TP_Integration/contrail-ansible/playbooks/

ble-playbook  -i inventory/my-inventory site.yml -vv
Custom Configuration Changes

*Change parameters of vnc_api_lib.ini for contrail-alarm-gen service to be active. Once the installation is complete the contrail-alarm-gen service on the analytics containers will be in inactive state the following are the changes that are needed to activate the service.

In Analytics Container: /etc/contrail/vnc_api_lib.ini

bal]
SERVER = 10.87.1.57
PORT = 8082

_URL = /
E_URL = /tenants/infra ; common-prefix for all URLs

thentication settings (optional)
h]
N_TYPE = keystone
N_PROTOCOL = https
N_SERVER = juniper.cos8.net
N_PORT = 443
N_URL = /keystone/v2.0/tokens
N_TOKEN_URL = https://juniper.cos8.net/keystone/v2.0/tokens
HN_TOKEN_URL = http://127.0.0.1:35357/v2.0/tokens
vRouter Installation
Prepare vRouter/Compute Nodes

Get the vRouter packages to all the compute nodes. Run the below snippet as a shell script adding it in a file (example: setup_vrouter.sh | execute: ./setup_vrouter.sh)

##
 Contrail-vRouter packages
##
tall kernel specific dependencies
install glibc-devel wget git -y;
##
 Contrail Packages
##
r -p /tmp/contrail-vrouter/repo;
-xzf /root/contrail-vrouter-packages_4.0.1.0-32.tgz -C /tmp/contrail-vrouter/repo/;
tmp/contrail-vrouter/repo/contrail-vrouter-packages_4.0.1.0-32 && mv * /tmp/contrail-vrouter/repo/.;

##
oving empty directory
##
rf /tmp/contrail-vrouter/repo/contrail-vrouter-packages_4.0.1.0-32;
##
ate a Repo
##
install createrepo -y;
terepo /tmp/contrail-vrouter/repo/;
##
n using local repo in the target node
##
<< __EOT__ > /etc/yum.repos.d/contrail-install.repo
trail_install_repo]
=contrail_install_repo
url=file:///tmp/contrail-vrouter/repo/
led=1
rity=1
heck=0
T__
p 10;
clean all;

p 5;
install yum-plugin-priorities -y;
##
tall contrail-utilities
##
p 5;
install contrail-fabric-utils contrail-setup -y;
##
tall contrail-vrouter
##
p 5;
install contrail-vrouter-common contrail-vrouter contrail-vrouter-init -y;
##

This will install all required packages on the Compute node required for vRouter installation.

Provision and Register the vRouter to the Controller

Use the below utility to provision the vRouter:

rail-compute-setup --self_ip 10.87.1.57 --hypervisor libvirt --cfgm_ip 10.87.1.57 --collectors 10.87.1.54 10.87.1.61 10.87.1.56 --control-nodes 10.87.1.54 10.87.1.61 10.87.1.56 --keystone_ip 50.51.23.14  --keystone_auth_protocol https  --keystone_auth_port 443  --keystone_admin_user admin@cos9.net  --keystone_admin_password bye761Uq --keystone_admin_tenant_name admin --register && cd /etc/contrail && ./contrail_reboot

This will provision the vRouter followed by Registration (hostname mismatches may occur if the hostname doesn't match the hostname.domain_name) and will reboot the node (contrail_reboot)

self_ip    #IP of the Compute_Node
cfgm_ip    #IP of LB_COntainer
collectors   #List of all three Analytics_Nodes
control-nodes  #List of all three Controller_Nodes
keystone_ip  #Openstack Kestone_IP
keystone_admin_user  #Exact user name as specified in Openstack

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.