Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CP-47302: VM start with anti-affinity #5577

Conversation

BengangY
Copy link
Contributor

@BengangY BengangY commented Apr 22, 2024

VM in an anti-affinity group will choose a host based on the following steps:

  1. If the VM is associated with an anti-affinity group, compute the amount
    of VMs associated with this anti-affinity group for each host.
  2. Group these hosts based on the VM's amount. The hosts with the same VM
    amount are in the same group. Sort all the host groups ascending based on
    the VM's amount.
  3. If a host is an affinity host for this VM, it will be treated as a single
    host group and be put on the head of the group list.
  4. Choose a host which the VM can run on it from each group.

@BengangY BengangY marked this pull request as ready for review April 22, 2024 06:28
ocaml/xapi/xapi_vm_helpers.ml Outdated Show resolved Hide resolved
quality-gate.sh Outdated Show resolved Hide resolved
ocaml/xapi/xapi_vm_helpers.ml Outdated Show resolved Hide resolved
ocaml/xapi/xapi_vm_helpers.ml Outdated Show resolved Hide resolved
ocaml/xapi/xapi_vm_helpers.ml Outdated Show resolved Hide resolved
@gangj
Copy link
Contributor

gangj commented Apr 23, 2024

For the 1st commit: "CP-47302: VM start with anti-affinity", would you please add some descriptions about the anti-affinity rules for VM start: how a host is chosen for anti-affinity VM.

For the 2nd commit, the commit message would be better as:
"CP-47302: UT for VM start with anti-affinity"

@BengangY BengangY force-pushed the private/bengangy/CP-47302 branch 2 times, most recently from d777784 to e6102d5 Compare April 24, 2024 08:21
quality-gate.sh Outdated Show resolved Hide resolved
ocaml/xapi/xapi_vm_helpers.ml Outdated Show resolved Hide resolved
@BengangY BengangY force-pushed the private/bengangy/CP-47302 branch 2 times, most recently from d15d63c to 6c835fb Compare April 25, 2024 07:29
VM in an anti-affinity group will choose a host based on the following steps:
1. If the VM is associated with an anti-affinity group, compute the number
   of VMs associated with this anti-affinity group for each host.
2. Group these hosts based on the VM's count. The hosts in one group have the
   same number of VMs in one anti-affinity group. Sort all the host groups
   ascending based on the VM's count.
3. If a host is the affinity host of this VM, it will be treated as a single
   host group and be put on the head of the group list.
4. Choose a host randomly which the VM can run on it from each group.

Signed-off-by: Bengang Yuan <bengang.yuan@cloud.com>
Signed-off-by: Bengang Yuan <bengang.yuan@cloud.com>
@robhoes robhoes merged commit aeac4cc into xapi-project:feature/vm-anti-affinity Apr 25, 2024
13 checks passed
Copy link

pytype_reporter extracted 50 problem reports from pytype output

.

You can check the results of the job here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants