Proxmox Cluster Terraform

JoccE

New Member
Mar 28, 2023
2
1
3
Hello,

I am running a couple 20+ node cluster today and we are deploying VMs using terraform (bgp/proxmox)

Since as far as we know in the API you have to specify which one of the nodes you want to deploy the VM to we have created a javascript in between Proxmox and terraform that translates node_name = any -> Node with least used RAM

So our current flow is

Terraform -> NodeJS App -> Looks for the node with the least used ram (We have a lot of other checks here also but that is the basics) -> Deploys on NodeX

Does anyone know if there is a better way to do this where you don't have to hardcode the Node_Name on VMs?
Is there plans for something similar in Proxmox future?

Are we missing something everyone else is doing?
 
It's unlikely that API requirements will change any time soon. So you will always need to specify a node when creating a VM.

Currently, there is no better way to find a suitable node than what you are doing. If you search for "proxmox DRS" you will find many various scripts that people have written to solve this.
PVE did release functionality in that area but it was related to finding a resource on the HA event: https://www.proxmox.com/en/about/press-releases/proxmox-virtual-environment-7-3

So I'd say for now - keep doing what you are doing if it works for you.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox