Destroying a machine with a placed unit errors then destroys anyway.

Bug #1455158 reported by Jeff Pihach
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
Ian Booth
1.24
Fix Released
High
Ian Booth

Bug Description

In a local environment I have a charm with a single unit placed on a single lxc. If I execute:

juju destroy-service ghost
juju destroy-machine 3

I get the following error:

ERROR no machines were destroyed: machine 3 has unit "ghost/0" assigned

The machine is then destroyed anyway.

Revision history for this message
Jeff Pihach (hatch) wrote :

This is using 1.24-beta2-trusty-amd64

Curtis Hovey (sinzui)
tags: added: destroy-machine lxc
Changed in juju-core:
status: New → Triaged
importance: Undecided → High
milestone: none → 1.25.0
Revision history for this message
Ian Booth (wallyworld) wrote :

The service-destory command will eventually also destroy the machine on which it is hosted. That's why the machines does go away. When the destroy machine is run immediately after the service destroy, the service may still at that point be recorded as belonging to the machine (albeit likely in a dying state). So we need to either make the destroy machine a no-op (if practical) or improve/change the message printed under such circmstances.

Revision history for this message
Jeff Pihach (hatch) wrote :

This must be a new functionality? It used to leave the machine on purpose.

I'm assuming it only cleans up the machine if it's the last service on the machine?
Is there a way to destroy a service without having it destroy the machine? There is nothing in the CLI help which mentions destroying a machine. `juju help destroy-service` aliases to `remove-service`

Revision history for this message
Ian Booth (wallyworld) wrote :

The "destroy a machine when possible" after a service destroy functionality was added back in June 2014.

Yes, it only cleans up if appropriate - no remaining principal units, not a state server, no remaining containers on machine etc.

You can't turn it off as far as I know.

Revision history for this message
Ian Booth (wallyworld) wrote :

I used git to figure out when the functionality was added. I wasn't involved so am not sure if it was a stakeholder request etc

Ian Booth (wallyworld)
Changed in juju-core:
assignee: nobody → Ian Booth (wallyworld)
Ian Booth (wallyworld)
Changed in juju-core:
status: Triaged → Fix Committed
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.