juju doesn't honor bundle application constraints (2.1.2)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Invalid
|
High
|
Unassigned |
Bug Description
I've created a simple bundle with application constraints. However, post deployment, I see that the created machines are not honoring those constraints (they have 1.7g ram instead of the requested 3). This is happening on at least AWS and GCE:
$ juju version
2.1.2-xenial-amd64
$ cat test.yaml
services:
u10:
charm: cs:xenial/ubuntu
constraints: "mem=3G"
num_units: 1
to:
- 0
u20:
charm: cs:xenial/ubuntu
constraints: "mem=3G root-disk=16G"
num_units: 1
to:
- 1
machines:
"0":
series: "xenial"
"1":
series: "xenial"
$ juju deploy --debug test.yaml
17:55:45 INFO juju.cmd supercommand.go:63 running juju [2.1.2 gc go1.6.2]
17:55:45 DEBUG juju.cmd supercommand.go:64 args: []string{"juju", "deploy", "--debug", "test.yaml"}
17:55:45 INFO juju.juju api.go:72 connecting to API addresses: [104.198.
17:55:45 DEBUG juju.api apiclient.go:590 dialing "wss://
17:55:45 DEBUG juju.api apiclient.go:590 dialing "wss://
17:55:45 DEBUG juju.api apiclient.go:593 successfully dialed "wss://
17:55:45 INFO juju.api apiclient.go:521 connection established to "wss://
17:55:45 DEBUG juju.juju api.go:263 API hostnames unchanged - not resolving
17:55:46 DEBUG httpbakery client.go:244 client do GET https:/
17:55:46 DEBUG httpbakery client.go:246 } -> error <nil>
17:55:47 DEBUG juju.cmd.
17:55:47 INFO juju.cmd.
17:55:47 DEBUG juju.cmd.
17:55:47 INFO cmd cmd.go:129 Deploying charm "cs:ubuntu-10"
17:55:48 INFO juju.cmd.
17:55:48 DEBUG juju.cmd.
17:55:48 INFO cmd cmd.go:129 Deploying charm "cs:ubuntu-10"
17:55:48 DEBUG juju.cmd.
17:55:48 DEBUG juju.cmd.
17:55:48 DEBUG juju.cmd.
17:55:48 DEBUG juju.cmd.
17:55:49 INFO cmd cmd.go:129 Deploy of bundle completed.
17:55:49 DEBUG juju.api monitor.go:35 RPC connection died
17:55:49 INFO cmd supercommand.go:465 command finished
$ juju run --all 'free -h && df -h | grep sda'
- MachineId: "0"
Stdout: |2
Mem: 1.7G 125M 664M 2.8M 906M 1.4G
Swap: 0B 0B 0B
/dev/sda1 9.7G 1.6G 8.1G 17% /
- MachineId: "1"
Stdout: |2
Mem: 1.7G 119M 666M 2.8M 910M 1.4G
Swap: 0B 0B 0B
/dev/sda1 9.7G 1.6G 8.1G 17% /
I've updated my test.yaml to include machine constraints (note the app requests 7G, the machine specifies 3G). I get machines with 3G. So it seems like "machine" constraints are cool; app constraints not so much:
$ cat test.yaml
services:
u10:
charm: cs:xenial/ubuntu
constraints: "mem=7G"
num_units: 1
to:
- 0
u20:
charm: cs:xenial/ubuntu
constraints: "mem=7G root-disk=16G"
num_units: 1
to:
- 1
machines:
"0":
series: "xenial"
constraints: "mem=3G"
"1":
series: "xenial"
constraints: "mem=3G root-disk=32G"
$ juju run --all 'free -h && df -h | grep sda'
total used free shared buff/cache available
total used free shared buff/cache available
- MachineId: "0"
Stdout: |2
Mem: 3.5G 179M 2.4G 5.0M 913M 3.0G
Swap: 0B 0B 0B
/dev/sda1 9.7G 1.6G 8.1G 17% /
- MachineId: "1"
Stdout: |2
Mem: 3.5G 203M 2.4G 5.0M 885M 3.0G
Swap: 0B 0B 0B
/dev/sda1 31G 1.6G 30G 5% /