Custom Search

Tuesday, October 21, 2014

Howto Install Contrail with OpenStack In Ubuntu singlebox setup

Howto Install Contrail Release 1.10 with OpenStack In Ubuntu 12.04.3 LTS singlebox setup

http://www.juniper.net/techpubs/en_US/contrail1.0/information-products/topic-collections/release-notes/index.html?jd0e331.html

http://www.opencontrail.org/opencontrail-quick-start-guide/

1)
Create a VirtualBox VM with 4GB RAM, 20GB Disk and Ubuntu 12.04.3 LTS
http://old-releases.ubuntu.com/releases/12.04.1/ubuntu-12.04.3-server-amd64.iso



2)
Download contrail install packages
http://www.juniper.net/support/downloads/?p=contrail#sw

* Download "Contrail Package for Ubuntu 12.04.4 LTS + Havana"

3)
Install the Contrail packages
a)
Login as root user
#su -

b)
Install Packages
#dpkg -i contrail-install-packages_1.10-34~havana_all.deb

4)
Goto /opt/contrail/
There you can see two directories "contrail_packages" and  "puppet".
Goto /opt/contrail/contrail_packages and run "setup.sh"
Run the setup.sh script. This step will create the Contrail packages repository as well as the Fabric utilities needed for provisioning
#cd /opt/contrail/contrail_packages
#./setup.sh

5)
Populate the testbed definitions file, see http://www.juniper.net/techpubs/en_US/contrail1.0/topics/task/installation/testbed-file-vnc.html
a)
Create /opt/contrail/utils/fabfile/testbeds/testbed.py
#cp /opt/contrail/utils/fabfile/testbeds/testbed_singlebox_example.py /opt/contrail/utils/fabfile/testbeds/testbed.py

b)
Edit testbed.py

* Replace “root@1.1.1.1” by “root@server ip”
* Replace “secret” by "
root password"
* Replace “secret123” by "Openstack admin password"

#vim /opt/contrail/utils/fabfile/testbeds/testbed.py

host1 = 'root@127.0.0.1'

ext_routers = []

router_asn = 64512

host_build = 'root@127.0.0.1'

env.roledefs = {
     'all': [host1],
     ‘database’: [host1],
     'cfgm': [host1],
     'control': [host1],
     'compute': [host1],
     'collector': [host1],
     'webui': [host1],
     'build': [host_build],
}

#Openstack admin password
env.openstack_admin_password = 'secret123'

#Hostnames
env.hostnames = {
    'all': ['contrailsys']
}

env.password = 'rootpass'

#Passwords of each host
env.passwords = {
    host1: 'rootpass',
    host_build: 'rootpass',
}

#For reimage purpose
env.ostypes = {
    host1:'ubuntu',
}

6)
Install Contrail with OpenStack
Doc: /opt/contrail/utils/README.fabric

a)
Install contrail
#cd /opt/contrail/utils/
#fab -c fabrc install_contrail

b)
Install OpenStack and Configure
#fab setup_all
* Your system will reboot

7)
Open Horizon Dashboard
http://ip-of-contrail-vm/horizon/ #IP of your VirtualBox VM
username: admin
password: secret123

8)
Open Contrail Webui
https://ip-of-contrail-vm:8080
https://ip-of-contrail-vm:8143/login
username: admin
password: secret123

9)
Do following steps if you are trying to setup in a Virtual Machine
a)
#sudo vim /etc/nova/nova-compute.conf

[DEFAULT]
libvirt_type=qemu
compute_driver=libvirt.LibvirtDriver


b)
#sudo service nova-compute restart

http://fosshelp.blogspot.com/2014/11/openstack-libvirterror-internal-error.html

c)
Create a VM vis horizon dashboard http://ip-of-contrail-vm/horizon

d)
Open the log file and check for error
#tail -f /var/log/nova/nova-scheduler.log 

10)
#sudo netstat -tuplen | grep cont
tcp        0      0 0.0.0.0:8091            0.0.0.0:*               LISTEN      0          13132       2389/contrail-query
tcp        0      0 0.0.0.0:34302           0.0.0.0:*               LISTEN      0          23312       2381/contrail-vrout
tcp        0      0 0.0.0.0:9090            0.0.0.0:*               LISTEN      0          23358       2381/contrail-vrout
tcp        0      0 0.0.0.0:8083            0.0.0.0:*               LISTEN      0          12666       2382/contrail-contr
tcp        0      0 0.0.0.0:179             0.0.0.0:*               LISTEN      0          12589       2382/contrail-contr
tcp        0      0 0.0.0.0:8085            0.0.0.0:*               LISTEN      0          23360       2381/contrail-vrout
tcp        0      0 0.0.0.0:5269            0.0.0.0:*               LISTEN      0          12610       2382/contrail-contr
tcp        0      0 0.0.0.0:8086            0.0.0.0:*               LISTEN      0          13219       2386/contrail-colle
tcp        0      0 0.0.0.0:8089            0.0.0.0:*               LISTEN      0          13270       2386/contrail-colle
udp        0      0 0.0.0.0:56703           0.0.0.0:*                           0          23342       2381/contrail-vrout
udp        0      0 0.0.0.0:32957           0.0.0.0:*                           0          23343       2381/contrail-vrout

11)
Introspect

Please note the Ports

Modules for ControlNode
http://ip-of-contrail-node:8083

Modules for ApiServer
http://ip-of-contrail-node:8084

Modules for VRouterAgent
http://ip-of-contrail-node:8085

Modules for Schema
http://ip-of-contrail-node:8087

Modules for ServiceMonitor
http://ip-of-contrail-node:8088

Modules for Collector
http://ip-of-contrail-node:8089

Modules for OpServer
http://ip-of-contrail-node:8090

Modules for QueryEngine
http://ip-of-contrail-node:8091

Modules for DnsAgent
http://ip-of-contrail-node:8092



11 comments:

  1. Contrail API (Web interface)
    Please note the Ports

    Modules for QueryEngine
    http://XXX.XXX.XXX.XXX:8091

    Modules for ControlNode
    http://XXX.XXX.XXX.XXX:8083

    Modules for VRouterAgent
    http://XXX.XXX.XXX.XXX:8085/

    Modules for Collector
    http://XXX.XXX.XXX.XXX:8089/

    ReplyDelete
  2. ubuntu 12.04 lts server eth0 or eth1 missing
    http://fosshelp.blogspot.in/2014/04/ubuntu-1204-lts-server-eth0-and-eth1.html

    ReplyDelete
  3. How to upload new image

    1)
    Export the credentials
    export OS_USERNAME=admin
    export OS_PASSWORD=secret123
    export OS_TENANT_NAME=myproject1
    export OS_AUTH_URL=http://192.168.56.101:35357/v2.0

    2)
    Verify the credentials
    keystone token-get

    3)
    List all images
    #glance image-list

    4)
    Upload an image (cirros)
    #glance image-create --progress --name cirros-0.3.2 --disk-format qcow2 --container-format bare --is-public True --file cirros-0.3.2-x86_64-disk.img

    ReplyDelete
  4. Do following steps if you are trying to setup in a Virtual Machine
    a)
    #sudo vim /etc/nova/nova-compute.conf

    [DEFAULT]
    libvirt_type=qemu
    compute_driver=libvirt.LibvirtDriver

    b)
    #sudo service nova-compute restart

    http://fosshelp.blogspot.com/2014/11/openstack-libvirterror-internal-error.html

    ReplyDelete
  5. Ubuntu 12.04.4 LTS Server

    http://releases.ubuntu.com/12.04/ubuntu-12.04.4-server-amd64.iso

    ReplyDelete
  6. export OS_USERNAME=admin
    export OS_PASSWORD=secret123
    export OS_TENANT_NAME=admin
    export OS_AUTH_URL=http://127.0.0.1:35357/v2.0

    ReplyDelete
  7. # fab tasks.install.install_pkg_all:contrail-install-packages_1.21-74~icehouse_all.deb

    ReplyDelete
  8. Hi admin,
    Can u Please help me in installing Open contrail in ubuntu server 14.04. I am getting confused while changing/modifying the "Tested.py" File..

    ReplyDelete
  9. 2015-08-05 14:14:45:371533: ERROR: Minimum disk space(256GB) for analytics db is not met in nodes: ['root@192.168.56.101']
    2015-08-05 14:14:45:371571: Please set 'minimum_diskGB' in testbed.py and continue.
    2015-08-05 14:14:45:371614: Specifiy the avalilable disk space of database node in GB
    2015-08-05 14:14:45:371653: However minimum disk space for database node is 256GB.
    2015-08-05 14:14:45:371692: Disconnecting from 192.168.56.101... done.


    Admin Please Help Me With These Error

    ReplyDelete
    Replies
    1. good trick to overcome this error, especially in testing environment ....
      issue df -Pk /var/lib | grep % | awk '{print $2}'
      you will get a number back
      take that number say x and divide it by (1024*1024)
      so y = integer((x/(1024*1024))
      set minimum_diskGB < then y in the following files
      /usr/lib/pythonxx/site-packages/contrail-provisioning/database/setup.py AND
      /opt/contrail/utils/fabfile/testbed/testbed.py

      in my case x = 18348032 , y= 17 and I set minimum_diskGB = 10 instead of 256

      Delete
  10. This comment has been removed by the author.

    ReplyDelete