0

I have a simple charm A, which consists of a single hook (install), which has a bash script to install third party software/drivers for additional hardware that will be installed on some of the nodes.

I would like the administrator to be able to deploy the charm to those specific nodes, but Juju complains when I roll the same charm to a different machine.

The alternative is a much more painful one - to manually SSH into each node and run the install bash script.

So is there a way to install the same Juju charm on multiple nodes?

1 Answer 1

2

Yes, the best way to do this will be to make your charm a "subordinate" for the applications running on the set of machines for which it is relevant.

A subordinate charm is "coupled" to a normal application charm, and it gets installed everywhere that "normal" application charm is installed. Usually, it's used to connect the app up to some sort of ancillary system, like a monitoring system. Once you have established the subordinate relationship, any time the main application is scaled up to more machines, the subordinate will come along too.

So in your example, you probably have a main application, like the hypervisor controller "nova-compute" in OpenStack, which goes on the machines where your code is relevant. You make your charm a subordinate and then deploy it associated with nova-compute. Now your code is everywhere that nova-compute goes.

There are complications to be aware of. The main application will be installed first and THEN your subordinate, so if you need your code to run first, then you need to do it differently. In that case, make your code a primary application charm and deploy it first. Then manually place the other charm units on the same machines using "juju deploy foo --to X" where X is a machine that already has your app on it. This latter approach is ore fiddly because you need to decide where everything goes, and put it there explicitly.

1
  • Thanks, Mark. I'm going to implement your suggestion. Do visit us in the Mother City sometime. Sep 5, 2016 at 11:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .