Proxmox API (open tofu edition!)

mcproxy

New Member
Nov 2, 2023
2
0
1
Hi all!

I understand the uniqeness of my situation but to help support the tooling I'm using, I'm wondering if someone can help me out.

I'm using opentofu with the telmate Proxmox provider.

When I try to run tofu I'm seeing a bunch of 500 responses in my logs (this has been happening for a _long_ time!) eg.

Code:
::ffff:172.24.15.3 - root@pam [16/10/2025:16:31:20 +1300] "GET /api2/json/cluster/ha/resources/121 HTTP/1.1" 500 53
::ffff:172.24.15.3 - root@pam [16/10/2025:16:31:23 +1300] "GET /api2/json/cluster/ha/resources/102 HTTP/1.1" 500 53
::ffff:172.24.15.3 - root@pam [16/10/2025:16:31:23 +1300] "GET /api2/json/cluster/ha/resources/121 HTTP/1.1" 500 53
::ffff:172.24.15.3 - root@pam [16/10/2025:16:31:30 +1300] "GET /api2/json/cluster/ha/resources/127 HTTP/1.1" 500 53
::ffff:172.24.15.3 - root@pam [16/10/2025:16:31:30 +1300] "GET /api2/json/cluster/ha/resources/145 HTTP/1.1" 500 53
::ffff:172.24.15.3 - root@pam [16/10/2025:16:31:33 +1300] "GET /api2/json/cluster/ha/resources/116 HTTP/1.1" 500 53
::ffff:172.24.15.3 - root@pam [16/10/2025:16:31:36 +1300] "GET /api2/json/cluster/ha/resources/139 HTTP/1.1" 500 53
::ffff:172.24.15.3 - root@pam [16/10/2025:16:31:36 +1300] "GET /api2/json/cluster/ha/resources/116 HTTP/1.1" 500 53

Today I thought I'd take a look (when I create a new LXC it does work).

Troubleshooting

To troubleshoot I've been looking at the API using curl and now via pvesh.

Looking at /cluster/resources I can see containers existing:
Code:
┌────────────────────────────────────────────────┬─────────┬─────────────┬───────────
│ id                                             │ type    │ cgroup-mode │ content
╞════════════════════════════════════════════════╪═════════╪═════════════╪═══════════
│ lxc/100                                        │ lxc     │             │
├────────────────────────────────────────────────┼─────────┼─────────────┼───────────
│ lxc/101                                        │ lxc     │             │
├────────────────────────────────────────────────┼─────────┼─────────────┼───────────
│ lxc/102                                        │ lxc     │             │
├────────────────────────────────────────────────┼─────────┼─────────────┼───────────
│ lxc/103                                        │ lxc     │             │
├────────────────────────────────────────────────┼─────────┼─────────────┼───────────

however as per https://pve.proxmox.com/pve-docs/api-viewer/#/cluster/ha/resources/{sid} when I query the resource (ie. as the 500 requests are) I get no data:

Code:
root@proxmox1:~# pvesh get /cluster/ha/resources/101
no such resource 'ct:101'
root@proxmox1:~# pvesh get /cluster/ha/resources/ct:101
no such resource 'ct:101'

Anyone have any insights for me :)

Thanks in advance!
 
Last edited:
Hmmm - just noticing the ha in the API request.

Adding a node to HA config, and the request works. Looking at the opentofu provider now re: HA config!
 
Hi!

Did you add CT 101 as a HA resource? /cluster/resources simply lists cluster-wide resources in the general sense. The request made by the OpenTofu provider is to /cluster/ha/resources, which will only list resources that are HA-managed.

edit: just noticed that you already kind of figured this out. Refreshed the page a little too late.