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

Bug #1229275 reported by Andres Rodriguez on 2013-09-23
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
juju-core
High
Tim Penhey
1.16
Critical
Roger Peppe
pyjuju
Low
Unassigned
juju-core (Ubuntu)
High
Unassigned
Saucy
High
Unassigned
maas (Ubuntu)
Critical
Unassigned
Saucy
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

Raphaël Badin (rvb) wrote :

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

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
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) on 2013-09-26
Changed in juju:
status: New → Confirmed
Scott Moser (smoser) on 2013-09-27
description: updated
Tim Penhey (thumper) on 2013-10-02
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
tags: added: theme-oil
Tim Penhey (thumper) on 2013-10-03
Changed in juju-core:
assignee: nobody → Tim Penhey (thumper)
status: Triaged → In Progress
milestone: none → 2.0
Mark Ramm (mark-ramm) on 2013-10-10
Changed in juju-core:
milestone: 2.0 → 1.17.0
Curtis Hovey (sinzui) on 2013-10-12
Changed in juju:
status: Confirmed → Triaged
importance: High → Low
Scott Moser (smoser) on 2013-10-15
description: updated
James Page (james-page) on 2013-10-16
Changed in juju-core (Ubuntu Saucy):
importance: Undecided → High
status: New → Triaged
Curtis Hovey (sinzui) on 2013-10-17
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui) on 2013-10-24
tags: added: maas-provider
removed: maas
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) on 2013-11-12
Changed in maas (Ubuntu):
status: Triaged → Invalid
Changed in maas (Ubuntu Saucy):
status: Triaged → Invalid
Curtis Hovey (sinzui) on 2013-11-20
Changed in juju-core:
importance: Critical → High
James Page (james-page) on 2013-11-21
description: updated

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
James Page (james-page) wrote :

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

tags: added: verification-done
removed: verification-needed
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

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) on 2013-12-20
Changed in juju-core:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers