juju remove-cloud race condition
Bug #1840685 reported by
Kenneth Koski
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Expired
|
Medium
|
Unassigned |
Bug Description
For a k8s model...
I've got a script that runs these two commands sequentially:
juju destroy-model MODEL --yes --destroy-storage --force
juju remove-cloud -c CONTROLLER CLOUD
Sometimes, I will get this error message, and the cloud will not get removed:
ERROR cloud is used by 1 model
If I then manually delete the cloud, it works fine. This appears to be a race condition where destroy-model sometimes doesn't wait long enough before returning.
description: | updated |
Changed in juju: | |
milestone: | none → 2.7-beta1 |
status: | New → Triaged |
importance: | Undecided → High |
Changed in juju: | |
milestone: | 2.7-beta1 → 2.7-rc1 |
Changed in juju: | |
assignee: | nobody → Anastasia (anastasia-macmood) |
status: | Triaged → In Progress |
Changed in juju: | |
assignee: | Anastasia (anastasia-macmood) → nobody |
To post a comment you must log in.
I am a bit surprised that your script does not check if the model is gone before doing anything else... Having a check will safeguard you from many possible surprises :D
However, about your specific concern....
Destroying a model is a complex multi-step process that has some asynchronous steps. It's possible that occasionally the operation to remove a cloud gets attempted before some model steps are yet to run.
We could potentially add a --force to remove-cloud operation but I am not convinced that we REALLY want to force remove a cloud that is still being used by some models... We have no means of "changing" a cloud for a model, so these models might become unusable and indesructible.