juju 2.3 incorrectly colocates apps on machine 0

Bug #1765436 reported by Kevin W Monroe
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Low
Unassigned

Bug Description

When specifying machine placement for a given application (eg, to: '0') , the first unplaced application with a name earlier in the alphabet will be colocated on machine 0.

Reproduce:
---------------
$ cat test.yaml
series: xenial
applications:
  a:
    charm: "cs:xenial/ubuntu"
    num_units: 1
  z:
    charm: "cs:xenial/ubuntu"
    num_units: 1
    to:
      - "0"
machines:
  "0":
    series: "xenial"

$ juju deploy test.yaml
Resolving charm: cs:xenial/ubuntu
Resolving charm: cs:xenial/ubuntu
Executing changes:
- upload charm cs:ubuntu-12 for series xenial
- deploy application a on xenial using cs:ubuntu-12
- deploy application z on xenial using cs:ubuntu-12
- add new machine 0
- add unit a/0 to new machine 1
- add unit z/0 to new machine 0
Deploy of bundle completed.
---------------

The above output looks good and makes you think you'll be getting machines 0 and 1. However, status shows that both apps are colocated on 0:

Unit Workload Agent Machine Public address Ports Message
a/0 waiting allocating 0 34.239.108.85 waiting for machine
z/0 waiting allocating 0 34.239.108.85 waiting for machine

Let's do that again, but this time, with the names reversed so 'a' is placed and 'z' is not:

---------------
$ cat test.yaml
series: xenial
applications:
  z:
    charm: "cs:xenial/ubuntu"
    num_units: 1
  a:
    charm: "cs:xenial/ubuntu"
    num_units: 1
    to:
      - "0"
machines:
  "0":
    series: "xenial"

$ juju deploy test.yaml
Resolving charm: cs:xenial/ubuntu
Resolving charm: cs:xenial/ubuntu
Executing changes:
- upload charm cs:ubuntu-12 for series xenial
- deploy application a on xenial using cs:ubuntu-12
- deploy application z on xenial using cs:ubuntu-12
- add new machine 0
- add unit a/0 to new machine 0
- add unit z/0 to new machine 1
Deploy of bundle completed.
---------------

Again the output looks good, and this time, status shows each app on a separate machine:

Unit Workload Agent Machine Public address Ports Message
a/0 waiting allocating 0 52.91.88.217 waiting for machine
z/0 waiting allocating 1 54.85.145.142 waiting for machine

Revision history for this message
Tim Penhey (thumper) wrote :

Wow... good catch. Very weird behaviour.

Changed in juju:
importance: Undecided → High
milestone: none → 2.3.7
status: New → Triaged
tags: added: bundles deploy
Tim Penhey (thumper)
Changed in juju:
assignee: nobody → Tim Penhey (thumper)
Revision history for this message
Tim Penhey (thumper) wrote :

OK, good news, bad news...

Good news is that the API calls from the CLI to the server are doing the right things.

Bad news is that this is a hold over from a long time ago where we decided to deploy to clean existing machines if they exist. Still digging.

Revision history for this message
Tim Penhey (thumper) wrote :

There is a hard coded value in the apiserver that specified deploying to clean-empty machines.

The way that the bundle deployment happens is that the machines are created, then the units added.

The problem is that if some of the units specify placement and others don't, the units are placed in alphabetical order, and if a machine was empty due to just being created, then the units are deployed there.

To fix this we need to bump the apiserver to allow a policy to be specified. Deploying bundles should use the allocation policy of "new".

Changed in juju:
assignee: Tim Penhey (thumper) → nobody
milestone: 2.3.7 → none
tags: added: 4010 cpe-onsite
Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 2 years, so we're marking it Low importance. If you believe this is incorrect, please update the importance.

Changed in juju:
importance: High → Low
tags: added: expirebugs-bot
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.