Juju sets incorrect architecture for charms when deploying on arm64
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Won't Fix
|
High
|
Unassigned |
Bug Description
I am deploying to a local LXD on an arm64 machine. Deploying from a bundle works fine and I get everything up and running:
ubuntu@
Model Controller Cloud/Region Version SLA Timestamp
default test-controller localhost/localhost 2.9.22 unsupported 08:53:45Z
App Version Status Scale Charm Store Channel Rev OS Message
ams 1.12.5 active 3 ams local 0 ubuntu
ams-node-controller 1.12.5 active 1 ams-node-controller local 0 ubuntu
etcd 3.4.5 active 3 etcd charmstore stable 634 ubuntu Healthy with 3 known peers
etcd-ca 3.0.1 active 1 easyrsa charmstore stable 420 ubuntu Certificate Authority connected.
lxd 4.0.8 active 1 lxd local 0 ubuntu
Unit Workload Agent Machine Public address Ports Message
ams/0 active idle 0 10.93.207.156 8444/tcp,9104/tcp
ams/1* active idle 1 10.93.207.125 8444/tcp,9104/tcp
ams/2 active idle 2 10.93.207.71 8444/tcp,9104/tcp
etcd-ca/0* active idle 0 10.93.207.156 Certificate Authority connected.
etcd/0 active idle 0 10.93.207.156 2379/tcp Healthy with 3 known peers
etcd/1* active idle 1 10.93.207.125 2379/tcp Healthy with 3 known peers
etcd/2 active idle 2 10.93.207.71 2379/tcp Healthy with 3 known peers
lxd/2* active idle 4 10.93.207.196 8443/tcp
ams-node-
Machine State DNS Inst id Series AZ Message
0 started 10.93.207.156 juju-7ab6e7-0 focal Running
1 started 10.93.207.125 juju-7ab6e7-1 focal Running
2 started 10.93.207.71 juju-7ab6e7-2 focal Running
4 started 10.93.207.196 juju-7ab6e7-4 focal Running
However when I now want to add additional units for LXD I get the following error:
ubuntu@
ERROR cannot assign unit "lxd/3" to machine: cannot assign unit "lxd/3" to new machine or container: cannot assign unit "lxd/3" to new machine: invalid constraint value: arch=amd64
valid values are: [arm64 armhf]
Changing the app constraints is not allowed either
ubuntu@
ERROR changing architecture not supported (not supported)
The only workaround is to add a machine and then map a new unit to it
ubuntu@
created machine 5
ubuntu@
I understand that charms with Juju 2.9 are now architecture specific but it would be great if we can correctly autodetect what architecture the application is deployed on initially so that subsequent calls to `juju add-unit` just work.
This is with Juju 2.9.22 and LXD 4.0.9
Changed in juju: | |
status: | New → Triaged |
milestone: | none → 2.9.26 |
Changed in juju: | |
assignee: | nobody → Simon Richardson (simonrichardson) |
importance: | Undecided → High |
Changed in juju: | |
status: | Triaged → In Progress |
Changed in juju: | |
milestone: | 2.9.26 → 2.9.27 |
Changed in juju: | |
milestone: | 2.9.27 → 2.9.28 |
Changed in juju: | |
milestone: | 2.9.28 → 2.9.29 |
So this happens because the default model has the constraint of amd64. If you bootstrap the controller with an arch constraint, we don't inherit that when adding a model without specifying a constraint (maybe we should?).
You can't change a constraint of a given model, as we may have existing charmhub applications with amd64, so that violates our homogeneous topology for architecture constraints. One possible solution here would be to download a charm with the new arch when a constraint is employed, assuming it exists. This sounds easy but would require some changes to applications i.e. the charmURL as the opaque identifier.
From my experimentation the following works:
juju bootstrap aws/eu-west-1 test3 --bootstrap- constraints= "arch=arm64" --constraints= "arch=arm64"
juju deploy ubuntu
juju add-unit ubuntu -n 1
The following all works, because we set the default model constraint to arm64. Everything correctly inherits from the application if it's set or via the model.
As a workaround, I would suggest:
juju add-model other --constraints= "arch=arm64"
I'll keep investigating to validate that the LXD provider does correctly return the architectures.