[azure] Model deletion fails with timeout
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
High
|
Ian Booth |
Bug Description
juju 2.9.31
expected result: operator should be able to remove the model without using --force flags and/or experiencing timeouts
actual result: azure model cannot be deleted without using --force flag.
=== steps to reproduce
juju bootstrap azure/westeurope --config resource-
juju add-model workload --config=
$ juju status
Model Controller Cloud/Region Version SLA Timestamp
workload azure-controller azure/westeurope 2.9.31 unsupported 12:08:48Z
App Version Status Scale Charm Channel Rev Exposed Message
hello-juju active 1 hello-juju stable 8 yes
postgresql 12.11 active 1 postgresql stable 239 no Live master (12.11)
Unit Workload Agent Machine Public address Ports Message
hello-juju/0* active idle 0 20.86.102.41 80/tcp
postgresql/0* active idle 1 20.229.87.153 5432/tcp Live master (12.11)
Machine State DNS Inst id Series AZ Message
0 started 20.86.102.41 machine-0 focal
1 started 20.229.87.153 machine-1 focal
$ juju destroy-model workload
WARNING! This command will destroy the "workload" model.
This includes all machines, applications, data and other resources.
Continue [y/N]? y
Destroying model
Waiting for model to be removed, 2 machine(s), 2 application(
.......
Waiting for model to be removed, 2 machine(s), 1 application(
Waiting for model to be removed, 1 machine(s), 1 application(s)...
Waiting for model to be removed, 1 machine(
.......
Waiting for model to be removed.
.......
.......
.......
.......
.......
.......
.......
.......
.......
........
Because the destroy model operation did not finish, there may be cloud resources left behind.
Run 'destroy-model <model-name> --timeout=0 --force' to clean up the Juju model database records
even with potentially orphaned cloud resources.
ERROR timeout after 30m0s
$ juju destroy-model workload --debug
12:39:23 INFO juju.cmd supercommand.go:56 running juju [2.9.31 0f2ce8e528a67fa
12:39:23 DEBUG juju.cmd supercommand.go:57 args: []string{
WARNING! This command will destroy the "workload" model.
This includes all machines, applications, data and other resources.
Continue [y/N]? y
12:39:25 INFO juju.juju api.go:78 connecting to API addresses: [20.234.
12:39:25 DEBUG juju.api apiclient.go:1153 successfully dialed "wss://
12:39:25 INFO juju.api apiclient.go:688 connection established to "wss://
12:39:25 INFO juju.juju api.go:330 API endpoints changed from [192.168.16.4:17070 20.234.
12:39:25 INFO juju.juju api.go:78 connecting to API addresses: [20.234.
12:39:25 DEBUG juju.api apiclient.go:1153 successfully dialed "wss://
12:39:25 INFO juju.api apiclient.go:688 connection established to "wss://
Destroying model
Waiting for model to be removed.
.......
.......
.......
.......
.......
.......
.......
.......
.......
.......
.......
Because the destroy model operation did not finish, there may be cloud resources left behind.
Run 'destroy-model <model-name> --timeout=0 --force' to clean up the Juju model database records
even with potentially orphaned cloud resources.
13:09:25 DEBUG juju.api monitor.go:35 RPC connection died
13:09:25 DEBUG juju.api monitor.go:35 RPC connection died
ERROR timeout after 30m0s
13:09:25 DEBUG cmd supercommand.go:537 error stack:
/build/
$ juju status
Model Controller Cloud/Region Version SLA Timestamp Notes
workload azure-controller azure/westeurope 2.9.31 unsupported 13:33:17Z tearing down cloud environment
Model "admin/workload" is empty.
$ az resource list --resource-group JujuWorkload -o table
Name ResourceGroup Location Type Status
-------
machine-1 JUJUWORKLOAD westeurope Microsoft.
juju-internal-nsg JujuWorkload westeurope Microsoft.
juju-internal-
# remove model with --force does the trick, but leaves us with some leftovers:
$ juju destroy-model workload --force
WARNING! This command will destroy the "workload" model.
This includes all machines, applications, data and other resources.
Continue [y/N]? y
Destroying model
Waiting for model to be removed.
Model destroyed.
$ az resource list --resource-group JujuWorkload -o table
Name ResourceGroup Location Type Status
-------
machine-1 JUJUWORKLOAD westeurope Microsoft.
juju-internal-nsg JujuWorkload westeurope Microsoft.
juju-internal-
description: | updated |
tags: | added: teardown |
Changed in juju: | |
status: | In Progress → Fix Committed |
Changed in juju: | |
status: | Fix Committed → Fix Released |
This looks like a custom resource group is used rather than allowing juju to create the group.
For juju created resource groups, we simply delete the group and everything in it goes away. For custom resource groups, we need to delete the resources manually. So seems like there's an issue there.