Skip to content

fix(servers): check for the VM with vmExists() on reinstall, drop isVmDeleted() - #177

Merged
ericwang401 merged 1 commit into
4.xfrom
fix/rebuild-vm-exists
Oct 16, 2026
Merged

ericwang401 merged 1 commit into
4.xfrom
fix/rebuild-vm-exists

Conversation

@ericwang401

Copy link
Copy Markdown
Collaborator

Follow-up to #171 and #172.

Changes

  • Reinstall checks for the VM with vmExists(). rebuild() used isVmDeleted(), 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

  • Pest: a reinstall during a Proxmox outage returns an error, queues nothing, and leaves the server on install_failed. This test fails on the old code. The existing retry tests (VM missing, VM present) and the delete tests still pass.

…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.
@ericwang401
ericwang401 merged commit bef5135 into 4.x Oct 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant