Hi So far i have developed juju charm bundle which contains three charms.I have Two Questions (Q1) And i need to deploy juju charm bundle in one machine in LXC. i have three charms and normally when i deploy charm it deploy in three different machines.I have followed this question(How do I deploy the OpenStack bundle to one machine?) and add "to : 0" to each charm in my charm bundle yaml file.Then i got this error.

An error occurred while deploying the bundle: cannot assign unit "mysql/0" to machine 0: machine "0" cannot host units

So first i want to know is it possible to add all charms in one machine.And if it is possible what is the wrong with my bundle.Here i have attached my bundle.

sample:
  services:
    mysql:
      to: 0
      charm: "cs:precise/mysql-27"
      num_units: 1
      annotations:
        "gui-x": "139"
        "gui-y": "168"
    wordpress:
      to : 0
      charm: "cs:precise/wordpress-20"
      num_units: 1
      annotations:
        "gui-x": "481"
        "gui-y": "178"
  relations:
    - - "wordpress:db"
      - "mysql:db"

(Q2)And last thing i have seen (http://marcoceppi.com/2014/06/deploying-openstack-with-just-two-machines/) that is it possible to add more charms in to one machine in OpenStack.So this is manual installation with only charms not bundle.I want to know i have one bundle and using juju GUI i want to deploy my bundle in one machine (Because i have only three nodes in my cloud) in OpenStack as well.Is it possible??

share|improve this question
up vote 2 down vote accepted
+200

I'm going to append a slight bundle modification below that should get you up and running.

sample:
  services:
    ubuntu:
      charm: "cs:trusty/ubuntu"
      num_units: 1
    mysql:
      to: lxc:ubuntu=0
      charm: "cs:precise/mysql-27"
      num_units: 1
      annotations:
        "gui-x": "139"
        "gui-y": "168"
    wordpress:
      to : lxc:ubuntu=0
      charm: "cs:precise/wordpress-20"
      num_units: 1
      annotations:
        "gui-x": "481"
        "gui-y": "178"
  relations:
    - - "wordpress:db"
      - "mysql:db"

What I did differently was deploy an ubuntu charm to the canvas which will just deploy an ubuntu host. Nothing fancy - no additional config. From there, i deploy to LXC containers targeted at that host which will warehouse your MySQL and Wordpress instances in LXC - mind you we still haven't resolved reachability from the outside world and this will require a reverse-proxy server, such as haproxy to live on the "ubuntu" node. Not LXC but the parent service.

juju deploy cs:trusty/haproxy --to ubuntu/0

or if your machine id were #1

juju deploy cs:trusty/haproxy --to 1

From here you should see 2 total machines consumed (1 for the bootstrap, 1 for the LXC containers + haproxy)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.