0

I want o ask about the main differences between juju machines and juju units.

Moreover the relation between a charm and a machine (LXD or an entire VM) is one to one, rigth ?

There isn't a possibility to nesting LXD (and so nesting charms), right ?

Thanks

2

1) juju machines vs juju units

  • juju machines refer to the real machines in your cloud environment. Some examples:
    • When you are using AWS and you add a juju machine to your model you will see in the AWS dashboard that a new machine is created in your cloud. This also counts for Google Cloud Environment.
    • When you have a Maas Setup that supports LXD containers you will see in your juju status that you have some machines like machine 1, 2, 3 etc and some containers in that model like 1/lxd/0, 1/lxd/2 etc... Those machines are actual machines running in your Maas Setup and those containers are running on those machines. That is what those juju machines are.
  • Juju units are instances of a service running on those machines or containers. When you deploy a charm like mysql to a machine a new unit of that application will be added in your model and will be deployed and running on the specified machine

2) relation charm - machine

  • I would not really call this a relation since the machine is not really bound to just that charm. The machine gets created and services get to run on that machine by deploying charms. It is possible that multiple charms can be deployed on one machine. This happens all the time with subordinate charms. So if you want to look at it in a relationship way it is a n:1 relation (where n are the charms)

3) nesting LXD

  • If you are using a juju environment where you use LXD containers it is default not possible to nest containers. The best way to experiment with that is to bootstrap a local LXD controller and try to deploy charms to a LXD container in your model by using the --to lxd:1 flag. There seem to be an option in LXD to configure it that nesting is possible in LXD conatiners. There is some information about that topic here.
3
  • Thanks again, just a comment. I'm using LXD Juju machines on my PC for deploying charms and for my example I saw after juju status: mysql/0* and wordpress/0*. What's the meaning of "star" ? And why do I see "0*" for both units ? (in juju status I have 2 machines and I was expecting to see mysql/0* and wordpress/1 ) – Damiano Manicone Jan 23 '17 at 15:56
  • 1
    I noticed that the '*' appears when the charm is 'executing' and so the charm is in maintenance. Not sure that is the reason but that is what I found out. The reason you are seeing mysql/0 and wordpress/0 is because it is the first(nr 0) unit of the mysql charm in your model => mysql/0 . This also counts for wordpress. The unitnumber is only increased when the same charm gets deployed again or a unit of that charm is added. You will for example never see mysql/0 and another mysql/0 in your model. – SebastienPattyn Jan 24 '17 at 7:47
  • 1
    I looked further at the star and now when my units are active/ready the star is still there. I think that the star appears when the machine is ready for deployment. – SebastienPattyn Jan 24 '17 at 8:01
2

The last time I was working with Ubuntu MaaS and using Juju the original examples and documentation suggested that you minimally needed five nodes to spin up OpenStack, as I recall. What I wanted to do was to put several services onto a bigger computer and then use the many smaller computers to be left over for other things.

I was working through this documentation, for what it's worth.

I was able to re-create the steps a little to target LXC rather than using up the entire node for only one service.

// Start deploying to node 0 * juju deploy --to lxc:0 mysql Added charm "cs:trusty/mysql-28" to the environment * juju deploy --to lxc:0 rabbitmq-server Added charm "cs:trusty/rabbitmq-server-34" to the environment * juju deploy --config=openstack.cfg --to lxc:0 keystone Added charm "cs:trusty/keystone-28" to the environment * juju deploy --config=openstack.cfg --to lxc:0 nova-cloud-controller Added charm "cs:trusty/nova-cloud-controller-60" to the environment ...

Doing this, I was able to split the heavy lifting across one or two of the bigger nodes and then leave the rest for nova-compute as I recall.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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