Instance type constraint throws "ambiguous constraints" error
Bug #1931504 reported by
Jeremy Lounder
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
High
|
Ian Booth |
Bug Description
When attempting to deploy a local charm (have not tested charms from charm store or charmhub) to Azure, the constraints option for instance-type appears to be ignored.
Steps to reproduce:
1. follow https:/
2. Build charm - https:/
3. Deploy using: juju deploy ./mssql.charm --num-units 3 --constraints "instance-
This command return an error:
ERROR cannot add application "mssql": ambiguous constraints: "arch" overlaps with "instance-type"
Changed in juju: | |
milestone: | none → 2.9.5 |
assignee: | nobody → Ian Booth (wallyworld) |
importance: | Undecided → High |
status: | New → In Progress |
summary: |
- juju deploy does not respect --constraint="instance-type" on Azure + Instance type constraint throws "ambiguous constraints" error on Azure |
description: | updated |
summary: |
- Instance type constraint throws "ambiguous constraints" error on Azure + Instance type constraint throws "ambiguous constraints" error |
Changed in juju: | |
status: | In Progress → Fix Committed |
Changed in juju: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Constraints with instance-type specified cannot also have things like mem and arch set, since the instance type implicitly determines such things. So "instance- type=foo mem=4G"
--constraints=
is not allowed for example.
The issue here is that arch has become more important with juju 2.9 and charmhub because there are now arch dependent charms. So if no arch is specified, juju sets the constraint to use amd64. ie
--constraints= "instance- type=foo"
is interpreted now by juju as
--constraints= "instance- type=foo arch=arm64"
which is not allowed.
We can fix this, but then the next problem becomes what if you deploy an arm64 only charm using an instance-type constraint where the instance ends up being an amd64 instance. Depending on the provider and what instance metadata is available, it might not always be possible to fail early here so we'll have to surface that in status after the machine has already been provisioned if that's the case.