Add support for persistent machine/instance when nothing running on it

When using a cloud, it is understandable that a “machine” would be removed (destroyed) when there is no longer an app/unit running on it. But for the manual case, it is not the same.

Currently, for the manual case, when a machine becomes empty, it is automatically removed from the list of available machines and is left in a state that prevents it from being reused with a simple “add-machine” as previously (an add-machine returns “ERROR machine is already provisioned”). A simple “rm” of specific files cleans this up. Nevertheless, being able to specify that said machine be persisted would be helpful.

A workaround is to put a “keepalive” app/unit on the machine, but this seems a bit hacky.

I can envision a situation in which a persistent option would also be useful in the cloud, too.

At one point, I do believe we had code that could disable “what should you do when you remove the last application/unit from a machine”, and you could chose to leave it. Note that juju deploy won’t target that machine by default, because we expect that it is probably not pristine from a freshly provisioned machine (though you can juju deploy --to X and explicitly request it).

I believe you can also change the provisioner to leave all machines around juju model-config provisioner-harvest-mode=none, but I think that still removes the Machine from the model (it just doesn’t try to ask the provider to stop/kill/terminate the instance).