removing a unit on an unclean machine should remove that machine

Bug #1206532 reported by Andreas Hasenack
72
This bug affects 12 people
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
Medium
Casey Marshall

Bug Description

A very common workflow for me is to destroy units and add units. Since the underlying machine doesn't get terminated when you do destroy-unit, this is what I do:
- juju status: get the machine id of the unit I want to destroy
- juju destroy-unit myunit/0
- wait a few seconds
- juju terminate-machine <looked-up-id>
- repeat terminate-machine until it does

If I don't do this, either I get recycled machines or dangling machines with no services out there building up against my cloud quota.

Alternatively I can also loop over all machine-ids in the status output (except 0, of course) and call terminate-machine on them all, and let juju decide which ones can be terminated.

What I would like to suggest is a --terminate option to destroy-unit (and perhaps destroy-service too) that would behave like this:
- call destroy-unit
- call terminate-machine on that unit's machine if the machine is vacant (i.e., has no other services on it, lxc, etc).

For destroy-service --terminate it would be similar, just loop over all the units.

John A Meinel (jameinel)
Changed in juju-core:
importance: Undecided → Wishlist
status: New → Triaged
Changed in juju-core:
importance: Wishlist → Medium
Curtis Hovey (sinzui)
Changed in juju-core:
importance: Medium → Low
Curtis Hovey (sinzui)
tags: added: destroy-unit terminate-machine
JuanJo Ciarlante (jjo)
tags: added: canonical-webops
Mark Ramm (mark-ramm)
Changed in juju-core:
importance: Low → Critical
Mark Ramm (mark-ramm)
Changed in juju-core:
importance: Critical → High
Revision history for this message
Tim Penhey (thumper) wrote :

I think the general agreement within the core team is that dirty machines (those that have had units run on them) should be removed by default when remove-unit is run, with (maybe) an option to keep it.

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

See also bug #1260162 about how 'destroy-service' has the same behavior to leave the machine running. I'm guessing that fixing this bug actually fixes bug #1260162 at the same time.

John A Meinel (jameinel)
summary: - --terminate option for destroy-unit
+ removing a unit on an unclean machine should stop that machine
summary: - removing a unit on an unclean machine should stop that machine
+ removing a unit on an unclean machine should remove that machine
Changed in juju-core:
importance: High → Medium
Casey Marshall (cmars)
Changed in juju-core:
assignee: nobody → Casey Marshall (cmars)
status: Triaged → In Progress
Casey Marshall (cmars)
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: none → 1.21-alpha1
tags: added: landscape
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.

Other bug subscribers

Remote bug watches

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