kill-controller should take down known hosted models

Bug #1566011 reported by Cheryl Jennings
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Andrew Wilkins

Bug Description

Running kill-controller only contacts the provider to take down resources associated with the controller UUID. It should also release resources associated with all known hosted models in that controller.

There should also be a warning that users should check with their provider that everything has been cleaned up. (This used to be in earlier versions when suggesting --force)

Revision history for this message
Andrew Wilkins (axwalk) wrote :

kill-controller does destroy hosted models, but only if going via the API. If it fails to destroy via the API, it will use the Environ.Destroy method, but only on the admin model.

If the API is down, then there's no guarantee that you'll know about all of the hosted models; the best you could do is run through all of the models cached in models.yaml. Also, this method won't uninstall Juju from any manually provisioned machines.

destroy-controller is meant to be less fire and brimstone. It'll just error out if the API method fails.

Revision history for this message
Cheryl Jennings (cherylj) wrote :

"the best you could do is run through all of the models cached in models.yaml" - This is exactly what I was opening the bug for.

Revision history for this message
Andrew Wilkins (axwalk) wrote :

Just thinking about this again: we can't necessarily destroy hosted models in this way, because we don't store the hosted model config at the client. As an example, the Azure provider needs the following:
 - the model UUID
 - the model name
 - the controller resource group name
the last one is specific to the Azure provider, and stored in the hosted model config. That's only stored in Mongo.

Revision history for this message
Andrew Wilkins (axwalk) wrote :

I'm researching an alternative now: when env.Destroy() is called on the controller model, for it to also destroy hosted model resources. This should be doable by tagging resources with the controller UUID.

Andrew Wilkins (axwalk)
Changed in juju-core:
status: Triaged → In Progress
assignee: nobody → Andrew Wilkins (axwalk)
Revision history for this message
Cheryl Jennings (cherylj) wrote :
Changed in juju-core:
milestone: 2.0-beta4 → 2.0-rc1
Revision history for this message
Andrew Wilkins (axwalk) wrote :

This is done for lxd. The other providers are yet to come.

Revision history for this message
Andrew Wilkins (axwalk) wrote :
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta5 → 2.0-rc1
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta6 → 2.0-beta7
Revision history for this message
Andrew Wilkins (axwalk) wrote :
Revision history for this message
Andrew Wilkins (axwalk) wrote :
Revision history for this message
Andrew Wilkins (axwalk) wrote :
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta7 → 2.0-beta8
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta8 → 2.0-beta9
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta9 → 2.0-beta10
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta10 → 2.0-beta11
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta11 → 2.0-beta12
Changed in juju-core:
milestone: 2.0-beta12 → 2.0-beta13
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta13 → 2.0-beta14
Revision history for this message
Andrew Wilkins (axwalk) wrote :

Just a quick status update, as I've not been active on this. I'll unassign myself so someone else can pick it up if they have time.

We're still missing support for the following providers: cloudsigma, gce, joyent, maas, vsphere.

Last I looked, gce was going to be a bit difficult because disks cannot be tagged. So disks might leak. We could perhaps use some other API (e.g. GCE's object store) to store information about relationships.

For maas, I think we should predicate any further work on switching over to using tagging; we're still (ab)using MAAS storage. Any provider that supports tags should be fairly straight forward to do. Just apply the tags supplied to StartInstanceParams, and have Environ.DestroyController destroy all resources with the "tags.JujuController" tag matching.

Changed in juju-core:
status: In Progress → Triaged
assignee: Andrew Wilkins (axwalk) → nobody
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta14 → 2.0-beta15
Revision history for this message
Anastasia (anastasia-macmood) wrote :

I am going to create individual bugs for outstanding providers and close this one.

For QA, these providers are good to have functional tests:
* Azure;
* Openstack;
* LXD;
* ec2.

MAAS bug: https://bugs.launchpad.net/juju-core/+bug/1611267
GCE bug: https://bugs.launchpad.net/juju-core/+bug/1611269
Cloudsigma bug: https://bugs.launchpad.net/juju-core/+bug/1611271
Joyent bug: https://bugs.launchpad.net/juju-core/+bug/1611273
Vsphere: https://bugs.launchpad.net/juju-core/+bug/1611275

Changed in juju-core:
status: Triaged → Fix Committed
assignee: nobody → Andrew Wilkins (axwalk)
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
affects: juju-core → juju
Changed in juju:
milestone: 2.0-beta15 → none
milestone: none → 2.0-beta15
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.