[maas] juju destroy-environment also destroys nodes that are not controlled by juju

Bug #1229275 reported by Andres Rodriguez
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
Tim Penhey
1.16
Fix Released
Critical
Roger Peppe
pyjuju
Triaged
Low
Unassigned
juju-core (Ubuntu)
Fix Released
High
Unassigned
Saucy
Fix Released
High
Unassigned
maas (Ubuntu)
Invalid
Critical
Unassigned
Saucy
Invalid
Critical
Unassigned

Bug Description

[Impact]
juju destroy-environment destroys all machines allocated to the MAAS user being used in the environment, not just the ones owned by Juju.

[Test Case]
Allocate machines using maas-cli
juju bootstrap
juju destroy-environment
(all machines are terminated and powered off)

[Regression Potential]
The fix is limited to the MAAS provider in the codebase; so regression potential is limited in scope of provider.

[Original Bug Report]
In a saucy MAAS environment, I had machines allocated to the admin user that were deployed using maas-cli (not using juju). These were perfectly running machines. However, while trying to use juju I noticed that a 'juju destroy-environment' put the machines that were 'allocated to admin' back to a 'Ready' state. These machines were not being used / controller by juju, but rather by maas-cli.

This means that juju destroys all of the machines regardless of whether they are being used by juju or not.

Related bugs:
 * bug 1237398: "You'll need a separate MAAS key for each Juju environment" is wrong.
 * bug 1081247: maas provider releases all nodes it did not allocate [does not play well with others]
 * bug 1239488: Juju api client cannot distinguish between environments

Related branches

Revision history for this message
Raphaël Badin (rvb) wrote :

This might be a bug in the maas provider of juju-core… it definitely needs investigation…

Revision history for this message
William Reade (fwereade) wrote :

Looks like we never added anything to tag the machines with their environment.

Implementation note: *please* tag with environment UUID, not environment name (names are not globally unique, and environments will be referencing one another one day: treating the name as anything other than an alias is counterproductive).

Changed in maas (Ubuntu):
status: New → Triaged
importance: Undecided → Critical
Revision history for this message
Raphaël Badin (rvb) wrote :

One solution to fix this problem would be this:
- when the env is bootstrapped: create a tag named after the environment UUID
- each time juju takes control of a node: associate that tag with the node
- when juju fetches the list of instances it controls, only return the nodes associated with that tag

Changed in juju-core:
importance: Undecided → Critical
status: New → Triaged
Mark Ramm (mark-ramm)
Changed in juju:
status: New → Confirmed
Scott Moser (smoser)
description: updated
Tim Penhey (thumper)
tags: added: maas
summary: - juju destroy-environment also destroys nodes that are not controlled by
- juju
+ [maas] juju destroy-environment also destroys nodes that are not
+ controlled by juju
Changed in juju:
importance: Undecided → High
David Britton (dpb)
tags: added: theme-oil
Tim Penhey (thumper)
Changed in juju-core:
assignee: nobody → Tim Penhey (thumper)
status: Triaged → In Progress
milestone: none → 2.0
Mark Ramm (mark-ramm)
Changed in juju-core:
milestone: 2.0 → 1.17.0
Curtis Hovey (sinzui)
Changed in juju:
status: Confirmed → Triaged
importance: High → Low
Scott Moser (smoser)
description: updated
James Page (james-page)
Changed in juju-core (Ubuntu Saucy):
importance: Undecided → High
status: New → Triaged
Curtis Hovey (sinzui)
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
tags: added: maas-provider
removed: maas
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package juju-core - 1.16.2-0ubuntu1

---------------
juju-core (1.16.2-0ubuntu1) trusty; urgency=low

  * New upstream point release.
    (LP: #1240709, #1240927, #1246320, #1246556, #1245004)
    (LP: #1081247, #1229275, #1239508, #1240423, #1241666, #1243861).
 -- James Page <email address hidden> Thu, 31 Oct 2013 21:22:45 +0000

Changed in juju-core (Ubuntu):
status: Triaged → Fix Released
James Page (james-page)
Changed in maas (Ubuntu):
status: Triaged → Invalid
Changed in maas (Ubuntu Saucy):
status: Triaged → Invalid
Curtis Hovey (sinzui)
Changed in juju-core:
importance: Critical → High
James Page (james-page)
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Andres, or anyone else affected,

Accepted juju-core into saucy-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/juju-core/1.16.3-0ubuntu0.13.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in juju-core (Ubuntu Saucy):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
James Page (james-page) wrote :

Confirmed that destroying an environment only destroys machines allocated to that environment

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package juju-core - 1.16.3-0ubuntu0.13.10.1

---------------
juju-core (1.16.3-0ubuntu0.13.10.1) saucy-proposed; urgency=low

  * New upstream stable point release:
    - MAAS: juju destroy-environment also destroys nodes that are not
      controlled by juju/in different juju environments
      (LP: #1229275, #1081247).
    - MAAS: LXC container provisioning broken due to missing secrets
      in API calls (LP: #1246556).
    - MAAS: disambiguate use of environment uuid between state server
      and environment configuration (LP: #1240423).
    - local: provider fails to start due to missing setup of bootstrap
      storage (LP: #1240709).
    - local: local provider deploys fail due to inclusion of lxc package
      within LXC containers (LP: #1247299).
    - Azure: bootstrap fails due to old API version headers (LP: #1246320).
    - client: os.rename does not work on Windows (LP: #1240927).
    - simplestreams: cannot create simplestreams data for Ubuntu Trusty
      (LP: #1241666).
    - cloud-init: Embed full cloud-archive keyring in metadata to avoid
      calls to keyserver.ubuntu.com which fail in egress restricted
      data center environments (LP: #1243861).
    - core: regression - relation name regex is to restrictive (LP: #1245004).
 -- James Page <email address hidden> Thu, 21 Nov 2013 10:30:39 +0000

Changed in juju-core (Ubuntu Saucy):
status: Fix Committed → Fix Released
Revision history for this message
Stéphane Graber (stgraber) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.