Is this happening if you also just 'juju remove-machine' without '--force' ?
What is the underlying error state, is the issue that the machine never came up, or it did come up but then ended up hanging after a while with an error.
Certainly we shouldn't be leaking security groups as a general case. And we should be trying to clean them up even with '--force'. It does mean that if we fail to clean them up, likely '--force' will still progress the removal of the rest of the machine information because you asked us to.
However, if any 'juju remove-machine' leaks a security group, that is definitely something we should be fixing. I also wonder if 'force' makes us progress faster, and that leaves us hitting something like "cannot remove security group because it is still in use".
Is this happening if you also just 'juju remove-machine' without '--force' ?
What is the underlying error state, is the issue that the machine never came up, or it did come up but then ended up hanging after a while with an error.
Certainly we shouldn't be leaking security groups as a general case. And we should be trying to clean them up even with '--force'. It does mean that if we fail to clean them up, likely '--force' will still progress the removal of the rest of the machine information because you asked us to.
However, if any 'juju remove-machine' leaks a security group, that is definitely something we should be fixing. I also wonder if 'force' makes us progress faster, and that leaves us hitting something like "cannot remove security group because it is still in use".