destroy_vm (vm_provision_mixin.py) has two ordering problems:
Snippet cleanup reads the VM's config after deleting the VM. Step 2 calls qemu(vmid).delete(purge=1, …); step 3 then calls qemu(vmid).config.get() to find cicustom. Once the delete has gone through, the config is gone and the call fails. The except only logs at debug level, so the user-data snippet <vmid>-user-data.yaml stays on the snippet storage for every destroyed VM. Whether the read still succeeds depends on how far the delete task has got, see 2.
The delete is not waited for.DELETE /nodes/{node}/qemu/{vmid} starts a task and returns its UPID; destroy_vm ignores it and returns while the VM may still exist. Its callers (netOrk's deprovisioning) treat the return as "VM is gone".
The tests mock config.get() to keep answering after delete(), and delete() to return None, so neither shows there.
Read from the code, not reproduced on a node. Found while adding a second snippet (network=) to cicustom for BSD guests (NetOrk/netork#794); that change reads cicustom before deleting, which fixes 1. Item 2 stays open here.
`destroy_vm` (`vm_provision_mixin.py`) has two ordering problems:
1. **Snippet cleanup reads the VM's config after deleting the VM.** Step 2 calls `qemu(vmid).delete(purge=1, …)`; step 3 then calls `qemu(vmid).config.get()` to find `cicustom`. Once the delete has gone through, the config is gone and the call fails. The `except` only logs at debug level, so the user-data snippet `<vmid>-user-data.yaml` stays on the snippet storage for every destroyed VM. Whether the read still succeeds depends on how far the delete task has got, see 2.
2. **The delete is not waited for.** `DELETE /nodes/{node}/qemu/{vmid}` starts a task and returns its UPID; `destroy_vm` ignores it and returns while the VM may still exist. Its callers (netOrk's deprovisioning) treat the return as "VM is gone".
The tests mock `config.get()` to keep answering after `delete()`, and `delete()` to return None, so neither shows there.
Read from the code, not reproduced on a node. Found while adding a second snippet (`network=`) to `cicustom` for BSD guests (NetOrk/netork#794); that change reads `cicustom` before deleting, which fixes 1. Item 2 stays open here.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
destroy_vm(vm_provision_mixin.py) has two ordering problems:qemu(vmid).delete(purge=1, …); step 3 then callsqemu(vmid).config.get()to findcicustom. Once the delete has gone through, the config is gone and the call fails. Theexceptonly logs at debug level, so the user-data snippet<vmid>-user-data.yamlstays on the snippet storage for every destroyed VM. Whether the read still succeeds depends on how far the delete task has got, see 2.DELETE /nodes/{node}/qemu/{vmid}starts a task and returns its UPID;destroy_vmignores it and returns while the VM may still exist. Its callers (netOrk's deprovisioning) treat the return as "VM is gone".The tests mock
config.get()to keep answering afterdelete(), anddelete()to return None, so neither shows there.Read from the code, not reproduced on a node. Found while adding a second snippet (
network=) tocicustomfor BSD guests (NetOrk/netork#794); that change readscicustombefore deleting, which fixes 1. Item 2 stays open here.