Custom Search

Friday, February 20, 2015

How to Install OpenStack and OpenContrail in Separate Machines for Development

1)
Install OpenStack using devstack
========================


a)
* Set Static IP for your VirtualBox OpenStack VM


#vim /etc/network/interfaces

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
address 192.168.56.101
netmask 255.255.255.0

b)
* Clone devstack


#git clone https://github.com/openstack-dev/devstack.git -b stable/icehouse
#cd devstack


c)
* Settings


#vim localrc

SERVICE_HOST=192.168.56.101
DATABASE_PASSWORD=nova
RABBIT_PASSWORD=nova
SERVICE_TOKEN=nova
SERVICE_PASSWORD=nova
ADMIN_PASSWORD=nova
#OFFLINE=True
#RECLONE=no


d)
* Install


./stack.sh


2)
Install OpenContrail from source code using contrail-installer
============================================

1)
* Set Static IP for your VirtualBox OpenContrail VM

#vim /etc/network/interfaces

auto eth0
iface eth0 inet static
address 10.0.2.15
netmask 255.255.255.0
gateway 10.0.2.2

auto eth1
iface eth1 inet static
address 192.168.56.102
netmask 255.255.255.0


2)
* Clone contrail-installer (master branch)

#git clone https://github.com/Juniper/contrail-installer.git
#cd contrail-installer
#cp samples/localrc-all localrc

3)
* Settings

#vim localrc

CONTRAIL_BRANCH=R2.1
CONTRAIL_DEFAULT_INSTALL=False
INSTALL_PROFILE=ALL
NB_JOBS=1
#IP of OpenContrail Service Host
SERVICE_HOST=192.168.56.102
PHYSICAL_INTERFACE=eth1
CONTRAIL_REPO_PROTO=https
#IP of OpenStack Keystone Service Endpoint
OPENSTACK_IP=192.168.56.101

4)
* Settings

#vim contrail-installer/contrail.sh
sudo -E add-apt-repository -y cloud-archive:icehouse

* Change "icehouse" to any branch which you want.

5)
* Build, Install, Configure and Start the OPenContrail Services

#./contrail.sh build
#./contrail.sh install
#./contrail.sh configure
#./contrail.sh start

* Open the Screen
#screen -ls
#screen -x

6)
* Check whether OpenStack Keystone configurations are correct in OpenContrail config files.

* I have written a script reconfigure keystone settings in OpenContrail config files.

https://raw.githubusercontent.com/sajuptpm/mytools/master/opencontrail/contrail_installer_setup_re_config.sh


a)
#vim /etc/contrail/ContrailPlugin.ini

[KEYSTONE]
auth_url = http://192.168.56.101:5000/v2.0
auth_host = 192.168.56.101
admin_tenant_name = admin
admin_password = nova
admin_user = admin

b)
#vim /etc/contrail/contrail_plugin.ini

[KEYSTONE]
auth_url = http://192.168.56.101:5000/v2.0
admin_tenant_name = admin
admin_password = nova
admin_user = admin

c)
#vim /etc/contrail/contrail-api.conf

[KEYSTONE]
auth_protocol = http
auth_port = 5000
admin_tenant_name = admin
admin_password = nova
admin_user = admin
auth_host = 192.168.56.101

d)
#vim /etc/contrail/contrail-schema.conf

[KEYSTONE]
admin_tenant_name = admin
admin_password = nova
admin_user = admin

e)
#vim /etc/contrail/svc-monitor.conf

[KEYSTONE]
admin_tenant_name = admin
admin_password = nova
admin_user = admin

f)
#vim /etc/contrail/contrail-snmp-collector.conf

[KEYSTONE]
admin_user=admin
admin_password=nova
admin_tenant_name=admin

g)
#sudo vim /opt/stack/contrail/contrail-web-core/config/config.global.js

config.identityManager.ip = '192.168.56.101';
config.featurePkg.webController.path = '/opt/stack/contrail/contrail-web-controller';

7)
* How to restart services after configuration change

#screen -ls
#screen -x
#Then goto the Tab of service which you want to restart and press "Ctrl + c", the press "UP" arrow and press Enter.

OR

#cd contrail-installer
#./contrail.sh stop
#./contrail.sh start

8)

a)
* OpenContrail Web UI endpoint

http://192.168.56.102:8080/
https://192.168.56.102:8143/

Login with keystone credentials
username :admin
password: nova

Known Issue: http://fosshelp.blogspot.in/2015/02/opencontrail-ui-error-install-feature.html

b)
* OpenContrail API Server endpoint

http://192.168.56.102:8082/
http://192.168.56.102:8084/

c)
* OpenContrail Analytics API Server endpoint

http://192.168.56.102:8081/
http://192.168.56.102:8090/




3 comments:

  1. contrail-installer commit from master which I used
    600d4db0ef99f570b475e5e5241ff3c746987acd

    #git clone https://github.com/Juniper/contrail-installer.git
    #cd contrail-installer
    #git checkout 600d4db0ef99f570b475e5e5241ff3c746987acd

    ReplyDelete
  2. localrc which i used

    STACK_DIR=$(cd $(dirname $0) && pwd)

    LOG_DIR=$STACK_DIR/log/screens
    LOG=True
    DEBUG=True
    LOGFILE=$STACK_DIR/log/contrail.log
    LOGDAYS=1
    USE_SCREEN=True

    DATABASE_PASSWORD=contrail123
    RABBIT_PASSWORD=contrail123
    SERVICE_TOKEN=contrail123
    SERVICE_PASSWORD=contrail123
    ADMIN_PASSWORD=contrail123

    #set loglevel to 1/2/3 . Always stderr into logfile,console.
    #For LOG_LEVEL 1 stdout into logfile.
    #For LOG_LEVEL 2 stdout into logfile and xtrace commands into console.
    #For LOG_LEVEL 3 stdout and xtrace into logfile,console.

    LOG_LEVEL=3

    SERVICE_TIMEOUT=90
    SERVICE_HOST=192.168.56.102
    INSTALL_PROFILE=ALL
    PHYSICAL_INTERFACE=eth1

    CONTRAIL_BRANCH=R2.1

    # to get source code make it as False
    CONTRAIL_DEFAULT_INSTALL=False

    # to get the ppa packages uncomment
    # LAUNCHPAD_BRANCH=mainline

    # repo proto is https or (default) ssh. Leave commented for ssh
    CONTRAIL_REPO_PROTO=https

    # proto for openstack bits. Use HTTPS if git is firewalled
    GIT_BASE=https://github.com

    CASS_MAX_HEAP_SIZE=500M
    CASS_HEAP_NEWSIZE=100M

    ReplyDelete
  3. ####scons####
    https://github.com/Juniper/contrail-installer/blob/master/contrail.sh

    TARGET=${TARGET:-production}
    SCONS_ARGS="--opt=$TARGET"

    ###fetch-packages###
    sudo scons $SCONS_ARGS controller/src/vnsw
    sudo scons $SCONS_ARGS vrouter

    ###Build/Install###
    sudo scons $SCONS_ARGS --root=/ controller/src/vnsw install
    sudo scons $SCONS_ARGS --root=/ vrouter install
    sudo scons $SCONS_ARGS --root=/ openstack/nova_contrail_vif install

    https://bitbucket.org/scons/scons/wiki/SconsTutorial1

    ReplyDelete