feat(devkit): add Proxmox API fast-path for vm delete (fixes #120)#121
Open
t0kubetsu wants to merge 1 commit into
Open
feat(devkit): add Proxmox API fast-path for vm delete (fixes #120)#121t0kubetsu wants to merge 1 commit into
t0kubetsu wants to merge 1 commit into
Conversation
Adds proxmox_vm.vm_id.delete_with_api.to.jsons.sh (direct DELETE
/qemu/{id} with UPID polling) and wires the same API delegation guard
into proxmox_vm.vm_id.delete.to.jsons.sh so it bypasses the Ansible
slow-path when the API is reachable.
Fixes `range42-context delete-vms` silently skipping deletion due to
the Ansible play targeting the Proxmox node name ("pve") instead of the
inventory alias ("local-lab").
Set RANGE42_PROXMOX_API_FORCE=off to opt out and keep the Ansible path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
proxmox_vm.vm_id.delete_with_api.to.jsons.sh: directDELETE /qemu/{vm_id}via the Proxmox HTTPS API with UPID task polling (60 s timeout), modelled afterstop_force_with_api.to.jsons.shproxmox_vm.vm_id.delete.to.jsons.sh— the sameRANGE42_PROXMOX_API_FORCE/proxmox__inc.api_reachable.shblock present in all other lifecycle scripts since PR feat: direct Proxmox API fast-path delegation on devkit lifecycle scripts #119Closes #120.
Why
delete.to.jsons.shwas the only lifecycle script not updated in PR #119. Without the fast-path it always ran the Ansible slow-path, which resolves the inventory host as$PROXMOX_NODE("pve") whenRANGE42_INFRASTRUCTURE_CODENAMEis not in scope. The inventory alias islocal-lab, so Ansible emitted a warning and silently skipped the delete play, leaving the VM alive.Test plan
range42-context use local-lab gitea_lab && range42-context delete-vms— VM 1183 stops and is deleteddelete-vmswhen VM is already gone exits cleanly (API returns 404 / empty UPID)RANGE42_PROXMOX_API_FORCE=off range42-context delete-vmsfalls through to the Ansible slow-path (existing behaviour)proxmox_vm.vm_id.delete_with_api.to.jsons.sh --helpprints usage