[PR #25] [MERGED] Fix an issue where next id already exists #163

Closed
opened 2026-02-28 00:40:55 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/25
Author: @lausser
Created: 5/4/2019
Status: Merged
Merged: 6/5/2019
Merged by: @ggongaware

Base: masterHead: master


📝 Commits (1)

  • 489a263 Fix an issue where next id already exists

📊 Changes

1 file changed (+2 additions, -0 deletions)

View changed files

📝 proxmox/client.go (+2 -0)

📄 Description

Hi,
i'm using your terraform-provider-proxmox and ran into a problem. When i wanted to create 6 qemu machines node1...node6, only two appeared in the Proxmox gui and terraform war running forever. The reason was:
The next free ID was 102
Only 102 and 103 were available, but proxmox-api-go requried that a whole range of 6 consecutive IDs were free.
I added a few debug logs to client.go and session.go and found out that in fact Proxmox returned a message {"errors":{"vmid":"VM 104 already exists"},"data":null}, which unfortunately got unhandled.
proxmox-api-go/proxmox/session.go Request->Do throws away the text so that it is not available in client.go::GetNextID. But at least the err object still contains the 400 http code. So i use this value to send another nextid request which then jumps beyond the 104 ID.

proxmox-terraform


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Telmate/proxmox-api-go/pull/25 **Author:** [@lausser](https://github.com/lausser) **Created:** 5/4/2019 **Status:** ✅ Merged **Merged:** 6/5/2019 **Merged by:** [@ggongaware](https://github.com/ggongaware) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`489a263`](https://github.com/Telmate/proxmox-api-go/commit/489a263f4d4e425f0b251447ae95730d48962d4a) Fix an issue where next id already exists ### 📊 Changes **1 file changed** (+2 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `proxmox/client.go` (+2 -0) </details> ### 📄 Description Hi, i'm using your terraform-provider-proxmox and ran into a problem. When i wanted to create 6 qemu machines node1...node6, only two appeared in the Proxmox gui and terraform war running forever. The reason was: The next free ID was 102 Only 102 and 103 were available, but proxmox-api-go requried that a whole range of 6 consecutive IDs were free. I added a few debug logs to client.go and session.go and found out that in fact Proxmox returned a message {"errors":{"vmid":"VM 104 already exists"},"data":null}, which unfortunately got unhandled. proxmox-api-go/proxmox/session.go Request->Do throws away the text so that it is not available in client.go::GetNextID. But at least the err object still contains the 400 http code. So i use this value to send another nextid request which then jumps beyond the 104 ID. ![proxmox-terraform](https://user-images.githubusercontent.com/198968/57184631-778bc100-6ebe-11e9-9d29-eee21ecc38f9.jpg) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:40:55 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#163
No description provided.