Instance type constraint throws "ambiguous constraints" error

Bug #1931504 reported by Jeremy Lounder
10
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://juju.is/docs/olm/azure for Azure setup, including bootstrap and model creation
2. Build charm - https://github.com/canonical/charm-mssql-infra was in use when issue was first detected
3. Deploy using: juju deploy ./mssql.charm --num-units 3 --constraints "instance-type=Standard_D4_v4"

This command return an error:
ERROR cannot add application "mssql": ambiguous constraints: "arch" overlaps with "instance-type"

Ian Booth (wallyworld)
Changed in juju:
milestone: none → 2.9.5
assignee: nobody → Ian Booth (wallyworld)
importance: Undecided → High
status: New → In Progress
Jeremy Lounder (jldev)
summary: - juju deploy does not respect --constraint="instance-type" on Azure
+ Instance type constraint throws "ambiguous constraints" error on Azure
description: updated
Revision history for this message
Ian Booth (wallyworld) wrote : Re: Instance type constraint throws "ambiguous constraints" error on Azure

Constraints with instance-type specified cannot also have things like mem and arch set, since the instance type implicitly determines such things. So
--constraints="instance-type=foo mem=4G"

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.

Ian Booth (wallyworld)
summary: - Instance type constraint throws "ambiguous constraints" error on Azure
+ Instance type constraint throws "ambiguous constraints" error
Revision history for this message
Ian Booth (wallyworld) wrote :

https://github.com/juju/juju/pull/13063

Reverts a change made late last year and tweaks how default arch is set up.
See PR for extra info.

Ian Booth (wallyworld)
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
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.