7 Jun 2018

Contrail 5 Installation Using Ansible

Introduction – Ansible Deployment

Contrail v5.0 was recently released and brings two new deployment methods; Ansible and Helm. In this blog, we will use Ansible as the deployment tool for Contrail 5.0 installation on a Centos 7.4 machine.

The release of Contrail v4.0 last year (June 2017), Juniper decided to bring Contrail into the container architecture world. The Apr 2018 release of Contrail 5.0 is the second version to use containers, and several improvements have been made.

Unlike Contrail v4.0, Contrail v5.0 brings more containers as Juniper breaks apart several major components into its own container structure. These include RabbitMQ, ZooKeeper, Cassandra, Kafka, Redis, OpenStack Nova components etc. This brings the total to 60 containers for all-in-one installation in a single Centos 7.4 machine.

By contrast, all containers in Contrail v4.0 were fat containers, and only three ran in the machine; controller, analytics, and analyticsdb. The compute node / vrouter ran in a separate un-containerized machine.

New deployment methods were introduced in Contrail 5.0, and just like other container-based applications, numerous methods were introduced. Ansible and Helm are now supported deployment tools.

Contrail 5.0 Installation

Let’s begin with the installation. For a quick setup, here is the physical configuration for the All-In-One Contrail v5.0 machine or VM with preferred resources:

One machine for AIO Contrail:

  • CPU: 8
  • RAM: 32GB
  • HDD: 120GB
  • NIC: 1

One machine for the deployer/installer can use any machine/VM with Centos 7.4 OS.

OS for All-in-One Installation

On both machines install Centos OS v7.4  from http://mirrors.mit.edu/centos/7/isos/x86_64/ Download the file ‘CentOS-7-x86_64-minimal-1708.iso’ and install.

Preparation of the Base Host Environment

Step 1. Contrail AIO Machine

Upgrade kernel on Contrail AIO Machine

Because of Docker overlay filesystem requirements, Centos OS v7.4 host needs to be upgraded to the kernel at least to 3.10.0-862 version, below is the steps to upgrade the kernel.

#yum install kernel-3.10.0-862.3.2.el7.x86_64
#yum install kernel-devel-3.10.0-862.3.2.el7.x86_64
#yum install kernel-headers-3.10.0-862.3.2.el7.x86_64
#grub2-set-default 0

Disable the NetworkManager; Use a static IP setting

Next before rebooting the machine to apply the new kernel, make sure the host network configuration uses static configuration and disable NetworkManager  service for the interface. Below are the steps to run for this part of the setup.

#service NetworkManager stop
#systemctl disable NetworkManager
#vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=10.10.20.x
NETMASK=255.255.255.0
GATEWAY=10.10.20.y
DNS1=8.8.8.8

#reboot

Step 2. Deployer / Installer Machine

After configuring Contrail AIO machine, now is the time to work inside Installer machine. First make sure the Contrail AIO machine is reachable from the Installer host. A few additional steps are needed before installation can start. First, the machine needs to have Ansible and Git. Use Git to clone contrail-ansible-deployer from the Juniper GitHub website.

#cd ~/
#yum -y install epel-release 
#yum -y install git ansible-2.4.2.0
#git clone http://github.com/Juniper/contrail-ansible-deployer
#cd contrail-ansible-deployer

Unlike Contrail 3.0 where the installer packages need to be downloaded first to the installation machine, Contrail 5.0 is using the online Docker repository, or the private repository for all the installation packages. This AIO install only needed to edit one file specific to the installation: ~/contrail-ansible-deployer/config/instances.yaml.

Below is the contents of the AIO ”instances.yaml” file used for this deployment:

Provider_config:
  bms:
    ssh_pwd: somepassword <<-- password of your AIO host
    ssh_user: root
    ntpserver: ntp.someserver.net
    domainsuffix: local
instances:
  bms1:
    provider: bms
    ip: 10.233.255.7      <<-- change this ip to your AIO host
    roles:
      config_database:
      config:
      control:
      analytics_database:
      analytics:
      webui:
      vrouter:
      openstack:
      openstack_compute:
contrail_configuration:
  RABBITMQ_NODE_PORT: 5673
  AUTH_MODE: keystone
  KEYSTONE_AUTH_URL_VERSION: /v3
kolla_config:
  kolla_globals:
    enable_swift: no
    enable_haproxy: no
  kolla_passwords:
    keystone_admin_password: Juniper123
global_configuration:
  REGISTRY_PRIVATE_INSECURE: True

Contrail Installation Process

From deployer/installer these two Ansible playbook commands need to be executed to deploy Contrail v5.0:

# cd ~/contrail-ansible-deployer/

#ansible-playbook -i inventory/ playbooks/configure_instances.yml
#ansible-playbook -i inventory/ 
-e orchestrator=openstack playbooks/install_contrail.yml

The return result from both commands will provide enough information if something fails,. For successful deployment, the expected result is shown below.

[root@ Installer contrail-ansible-deployer]# ansible-playbook -i inventory/ \
playbooks/configure_instances.yml

******************************************************************************
skipping: [10.233.255.7]

