You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Three defects found reviewing the previous commits, all in how DRS
decides whether a planned migration is still allowed.
Non-strict anti-affinity was discarded entirely. Non-strict groups
express themselves by lowering a host's priority on the deployment plan
rather than by excluding it, and DRS built a plan, handed it to the
processors, read only the exclude list and threw the plan away.
Non-strict means the rule may be broken when there is nowhere else to
put a VM. That cannot arise while rebalancing: the VM already runs
somewhere that satisfies the group and leaving it there is always an
option. Being better balanced is not a reason to break it.
A host was treated as free the moment a migration away from it was
queued. The jobs are asynchronous and can fail, so a queued migration
occupies both ends until it completes. In a swap - A from host1 to
host3, B from host2 to host1 - B was cleared for host1 while A was
still on it.
- track the hosts queued migrations have not actually left
- refuse a destination that is one of them
A VM that stopped between planning and execution threw NPE inside the
affinity check, which was then logged without a stack trace.
- treat a VM that is no longer running as an out of date plan
- log the exception rather than its message
Signed-off-by: Brad House <bhouse@nexthop.ai>
Copy file name to clipboardExpand all lines: plugins/affinity-group-processors/host-anti-affinity/src/test/java/org/apache/cloudstack/affinity/HostAntiAffinityProcessorTest.java
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,7 @@
40
40
41
41
importstaticorg.junit.Assert.assertFalse;
42
42
importstaticorg.junit.Assert.assertTrue;
43
+
importstaticorg.mockito.Mockito.lenient;
43
44
importstaticorg.mockito.Mockito.when;
44
45
45
46
@RunWith(JUnit4.class)
@@ -151,10 +152,30 @@ public void testMissingGroupVmIsSkipped() {
0 commit comments