Skip to content

Add unracked-device handling: detect and confirm-delete VMs after NetBox device removal

Aiho Tehisaru requested to merge feature/unracked-devices into trunk

Summary

  • Rax now tracks every device it has seen with a live Proxmox VM/LXC (store.ProvisionedDevice), refreshed on each device page view/apply.
  • A new Unracked nav page re-checks each tracked device against NetBox (netbox.Client.DeviceExists) and queues any that come back 404 (store.UnrackedDevice) — a NetBox check that merely fails (outage, permissions) is never treated as a deletion.
  • Each unracked device gets its own page with a summary and a "Delete VM/LXC from Proxmox" button (proxmox.Client.DeleteVM), gated by the existing hx-confirm "are you sure" pattern used for other destructive actions in Rax. A failed Proxmox delete leaves the device queued for retry; nothing in NetBox or Proxmox is ever touched automatically.

Test plan

  • go build ./..., go vet ./..., gofmt -l . all clean
  • New unit tests: internal/netbox (DeviceExists), internal/proxmox (DeleteVM), internal/store (ProvisionedDevice/UnrackedDevice CRUD), internal/web (reconciliation + handlers + CSRF)
  • Full existing suite still green

🤖 Generated with Claude Code

https://claude.ai/code/session_01U9buZPRQy7YXLodkSPFFik

Merge request reports

Loading