Using Juju for deploying OpenContrail

TurnToJPG -->


Preparation

First we have to create 4 images which will hold our own opearating system.

 1016  qemu-img create -f qcow2 OpenContrail0.qcow2 40G
 1017  qemu-img create -f qcow2 OpenContrail1.qcow2 40G
 1018  qemu-img create -f qcow2 OpenContrail3.qcow2 40G
 1019  qemu-img create -f qcow2 OpenContrail2.qcow2 40G
 1020  ls
 1021  history
# pwd
/home/juju/img/OpenContrail
# qemu-img create -f qcow2 OpenContrail0.qcow2 40G
# qemu-img create -f qcow2 OpenContrail1.qcow2 40G
# qemu-img create -f qcow2 OpenContrail3.qcow2 40G
# qemu-img create -f qcow2 OpenContrail2.qcow2 40G
# ls
OpenContrail0.qcow2  OpenContrail1.qcow2  OpenContrail2.qcow2  OpenContrail3.qcow2

Second, we create the four nodes in the virt-manager, each of them have 3G Memory, and have the cpu copied. Their network deployed to the newly added isolated network.
/images/2015_03_23_11_55_12_711x170.jpg
After commission, the status should be “ready”.

Juju

Copy the new environment named OpenContrail:

$ cat ~/.juju/environments.yaml 
# This file has been generated by juju quickstart v2.0.1
# at 2015-03-19 06:36:40 UTC.

default: maas
environments:
  maas:
    admin-secret: xxxx
    default-series: trusty
    maas-oauth: u8HmYg24sUxerux4N8:kcYJ8mJdePBSe4DfxD:H4qFjEpLP86Lw6xnxjHG5qrHY3abPYzZ
    maas-server: http://10.17.17.200/MAAS
    type: maas
  OpenContrail:
    admin-secret: xxxx
    default-series: trusty
    maas-oauth: u8HmYg24sUxerux4N8:kcYJ8mJdePBSe4DfxD:H4qFjEpLP86Lw6xnxjHG5qrHY3abPYzZ
    maas-server: http://10.17.17.200/MAAS
    type: maas

Then juju switch and examine you are currently operate at OpenContrail via juju switch -l, the result should be OpenContrail.
Bootstrap the environment via:

$ juju bootstrap --metadata-source ~/.juju/metadata --upload-tools -v --show-log --constraints="mem=3G"

Use juju show-log will display the logs for juju.

Deploy from local repository:

$ export JUJU_REPOSITORY=/home/Trusty/Code/deployOpenContrail/contrail-deployer/charms
$ juju deploy --to 0 juju-gui
$ juju deploy --to lxc:0 mysql
$ juju deploy --to lxc:0 keystone
$ juju deploy --to lxc:0 nova-cloud-controller
$ juju deploy --to lxc:0 glance
$ juju deploy --to lxc:0 rabbitmq-server
$ juju deploy --to lxc:0 openstack-Trustyboard
$ juju deploy --to lxc:0 cinder 
$ juju deploy --to lxc:0 neutron-api
$ juju deploy --to lxc:0 quantum-gateway

HomeWorking

First I created the local charm repository, and then start deploying.
Problem is lxc template download is too time-wasting, thus I have to manually download the images and let it run as if the cache image is available.

root@MassOpenContrail2:/var/cache/lxc/cloud-trusty# du -hs *
178M    ubuntu-14.04-server-cloudimg-amd64-root.tar.gz
root@MassOpenContrail2:/var/cache/lxc/cloud-trusty# pwd
/var/cache/lxc/cloud-trusty

Use local repository for deploying other version’s container, then run a cassandra:

juju deploy --to lxc:0 --repository=/home/Trusty/Code/deployOpenContrail/contrail-deployer/src/charms local:precise/cassandra