API change: juju CLI support for adding/removing multiple service units at once

Jim Baker jim.baker at canonical.com
Wed Nov 16 20:37:19 UTC 2011


The lp:~jimbaker/juju/support-num-units branch introduces an API change
that enables the juju add-unit, deploy, and remove-unit subcommands to
work with multiple service units at once. This feature is requested by
https://bugs.launchpad.net/juju/+bug/809599. This branch modifies juju
add-unit and juju deploy so that they take a --num-units option (short
flag is -n) to specify the desired number of units to add. In addition,
to keep it symmetric, juju remove-unit takes a list of service unit
names to be removed, instead of just one. Some examples of how this
might be used:

Deploy the hadoop-slave charm from a local repository with a moderate
(for Hadoop!) number of units:

$ juju deploy --num-units 42 local:hadoop-slave


Add 5 service units to the haproxy service:

$ juju add-unit --num-units 5 haproxy

Using the --num-units option should play well with location constraints,
since it's essentially the equivalent of running juju add-unit multiple
times.


Remove some unneeded service units:

$ juju remove-unit haproxy/1 haproxy/4 haproxy/5

Note this requires explicit identification of the service units to
remove. Using juju status, possibly with its support for filtering with
a scope, might be the right way to create this list. We probably don't
want to support juju remove-unit with --num-units since it's not clear
what a good selection policy for removal should be in *general*. For
example, with EC2 it might be desirable to look at which units are
closest to being in use for a full hour, or some other cost consideration.


Merge proposal:
https://code.launchpad.net/~jimbaker/juju/support-num-units/+merge/81660

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/juju/attachments/20111116/a64be717/attachment.pgp>


More information about the Juju mailing list