[PR #127] [MERGED] retrieve all VMs by name (not only first) #249

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

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/127
Author: @mizhka
Created: 7/13/2021
Status: Merged
Merged: 7/13/2021
Merged by: @ggongaware

Base: masterHead: master


📝 Commits (1)

  • 49b5ffc retrieve all VMs by name (not only first)

📊 Changes

2 files changed (+47 additions, -12 deletions)

View changed files

📝 main.go (+31 -9)
📝 proxmox/client.go (+16 -3)

📄 Description

This commit brings API to fetch all VMs matching specified name. It adds additional
method Client.GetVmRefsByName in addition to GetVmRefByName.

The background is that it's possible to create several templates in ProxMox
on different nodes with same name. Packer provider uses GetVmRefByName to
retrieve VM ID for cloning, but it may return unexpected VM ID. As result, cloning
will fail with error, for example:
"500 can't clone VM to node '...' (VM uses local storage)"

Let's add way to fetch all VMs matching specified name for further filtering.

Also it brings extra command 'listQemuSnapshot2'


🔄 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/127 **Author:** [@mizhka](https://github.com/mizhka) **Created:** 7/13/2021 **Status:** ✅ Merged **Merged:** 7/13/2021 **Merged by:** [@ggongaware](https://github.com/ggongaware) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`49b5ffc`](https://github.com/Telmate/proxmox-api-go/commit/49b5ffc5a0427ba96370f924060bd787f310f1e1) retrieve all VMs by name (not only first) ### 📊 Changes **2 files changed** (+47 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `main.go` (+31 -9) 📝 `proxmox/client.go` (+16 -3) </details> ### 📄 Description This commit brings API to fetch all VMs matching specified name. It adds additional method Client.GetVmRefsByName in addition to GetVmRefByName. The background is that it's possible to create several templates in ProxMox on different nodes with same name. Packer provider uses GetVmRefByName to retrieve VM ID for cloning, but it may return unexpected VM ID. As result, cloning will fail with error, for example: "500 can't clone VM to node '...' (VM uses local storage)" Let's add way to fetch all VMs matching specified name for further filtering. Also it brings extra command 'listQemuSnapshot2' --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:41:25 +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#249
No description provided.