Incorrect memory constraints on LXD cluster
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| juju |
High
|
Joseph Phillips |
Bug Description
When deploying with:
juju deploy ubuntu --constraints "mem=4G cores=2"
The container shows:
limits.cpu: "2"
limits.memory: 4096MB
Looking at the documentation, it says that memory contraints are in MiB, so I would have expected this to end up as 4096MiB or 4GiB instead which would then resolve to the right amount of RAM being allocated to the container.
I see logic in Juju which attempts some kind of server version check to select whether the suffix will work or not but it looks like this isn't working since I'm getting the wrong result with LXD 4.8 and Juju 2.8.
»···»···// Ensure that we use the correct "MB"/"MiB" suffix.
»···»···template := "%dMB"
»···»···if current, err := version.
»···»···»···if current.
»···»··
»···»···»···}
»···»···}
»···»··
I also did a bit of archeology and this syntax has been supported since LXD 3.0.2.
So technically, LXD 2.0.x which is still supported as our oldest LTS release is indeed missing support for this, anything else which is currently supported however does have it.
Stéphane Graber (stgraber) wrote : | #1 |
Stéphane Graber (stgraber) wrote : | #2 |
I suspect it's a bug in our shared/version handler which we fixed some months ago, trying a refresh of the LXD Go package now.
Stéphane Graber (stgraber) wrote : | #3 |
Yep, that did it:
stgraber@
limits.cpu: "2"
limits.memory: 4096MiB
Ian Booth (wallyworld) wrote : | #4 |
The dependency we currently pull into juju is
github.com/lxc/lxd v0.0.0-
which corresponds to the lxd-3.2.2 tag.
We should update that, but I'm confused why things are broken. in comment #2, are you saying you refreshed github.com/lxc/lxd and rebuilt juju and it worked?
Stéphane Graber (stgraber) wrote : | #5 |
See https:/
Changed in juju: | |
status: | New → Confirmed |
importance: | Undecided → High |
milestone: | none → 2.8.7 |
Changed in juju: | |
status: | Confirmed → In Progress |
assignee: | nobody → Joseph Phillips (manadart) |
milestone: | 2.8.7 → 2.9-rc3 |
Joseph Phillips (manadart) wrote : | #6 |
Landed with https:/
Changed in juju: | |
status: | In Progress → Fix Committed |
Added a bit of debugging, so far I'm getting:
machine-0: 14:06:58 ERROR juju.container.lxd stgraber: version=4.8
machine-0: 14:06:58 ERROR juju.container.lxd stgraber: error=Invalid version format: ""