Skip to content

Re-reserve released NICs when a VM resyncs to Running to restore nics_count - #14460

Draft
Pearl1594 wants to merge 1 commit into
4.22from
ghi14177-nic-reconcile-4.22
Draft

Pearl1594 wants to merge 1 commit into
4.22from
ghi14177-nic-reconcile-4.22

Conversation

@Pearl1594

@Pearl1594 Pearl1594 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR fixes: #14177

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

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

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

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.07%. Comparing base (345db51) to head (99d9c27).

Files with missing lines Patch % Lines
...tack/engine/orchestration/NetworkOrchestrator.java 0.00% 16 Missing ⚠️
...n/java/com/cloud/vm/VirtualMachineManagerImpl.java 0.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #14460   +/-   ##
=========================================
  Coverage     18.07%   18.07%           
- Complexity    16357    16361    +4     
=========================================
  Files          5937     5937           
  Lines        537029   537058   +29     
  Branches      65833    65836    +3     
=========================================
+ Hits          97043    97054   +11     
- Misses       428901   428919   +18     
  Partials      11085    11085           
Flag Coverage Δ
uitests 4.04% <ø> (ø)
unittests 19.14% <0.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.

ActionEventUtils.onActionEvent(User.UID_SYSTEM, Account.ACCOUNT_ID_SYSTEM, vm.getDomainId(),
EventTypes.EVENT_VM_START, "Out of band VM power on", vm.getId(), getApiCommandResourceTypeForVm(vm).toString());
logger.info("VM {} is sync-ed to at Running state according to power-on report from hypervisor.", vm.getInstanceName());
reconcileNicsForRunningVm(vm);

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.

why do we need it in the stopped||stopping block? if the VM never reports as running again we have a spare nic in our nic count. should it be added to the start block instead.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

when a running vm is reported as stopped, cloudstack will send a command to force-stop it (I guess it is to ensure the vm is stopped) , and release the nic when done.

as far as I know, nics_count is not used any more to determine if the network need to be shutdown. the goal of this PR is to restore the nic state, not nics_count. PR title should be updated.

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.

@Pearl1594 do you agree? can you update the PR title aprpriately?

This branch has not been deployed

No deployments
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.

NetworkGarbageCollector releases a network's VLAN while it still has live NICs

3 participants