Comment 3 for bug 1772653

Revision history for this message
Calvin Hartwell (calvinh) wrote :

     I would be happy to have some way of tagging manually added machines, but
     we shouldn't trust that a machine number is stable in any fashion.

Not even on the initial bootstrap?

Lets say I have 10 machines, and I want machines 0-2 to run unit A, I want machines 3-4 to run unit B, I want machines 5-8 to run unit C, machine 9 to run Unit D.

So I would have something like juju deploy somemodel.yaml --map-machines existing,0=0,1=1,2=2,3=3,4=4,5=5,6=6,7=7,8=8,9=9

Right now I am able to 100% verify these machines have the correct machine number. The problem is that this is slow, due to the lack of parallelism:

# slow
juju add-machine ssh:<email address hidden> -> host number 0
juju add-machine ssh:<email address hidden> -> host number 1
juju add-machine ssh:<email address hidden> -> host number 2

I would be happy to tag it with something else like:

juju add-machine ssh:<email address hidden> --some-metadata 'unit-a' &
juju add-machine ssh:<email address hidden> --some-metadata 'unit-b' &
juju add-machine ssh:<email address hidden> --some-metadata 'unit-d' &

or:

juju add-machine ssh:<email address hidden> --desired-unit 'unit-a' &

The other way to do this is to work based on host name, I.E add all the machines using in random order and then have a script which parses juju status output to look for hostname patterns which then calculates which unit should be deployed on each host using the map-machines command. This is pretty nasty and I think juju should give me a better way to do this for customers.