VM affinity

no, that is not directly possible. if you have enough nodes and a high availability setup, you can define mutually exclusive restricted HA groups to ensure that VMs are never put on the same nodes.
 
I would include it If someone provides a patch ...

I would like to contribute but first i'm not a perl programmer thus I need more time than as usual, second I don't know where to start, do you have a 'developers' documentation ?
 
Thanks.
If I have questions, should I ask here or do you have a developer mailinglist?

In example, probably VM affinity should be verified during a VM migration due to a failure (doing this allows administrator to move the VM manually ignoring the affinity), so, I think that some code could be implemented in the sub
Code:
$recover_fenced_service
inside src/PVE/HA/Manager.pm

that sub calls
Code:
select_service_node()
, there I can verify the affinity and skip some nodes.

I'm on the good way or totally out ?
 
I think you're referring to a setup where you have a primary and a secondary system like DNS or DHCP and don't want to have both VMs on one physical host, right? You're not referring to affinity in terms of logical or physical partitioning for licensing purpose.

Theoretical question:
What should be done if a VM has no "working" hosts with an affinity set, only anti-affinity. What should be done with the HA-VM?
 
It could be choosen from the web interface, if running on the first available or keep it powered off

A flag like "ignore anti-affinity if no hosts are available"
If set to true and the anti-affinity is rejecting all hosts, the VM would start anyway somewhere. If set to false, the VM will stay powered off
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!