Should You Use "localhost" Instead of Node Name in Proxmox API Requests?

vijay98

New Member
Mar 22, 2024
2
0
1
When interacting with the Proxmox VE API, some users have found that using <span>localhost</span> instead of a specific node name makes their API requests work more reliably. This raises the question: should Proxmox users always default to localhost in API requests, or are there potential downsides?

Observations from Users

Many have reported that using localhost in API requests works flawlessly when we hit the API request from the local machine. For example:

Working Request:

https://192.168.108.219:8006/api2/json/nodes/localhost/qemu/
https://192.168.108.219:8006/api2/json/nodes/pve219/qemu/

Call for Discussion

To the Proxmox VE community, should using [localhost] be the recommended best practice in API requests? Are there any potential downsides we haven't considered?

We invite feedback from PVE members to clarify whether relying on localhost is a valid workaround or if it's better to resolve node name issues directly. Let's discuss!
 
Last edited:
When interacting with the Proxmox VE API, some users have found that using <span>localhost</span> instead of a specific node name makes their API requests work more reliably
How so?

Using localhost will just always use the node you direct the API request in the first place.
If that's the node you want to operate this API call on then fine, otherwise it's simply wrong.
E.g., if a guest VMID is on another node then it simply won't work if you use localhost.

btw. you post reeks of LLM AI slop, please don't use that in our forum – I rather see some typos and bad grammar than some mindless text that reads perfectly language wise but just makes not much sense semantically.