Repository navigation
fix(servers): check for the VM with vmExists() on reinstall, drop isVmDeleted() - #177
Merged
Merged
Conversation
…mDeleted() rebuild() decided whether to stop and delete the old VM with isVmDeleted(), which returns true for any ProxmoxConnectionException. A reinstall while the node was unreachable or erroring was therefore taken as "no VM": it skipped the delete, and the clone failed later on the VMID still in use, leaving the server on install_failed with a confusing error. It now uses vmExists(), which only counts Proxmox's "does not exist" as missing and rethrows anything else, so the reinstall request fails up front, inside the controller's transaction, and the server keeps its status. isVmDeleted() has no callers left and is removed.
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.
Follow-up to #171 and #172.
Changes
vmExists().rebuild()usedisVmDeleted(), which returns true for any Proxmox error. So a reinstall while the node was unreachable or erroring was taken as "there's no VM": it skipped deleting the old VM, then the clone failed on the VMID still in use, leaving the server on "Install failed" with a confusing error.vmExists()only treats Proxmox's "does not exist" as missing and rethrows anything else. The reinstall request now fails up front, and the server keeps its status.isVmDeleted()is removed, since nothing calls it any more.Testing
install_failed. This test fails on the old code. The existing retry tests (VM missing, VM present) and the delete tests still pass.