Skip to content

VMware: wait for NSX DV port group readiness - #13753

Open
Dogface2k wants to merge 2 commits into
apache:4.22from
Dogface2k:agent/wait-for-nsx-dvportgroup
Open

VMware: wait for NSX DV port group readiness#13753
Dogface2k wants to merge 2 commits into
apache:4.22from
Dogface2k:agent/wait-for-nsx-dvportgroup

Conversation

@Dogface2k

Copy link
Copy Markdown

Description

This PR prevents VMware NSX-backed guest network implementation from failing when vCenter has not yet exposed the backing distributed virtual port group immediately after NSX segment creation.

The NSX branch in HypervisorHostHelper.prepareNetwork now uses the existing bounded waitForDvPortGroupReady path. The change does not retry the CloudStack mutation or create a second network; it only waits for vCenter inventory visibility before returning the already-created port group.

A regression test simulates an empty first vCenter lookup followed by the port group becoming available. The existing immediate-availability behavior remains covered.

Fixes: #13752

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)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

Not applicable.

How Has This Been Tested?

Targeted regression and baseline tests were run on the 4.22 branch with Java 17:

HypervisorHostHelperTest#testPrepareNetwork
HypervisorHostHelperTest#testPrepareNetworkWaitsForNsxDvPortGroup

Tests run: 2, Failures: 0, Errors: 0, Skipped: 0

The Maven reactor built all 18 required modules successfully, including cloud-vmware-base, with zero Checkstyle violations.

How did you try to break this feature and the system with this change?

The regression test makes the first vCenter DV port group query return no result and the second return the expected port group. The pre-existing immediate-availability test also runs to verify the normal fast path remains unchanged. The production path remains bounded by the existing readiness timeout and returns failure if the port group never appears.

@boring-cyborg

boring-cyborg Bot commented Jul 30, 2026

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
Here are some useful points:

@Dogface2k
Dogface2k marked this pull request as ready for review July 30, 2026 15:30
@DaanHoogland DaanHoogland added this to the 4.22.2 milestone Jul 31, 2026

@DaanHoogland DaanHoogland 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.

clgtm

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.69%. Comparing base (0339f31) to head (b577ae6).
⚠️ Report is 1 commits behind head on 4.22.

Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #13753      +/-   ##
============================================
- Coverage     17.69%   17.69%   -0.01%     
- Complexity    15833    15834       +1     
============================================
  Files          5925     5925              
  Lines        533534   533534              
  Branches      65273    65273              
============================================
- Hits          94421    94417       -4     
- Misses       428434   428441       +7     
+ Partials      10679    10676       -3     
Flag Coverage Δ
uitests 3.69% <ø> (ø)
unittests 18.77% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: dahn <daan.hoogland@gmail.com>
@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18740

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan help

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland [SL] I understand these words: "help", "hello", "thanks", "package", "test"
Test command usage: test [mgmt os] [hypervisor] [keepEnv] [qemuEv] [basicZone|securityGroups]
Mgmt OS options: ['suse15', 'alma10', 'ol10', 'rocky10', 'alma9', 'centos7', 'centos6', 'rocky9', 'alma8', 'ubuntu18', 'ol9', 'ol8', 'ubuntu22', 'debian12', 'ubuntu20', 'ubuntu26', 'rocky8', 'ubuntu24']
Hypervisor options: ['kvm-centos6', 'kvm-centos7', 'kvm-rocky8', 'kvm-rocky9', 'kvm-rocky10', 'kvm-ol8', 'kvm-ol9', 'kvm-ol10', 'kvm-alma8', 'kvm-alma9', 'kvm-alma10', 'kvm-ubuntu18', 'kvm-ubuntu20', 'kvm-ubuntu22', 'kvm-ubuntu24', 'kvm-ubuntu26', 'kvm-debian12', 'kvm-suse15', 'vmware-55u3', 'vmware-60u2', 'vmware-65u2', 'vmware-67u3', 'vmware-70u1', 'vmware-70u2', 'vmware-70u3', 'vmware-80', 'vmware-80u1', 'vmware-80u2', 'vmware-80u3', 'vmware-80u3e', 'xenserver-65sp1', 'xenserver-71', 'xenserver-74', 'xenserver-84', 'xcpng74', 'xcpng76', 'xcpng80', 'xcpng81', 'xcpng82', 'xcpng83']
Note: when keepEnv is passed, you need to specify mgmt server os and hypervisor or use the matrix command.
when qemuEv is passed, it will deploy KVM hyperviosr hosts with qemu-kvm-ev, else it will default to stock qemu.
When basicZone and/or securityGroups are passed it will create a zone of the last type specified (default is Advanced)
Package command usage: package [all(default value),kvm,xen,vmware,hyperv,ovm] - a comma separated list can be passed with package command to bundle the required hypervisor's systemVM templates. Not passing any argument will bundle all - kvm,xen and vmware templates.

Blessed contributors for kicking Trillian test jobs: ['rohityadavcloud', 'shwstppr', 'Damans227', 'vishesh92', 'Pearl1594', 'harikrishna-patnala', 'nvazquez', 'DaanHoogland', 'weizhouapache', 'borisstoyanov', 'vladimirpetrov', 'kiranchavala', 'andrijapanicsb', 'NuxRo', 'rajujith', 'sureshanaparti', 'abh1sar', 'sudo87', 'RosiKyu']

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test ol10 vmware-80u3

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (ol10 mgmt + vmware-80u3) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-16671)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VMware NSX network implementation can fail before backing DV port group is visible

3 participants