enable-ha to specific machine should ignore 'tags' constraints

Bug #1684049 reported by Witold Krecicki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Witold Krecicki
2.2
Fix Released
High
Witold Krecicki

Bug Description

When doing enable-ha --to machine1,machine2 juju should ignore 'tags' constraints, currently the workaround is to add '--constraints tags=""' to command line.

Revision history for this message
Witold Krecicki (wpk) wrote :

Actually it should ignore -all- constraints, and it's not doing it.

Changed in juju:
assignee: nobody → Witold Krecicki (wpk)
Changed in juju:
status: New → Triaged
importance: Undecided → High
milestone: none → 2.2.0
Changed in juju:
milestone: 2.2.0 → 2.2-rc1
Witold Krecicki (wpk)
Changed in juju:
status: Triaged → In Progress
Changed in juju:
milestone: 2.2-beta4 → 2.2-rc1
Changed in juju:
milestone: 2.2-rc1 → 2.2.0
Ian Booth (wallyworld)
Changed in juju:
milestone: 2.2.0 → 2.3-alpha1
Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1684049] Re: enable-ha to specific machine should ignore 'tags' constraints

I believe this was untargeted from 2.2.2 simply because it is fixed in
2.2.1.

On Fri, Jun 23, 2017 at 1:30 PM, Witold Krecicki <<email address hidden>
> wrote:

> ** Changed in: juju/2.2
> Status: Triaged => Fix Released
>
> ** Changed in: juju/2.2
> Milestone: 2.2.2 => None
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/1684049
>
> Title:
> enable-ha to specific machine should ignore 'tags' constraints
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1684049/+subscriptions
>

Revision history for this message
Witold Krecicki (wpk) wrote :

I forgot to change status to fix commited and its automatically got bumped
to 2.2.2

23.06.2017 3:41 PM "John A Meinel" <email address hidden> napisał(a):

> I believe this was untargeted from 2.2.2 simply because it is fixed in
> 2.2.1.
>
>
> On Fri, Jun 23, 2017 at 1:30 PM, Witold Krecicki <
> <email address hidden>
> > wrote:
>
> > ** Changed in: juju/2.2
> > Status: Triaged => Fix Released
> >
> > ** Changed in: juju/2.2
> > Milestone: 2.2.2 => None
> >
> > --
> > You received this bug notification because you are subscribed to juju.
> > Matching subscriptions: juju bugs
> > https://bugs.launchpad.net/bugs/1684049
> >
> > Title:
> > enable-ha to specific machine should ignore 'tags' constraints
> >
> > To manage notifications about this bug go to:
> > https://bugs.launchpad.net/juju/+bug/1684049/+subscriptions
> >
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1684049
>
> Title:
> enable-ha to specific machine should ignore 'tags' constraints
>
> Status in juju:
> In Progress
> Status in juju 2.2 series:
> Fix Released
>
> Bug description:
> When doing enable-ha --to machine1,machine2 juju should ignore 'tags'
> constraints, currently the workaround is to add '--constraints
> tags=""' to command line.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1684049/+subscriptions
>
> Launchpad-Notification-Type: bug
> Launchpad-Bug: product=juju; milestone=2.3-alpha1; status=In Progress;
> importance=High; <email address hidden>;
> Launchpad-Bug: product=juju; productseries=2.2; status=Fix Released;
> importance=High; <email address hidden>;
> Launchpad-Bug-Information-Type: Public
> Launchpad-Bug-Private: no
> Launchpad-Bug-Security-Vulnerability: no
> Launchpad-Bug-Commenters: jameinel wpk
> Launchpad-Bug-Reporter: Witold Krecicki (wpk)
> Launchpad-Bug-Modifier: John A Meinel (jameinel)
> Launchpad-Message-Rationale: Subscriber
> Launchpad-Message-For: wpk
>

Witold Krecicki (wpk)
Changed in juju:
status: In Progress → Fix Committed
Revision history for this message
Anastasia (anastasia-macmood) wrote :
Revision history for this message
Anastasia (anastasia-macmood) wrote :

I've tried to verify the fix but.

My setup included nuc1.maas and nuc2.maas nodes tagged with "wanted" and nuc4.maas node untagged.

For all 3 versions of Juju that I have tested, I followed this scenario:

a. bootstrapped one controller with '--constraints "tags=wanted"' in command;
b. ran 'juju enable-ha -n 3 --to nuc4.maas'

In all 3 runs, nuc1.maas and nuc2.maas (tagged) came up without an issue. nuc4.maas (untagged) did not come up and gave a similar error.