PLAY RECAP 
******************************************************************************
10.233.255.7    : ok=39   changed=28   unreachable=0    failed=0
localhost       : ok=10   changed=2    unreachable=0    failed=0

[root@ Installer contrail-ansible-deployer]# ansible-playbook -i inventory/ \
-e orchestrator=openstack playbooks/install_contrail.yml

******************************************************************************

TASK [install_contrail : untaint node] 
******************************************************************************
skipping: [10.233.255.7] => (item={'value': {u'ip': u'10.233.255.7', u'roles': 
{u'control': None, u'openstack_compute': None, u'config_database': None, u'analytics': 
None, u'webui': None, u'vrouter': None, u'openstack': None, u'analytics_database': None, u'config': 
None}, u'provider': u'bms'}, 'key': u'bms1'})

PLAY RECAP 
******************************************************************************
10.233.255.7    : ok=495  changed=230  unreachable=0    failed=0
localhost       : ok=7    changed=2    unreachable=0    failed=0

[root@ Installer contrail-ansible-deployer]#

Contrail Web UI.

Accessing the web UI after installation is completed.

OpenStack -> http://<IP-ADDR>/horizon
Contrail -> https://<IP-ADDR>:8143

docker ps --format 'table {{.ID}}\t{{.Names}}\t{{.Status}}'

CONTAINER ID        NAMES                           STATUS
36fa1236712d        vrouter_vrouter-agent_1         Up 2 hours
3a5cf5db888b        vrouter_nodemgr_1               Up 2 hours
7272722f189f        analytics_alarm-gen_1           Up 2 hours
e89f38d721de        analytics_api_1                 Up 2 hours
97b6b640210d        analytics_collector_1           Up 2 hours
e104fd1c84fb        analytics_nodemgr_1             Up 2 hours
9e77748c6711        analytics_query-engine_1        Up 2 hours
7137cfa35526        analyticsdatabase_nodemgr_1     Up 2 hours
6419caeb94b2        analyticsdatabase_zookeeper_1   Up 2 hours
0b5a5db43d20        analyticsdatabase_cassandra_1   Up 2 hours
938c0a50b830        analyticsdatabase_kafka_1       Up 2 hours
19fd7d00797e        control_named_1                 Up 2 hours
a46dd131bd0e        control_nodemgr_1               Up 2 hours
c4af8bbf68d1        control_control_1               Up 2 hours
42b38adf8aff        control_dns_1                   Up 2 hours
8a5f3fc02e45        webui_web_1                     Up 2 hours
76129276575a        webui_job_1                     Up 2 hours
c4e972f2a290        config_svcmonitor_1             Up 2 hours
b26e550e0753        config_nodemgr_1                Up 2 hours
1b8f5ac84573        config_schema_1                 Up 2 hours
8e067db2d3f5        config_api_1                    Up 2 hours
6414303579ce        config_devicemgr_1              Up 2 hours
8825b437031a        configdatabase_zookeeper_1      Up 2 hours
1d6a8d702d60        configdatabase_cassandra_1      Up 2 hours
8e6290172cc1        configdatabase_rabbitmq_1       Up 2 hours
42e85e83c57a        redis_redis_1                   Up 2 hours
0fc50753f919        barbican_worker                 Up 2 hours
c6c4da0417b4        barbican_keystone_listener      Up 2 hours
3c9007fe76fe        barbican_api                    Up 2 hours
2f154b9bbfcc        horizon                         Up 2 hours
cc89d904399c        heat_engine                     Up 2 hours
80f142d0f775        heat_api_cfn                    Up 2 hours
aced6a0e3424        heat_api                        Up 2 hours
479207e79a71        neutron_metadata_agent          Up 2 hours
f3f4301708ef        neutron_server                  Up 2 hours
f78372a0acfa        nova_compute_ironic             Up 2 hours
a305757ff389        nova_compute                    Up 2 hours
f70bf7f7abdc        nova_novncproxy                 Up 2 hours
82711c770d35        nova_consoleauth                Up 2 hours
21581f99e321        nova_conductor                  Up 2 hours
93802a3c3872        nova_scheduler                  Up 2 hours
003ece6ab316        nova_api                        Up 2 hours
0f32e18dd05f        placement_api                   Up 2 hours
b6e184ebec37        nova_libvirt                    Up 2 hours
144e0a7d42e3        nova_ssh                        Up 2 hours
792b784df11f        ironic_notification_manager     Up 2 hours
e875eb88ba7e        ironic_conductor                Up 2 hours
ff9207ba76ba        ironic_api                      Up 2 hours
1ba0d5cb774e        ironic_pxe                      Up 2 hours
4f67c8010e41        glance_registry                 Up 2 hours
a5506a37b353        glance_api                      Up 2 hours
fadb53029f6d        keystone                        Up 2 hours
27ebfd772472        rabbitmq                        Up 2 hours
3969adda3237        iscsid                          Up 2 hours
95ddf3daa223        mariadb                         Up 2 hours
3ff6c7db0672        cron                            Up 2 hours
e94b2ef99cf1        kolla_toolbox                   Up 2 hours
8fc44b3744bb        fluentd                         Up 2 hours
35abdaf4fc82        memcached                       Up 2 hours
Share this

© 2018 SDN Essentials. All rights reserved.