prevent reuse of proxmox ids - #127
Open
addidotlol wants to merge 4 commits into
Open
addidotlol wants to merge 4 commits into
addidotlol wants to merge 4 commits into
Conversation
- Allocate Proxmox VM IDs from a database sequence - Enforce unique active Proxmox IDs and reconcile duplicates - Preserve VM identity across backend provisioning and deletion flows
- Allow repeated deletion requests to be re-queued safely - Require stable VM tags when resolving Proxmox resources - Cache config lookups and use stable IDs consistently
addidotlol
marked this pull request as draft
September 20, 2026 19:26
- Close VM meters before marking resources for deletion - Delete billing entities only after usage events are synced - Verify Proxmox ownership and exclude deleting VMs from metering
addidotlol
marked this pull request as ready for review
September 20, 2026 20:27
lleyton
reviewed
Sep 20, 2026
| { | ||
| id: ulidPk(), | ||
| name: text('name').notNull(), | ||
| proxmoxId: integer('proxmox_id'), |
Contributor
There was a problem hiding this comment.
Would it make more sense to convert this to a identity column starting at 1000?
lleyton
reviewed
Sep 20, 2026
| return resources.filter((r) => r.type === 'qemu').map((r) => this.resourceToInfo(r)); | ||
| } | ||
|
|
||
| async listUsedProxmoxIds(): Promise<number[]> { |
lleyton
reviewed
Sep 20, 2026
| const [nodes, vmid] = await Promise.all([this.client.listNodes(), this.client.getNextVmId()]); | ||
| const [nodes, vmid] = await Promise.all([ | ||
| this.client.listNodes(), | ||
| params.proxmoxId ?? this.client.getNextVmId() |
Contributor
There was a problem hiding this comment.
Is there a valid usecase for having the client pick the proxmox id? Shouldn't this always come from a DB sequence? If so, please make proxmoxId on the params type non-null.
lleyton
requested changes
Sep 20, 2026
- Remove Proxmox next-ID API usage - Return used VM IDs as a Set for allocation checks
lleyton
approved these changes
Sep 20, 2026
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.
do not merge