This functionality would certainly be useful for testing, however, juju terminate-machine relies on MachineStateManager.remove_machine_state, which verifies the machine has no assigned service unit(s). For now, I would suggest this functionality go into jitsu, say jitsu force-terminate-machine (extra long to make it clear what is being done).
summary:
- teminate-machine should provide and option to '--force' + teminate-machine should provide an option to '--force'
I understand the testing argument, but offering an API to knowingly corrupt the state of the environment feels beyond the use case of juju indeed, and I'd also recomment against adding it to any other tool that is wrapping juju.
It should be easy to create a test-specific tool that uses status to corrupt the state.
Doing something like this should suffice, with the info derived from juju status as Gustavo suggests. Also this mechanism provides for a general purpose chaos monkey for testing scenarios:
This functionality would certainly be useful for testing, however, juju terminate-machine relies on MachineStateMan ager.remove_ machine_ state, which verifies the machine has no assigned service unit(s). For now, I would suggest this functionality go into jitsu, say jitsu force-terminate -machine (extra long to make it clear what is being done).