On develop (v2.3-alpha1) and 2.2 tip (v2.2.3):

    machine-status:
      current: provisioning error
      message: 'cannot run instances: cannot run instance: No available machine matches
        constraints: [(''agent_name'', [''c539ce51-c26a-4375-8ad8-b5a79cc1d2ca'']),
        (''name'', [''nuc4.maas'']), (''tags'', [''wanted''])] (resolved to "name=nuc4.maas
        tags=wanted")'

On 2.1 tip (v2.1.4):

   machine-status:
      current: provisioning error
      message: 'cannot run instances: cannot run instance: No available machine matches
        constraints: [(''agent_name'', [''c75ba7e8-132c-42c0-8c88-260e4c83197e'']),
        (''mem'', [''3584'']), (''name'', [''nuc4.maas'']), (''tags'', [''wanted''])]
        (resolved to "mem=3584.0 name=nuc4.maas tags=wanted")'

Revision history for this message
John A Meinel (jameinel) wrote :

That seems to fairly clearly say that --to was turned into a name
constraint and joined with constraints rather than overriding.
I wonder if it would be different if it was an already added machine. eg
 juju add-machine nuc4.maas
 juju enable-ha -n3 --to 1

John
=:->

On Jul 26, 2017 13:11, "Anastasia" <email address hidden> wrote:

> I've tried to verify the fix but.
>
> My setup included nuc1.maas and nuc2.maas nodes tagged with "wanted" and
> nuc4.maas node untagged.
>
> For all 3 versions of Juju that I have tested, I followed this scenario:
>
> a. bootstrapped one controller with '--constraints "tags=wanted"' in
> command;
> b. ran 'juju enable-ha -n 3 --to nuc4.maas'
>
> In all 3 runs, nuc1.maas and nuc2.maas (tagged) came up without an
> issue. nuc4.maas (untagged) did not come up and gave a similar error.
>
> On develop (v2.3-alpha1) and 2.2 tip (v2.2.3):
>
> machine-status:
> current: provisioning error
> message: 'cannot run instances: cannot run instance: No available
> machine matches
> constraints: [(''agent_name'', [''c539ce51-c26a-4375-8ad8-
> b5a79cc1d2ca'']),
> (''name'', [''nuc4.maas'']), (''tags'', [''wanted''])] (resolved
> to "name=nuc4.maas
> tags=wanted")'
>
> On 2.1 tip (v2.1.4):
>
> machine-status:
> current: provisioning error
> message: 'cannot run instances: cannot run instance: No available
> machine matches
> constraints: [(''agent_name'', [''c75ba7e8-132c-42c0-8c88-
> 260e4c83197e'']),
> (''mem'', [''3584'']), (''name'', [''nuc4.maas'']), (''tags'',
> [''wanted''])]
> (resolved to "mem=3584.0 name=nuc4.maas tags=wanted")'
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/1684049
>
> Title:
> enable-ha to specific machine should ignore 'tags' constraints
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1684049/+subscriptions
>

Revision history for this message
Anastasia (anastasia-macmood) wrote :

Good point! I'll re-try in my morning.

Revision history for this message
Witold Krecicki (wpk) wrote :

When we do juju bootstrap --bootstrap-constraints the settings are set for the first controller and then for all machines created with enable-ha, except for those explicitly provided with --to (and this should not work on versions without this fix).

Another problem is with --constraints on bootstrap - those are stored as model constraints and added independently from --bootstrap-constraints - I've added a separate bug for that https://bugs.launchpad.net/juju/+bug/1706688

Revision history for this message
Anastasia (anastasia-macmood) wrote :

I am not too sure where I should be adding this machine.

I've ran:

$ juju bootstrap guimaas mycontroller --constraints "tags=wanted" --debug --show-log

$ juju add-machine nuc4.maas
created machine 0

$ juju enable-ha -n 3 --to 0
ERROR failed to create new controller machines: machine for placement directive "#:0" is already a controller

Revision history for this message
Anastasia (anastasia-macmood) wrote :

An update...
Tried to verify against current develop (2.3-alpha1).

Steps I followed:
* Add tag "wanted" to 2 machines in MAAS;
* Bootstrapped with '--constraints "tags=wanted"';
* Switched to 'controller' model;
* Added another_machine which is untagged in MAAS as "1";
* Ran 'juju enable-ha -n 3 --to 1' which showed output:

maintaining machines: 0
adding machines: 2
converting machines: 1

However, both new machines erred out - https://pastebin.canonical.com/195528/

Did your all your changes land in develop? Or maybe my verification steps are not correct?..

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.