Skip to content

Anti affinity Groups not work sometimes , Start VM in batches #5527

@havengit

Description

@havengit
ISSUE TYPE
  • Bug Report
COMPONENT NAME
affinity Groups
CLOUDSTACK VERSION
CloudStack 4.15.0.0
CONFIGURATION
OS / ENVIRONMENT

CloudStack 4.15.0.0
host OS version: Ubuntu 20.04

SUMMARY

Start virtual machines in batches, anti affinity Groups not work sometimes

STEPS TO REPRODUCE

It doesn't happen every time

1.Two host in one cluster
2.add three VM to a anti-affinity group
3.VM in stopped state
4.start vm with WEB UI, Check three VM to start
5.Three VMs will start successful

logs :
vm id : 158 159 160
host id: 3 9
job-5595:
2021-09-29 09:35:14,379 DEBUG [o.a.c.a.HostAntiAffinityProcessor] (API-Job-Executor-31:ctx-ff549a9e job-5595 ctx-e1872415) (logid:ec8a48c2) Processing affinity group gumd-test for VM Id: 158
2021-09-29 09:35:14,382 DEBUG [o.a.c.a.HostAntiAffinityProcessor] (API-Job-Executor-31:ctx-ff549a9e job-5595 ctx-e1872415) (logid:ec8a48c2) Added host 3 to avoid set, since VM 159 is present on the host, in Stopped state but has reserved capacity
2021-09-29 09:35:14,383 DEBUG [o.a.c.a.HostAntiAffinityProcessor] (API-Job-Executor-31:ctx-ff549a9e job-5595 ctx-e1872415) (logid:ec8a48c2) Added host 9 to avoid set, since VM 160 is present on the host, in Stopped state but has reserved capacity

job-5598
2021-09-29 09:35:14,594 DEBUG [o.a.c.a.HostAntiAffinityProcessor] (API-Job-Executor-32:ctx-acdc74f8 job-5598 ctx-3ce8dd3b) (logid:1d2445d0) Processing affinity group gumd-test for VM Id: 159
2021-09-29 09:35:14,597 DEBUG [o.a.c.a.HostAntiAffinityProcessor] (API-Job-Executor-32:ctx-acdc74f8 job-5598 ctx-3ce8dd3b) (logid:1d2445d0) Added host 9 to avoid set, since VM 158 is present on the host, in Stopped state but has reserved capacity
2021-09-29 09:35:14,600 DEBUG [o.a.c.a.HostAntiAffinityProcessor] (API-Job-Executor-32:ctx-acdc74f8 job-5598 ctx-3ce8dd3b) (logid:1d2445d0) Added host 9 to avoid set, since VM 160 is present on the host, in Stopped state but has reserved capacity

job-5592
2021-09-29 09:35:14,498 DEBUG [o.a.c.a.HostAntiAffinityProcessor] (API-Job-Executor-30:ctx-307add2b job-5592 ctx-0802d14f) (logid:c430fdd5) Processing affinity group gumd-test for VM Id: 160
2021-09-29 09:35:14,500 DEBUG [o.a.c.a.HostAntiAffinityProcessor] (API-Job-Executor-30:ctx-307add2b job-5592 ctx-0802d14f) (logid:c430fdd5) Added host 9 to avoid set, since VM 158 is present on the host, in Stopped state but has reserved capacity
2021-09-29 09:35:14,502 DEBUG [o.a.c.a.HostAntiAffinityProcessor] (API-Job-Executor-30:ctx-307add2b job-5592 ctx-0802d14f) (logid:c430fdd5) Added host 3 to avoid set, since VM 159 is present on the host, in Stopped state but has reserved capacity


EXPECTED RESULTS
Two VMs start success , one VM start failed
ACTUAL RESULTS
Three VMs start success 

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions