Skip to content

server: fix host anti-affinity when start batch vms#6002

Merged
weizhouapache merged 1 commit into
apache:mainfrom
weizhouapache:4.17-fix-host-anti-affinity-start-batch-vms
Feb 21, 2022
Merged

server: fix host anti-affinity when start batch vms#6002
weizhouapache merged 1 commit into
apache:mainfrom
weizhouapache:4.17-fix-host-anti-affinity-start-batch-vms

Conversation

@weizhouapache

Copy link
Copy Markdown
Member

Description

This PR fixes #5527

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

@weizhouapache

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2644

@nvazquez nvazquez added this to the 4.17.0.0 milestone Feb 18, 2022

@nvazquez nvazquez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manually tested on KVM with 2 hosts:

Success cases:

  • Create anti-affinity group
  • Attempt deploying 3 VMs assigning them to anti-affinity group -> RESULT: first 2 VMs running one on each host, 3rd deployment fails
  • Stop the 2 running VMs
  • Deploy VM without start, assigning it to the anti-affinity group
  • Start 3 VMs in batch -> RESULT: 2 VMs running on different hosts (screenshot)

Screen Shot 2022-02-17 at 22 06 56

Failing case:

  • 2 VMs running one on each host
  • Attemp to start the third VM on a specific host (different form the last_host_id) -> RESULT 3 VMs running (screenshot)

Screen Shot 2022-02-17 at 22 12 07

@weizhouapache

Copy link
Copy Markdown
Member Author

Manually tested on KVM with 2 hosts:

Success cases:

  • Create anti-affinity group
  • Attempt deploying 3 VMs assigning them to anti-affinity group -> RESULT: first 2 VMs running one on each host, 3rd deployment fails
  • Stop the 2 running VMs
  • Deploy VM without start, assigning it to the anti-affinity group
  • Start 3 VMs in batch -> RESULT: 2 VMs running on different hosts (screenshot)
Screen Shot 2022-02-17 at 22 06 56

Failing case:

  • 2 VMs running one on each host
  • Attemp to start the third VM on a specific host (different form the last_host_id) -> RESULT 3 VMs running (screenshot)
Screen Shot 2022-02-17 at 22 12 07

@nvazquez
thanks for testing.

the case seems to be expected behaviour. see below

if (plan.getHostId() != null && haVmTag == null) {
Long hostIdSpecified = plan.getHostId();
if (s_logger.isDebugEnabled()) {
s_logger.debug("DeploymentPlan has host_id specified, choosing this host and making no checks on this host: " + hostIdSpecified);
}

@DaanHoogland

Copy link
Copy Markdown
Contributor

@nvazquez thanks for testing.

the case seems to be expected behaviour. see below

if (plan.getHostId() != null && haVmTag == null) {
Long hostIdSpecified = plan.getHostId();
if (s_logger.isDebugEnabled()) {
s_logger.debug("DeploymentPlan has host_id specified, choosing this host and making no checks on this host: " + hostIdSpecified);
}

@weizhouapache @nvazquez , this does not seem like desired behaviour, unless we decide to allow it (for root admin only). I think a user should remove a VM from the anti-affinity group if they want it to run anyway.

code changes looks good, btw.

@weizhouapache

Copy link
Copy Markdown
Member Author

@nvazquez thanks for testing.
the case seems to be expected behaviour. see below

if (plan.getHostId() != null && haVmTag == null) {
Long hostIdSpecified = plan.getHostId();
if (s_logger.isDebugEnabled()) {
s_logger.debug("DeploymentPlan has host_id specified, choosing this host and making no checks on this host: " + hostIdSpecified);
}

@weizhouapache @nvazquez , this does not seem like desired behaviour, unless we decide to allow it (for root admin only). I think a user should remove a VM from the anti-affinity group if they want it to run anyway.

code changes looks good, btw.

@DaanHoogland
Actually only root admin can start vm with specified host.

@nvazquez

Copy link
Copy Markdown
Contributor

Thanks @weizhouapache @DaanHoogland - looks good then

@nvazquez

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-3391)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 30959 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6002-t3391-kvm-centos7.zip
Smoke tests completed. 92 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@weizhouapache weizhouapache marked this pull request as ready for review February 21, 2022 08:25
@weizhouapache weizhouapache merged commit 5d1e54a into apache:main Feb 21, 2022
@weizhouapache weizhouapache deleted the 4.17-fix-host-anti-affinity-start-batch-vms branch December 9, 2022 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Anti affinity Groups not work sometimes , Start VM in batches

4 participants