I’ve experienced a problem with juju recently I would like to share since its likely going to affect others. I’ve failed to find a cause for it, even not sure my resolution is correct.
So one day, I get this from starting new models in a controller for MAAS:
$ juju add-model testmodel maas-cloud
cannot find suitable controller
Debugging in various ways gave no hints what so ever.
Existing models works just fine, except that I had a model that was not possible to remove.
$ juju destroy-model --force
.......
........
timeout
The problem with “no suitable controller remained, I couldn’t add new models”.
The way I managed to get models “unstuck” was to manually remove some problematic machines from the stuck model (stuck in deployment or not powering on correctly etc.):
$ juju remove-machine X --force
Once all machines was removed, I could remove the models with “juju destroy-model --force”
Then, out of nowhere, suddenly
$ juju add-model testmodel maas-cloud
Started to work again.
I’m not sure here, but the takeaway from this is that getting models destroyed with “–force” isn’t doing what it indicates to be doing and that removing machines manually seems nessecary for that to work.
Secondly, if you enounter the problem with adding new models, try to remove all models you have that are stuck. That might be the fix for you.
I think that the “–force” flag should be renamed to “–gently” =D