Deploy Local Service Using Juju

TurnToJPG -->

Since the OpenContrail deploy is using local deployment, that means, directly deploy to local machine. But the lab lack of the environment of the local ubuntu based machine, so I want to deploy a service to local first, then transform the whole project from local deployment to MAAS deployment.
In a Ubuntu14.04 machine, do following steps.

$ sudo add-apt-repository ppa:juju/stable 
$ sudo vim /etc/apt/source.list
# This is for juju
deb trusty main 
deb-src trusty main 
$ sudo apt-get install juju juju-core juju-local juju-quickstart
$ sudo apt-get install charm-tools
$ sudo apt-get install uvtool-libvirt uvtool

Configure the juju for using local:

$ git clone ~/.juju-plugins
$ vim ~/.zshrc
# Add juju_plugins to global path
$ source ~/.zshrc
$ juju init
$ vim ~/.juju/environments.yaml
 type: local

 # <Commented Section>

 # The default series to deploy the state-server and charms on.
 default-series: precise
 ## ** add these lines to support KVM and LXC deployment **
 lxc-use-clone: true
 container: kvm

Start the machine via:

$ juju bootstrap --debug

Add the machines via:

[Trusty@~]$  juju set-constraints mem=512M
[Trusty@~]$  juju add-machine --constraints "root-disk=16G mem=1G"
created machine 1
[Trusty@~]$ juju status
environment: local
    agent-state: started
    dns-name: localhost
    instance-id: localhost
    series: trusty
    state-server-member-status: has-vote
    instance-id: pending
    series: precise
services: {}

After a long wait, it will boot a machine which have 1G and 1 Core, and let it running.