VM Affinity

skwal

New Member
Jun 27, 2024
1
0
1
Hello

In Proxmox 8.2 is there a way to set up affinity between two virtual machines ? The goal is to be sure that two VM are not on the same host.

THX
 
Hello, you should use ha-groups for that and pin vms to different hosts.
For example: vm1 pinned to host1/2 and vm2 pinned to host 3. or different, depending on what cluster-node-count you have.
 
  • Like
Reactions: gurubert
Hi @skwal , to answer your question - there is no "one-checkmark" built into PVE to achieve your goal.

Given a sufficient number of hosts in the cluster, the solution proposed by @jsterr can work.
However, if the number of nodes is small - then it becomes increasingly harder.

Realistically, with 5 nodes you could:
VM1 - restrict to n1,n2
VM2 - restrict to n3,n4
Manually add/remove n5 on the failure of any one host in group 1 or 2.

You could do 4+qdevice.
With 3 nodes you will need a procedure in place to recover manually after failure.

Sadly, the more reliable approach is an outside script that polls the cluster often and moves VMs around as needed.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Last edited:
  • Like
Reactions: gurubert and jsterr