Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enhance DHCP functionality by adding lease timeout support #12410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
NVShawn wants to merge 3 commits into apache:main
base: main
Choose a base branch
Loading
from NVShawn:main

Conversation

@NVShawn
Copy link

@NVShawn NVShawn commented Jan 12, 2026

Description

This PR enhances the feature added in #3662 to allow for non-infinite dhcp lease times.

So we do not break current installs, we keep the 'infinite' lease time as default but allow for a config to change the lease times to non-infinite values.

We've had issues with VMs with the lease set to infinite where they never check to see if their IP is still available, so we get IP conflicts. In our environment, with a combination of very short lived and long lived VMs and constrained IP address, we have to rely on IP address re-use and lease timeouts. This change allows us to configure our IP lease timeouts without modifying default behavior.

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

...s components. Updated DhcpEntryCommand to include lease time, modified VmDhcpConfig to handle lease time, and adjusted related scripts and configurations to accommodate this new parameter. This allows for configurable DHCP lease durations, improving flexibility in network management.
Copy link

boring-cyborg bot commented Jan 12, 2026

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:

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

looks generally good, one remark and also needs testing of course

Copy link

codecov bot commented Jan 13, 2026
edited
Loading

Codecov Report

❌ Patch coverage is 31.57895% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.85%. Comparing base (b8813c7) to head (7f8b90f).
⚠️ Report is 27 commits behind head on main.

Files with missing lines Patch % Lines
...nt/resource/virtualnetwork/model/VmDhcpConfig.java 0.00% 9 Missing ⚠️
.../com/cloud/agent/api/routing/DhcpEntryCommand.java 50.00% 3 Missing ⚠️
...rce/virtualnetwork/facade/DhcpEntryConfigItem.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@
## main #12410 +/- ##
============================================
+ Coverage 17.76% 17.85% +0.09% 
- Complexity 15863 15984 +121 
============================================
 Files 5923 5929 +6 
 Lines 530558 531102 +544 
 Branches 64830 64914 +84 
============================================
+ Hits 94262 94851 +589 
+ Misses 425749 425636 -113 
- Partials 10547 10615 +68 
Flag Coverage Δ
uitests 3.58% <ø> (+0.01%) ⬆️
unittests 18.95% <31.57%> (+0.10%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Contributor

@NVShawn you have some conflicts with the style guards ; trailing white spaces and unused imports as far I saw.

Copy link
Contributor

@blueorangutan package

Copy link

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

Copy link

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

Copy link
Contributor

@blueorangutan package

Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

Copy link

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

Copy link
Contributor

@NVShawn , every other time we get an unnecessary stubbing error in unpredictable order in

11:50:09 [INFO] Running org.apache.cloudstack.maintenance.ManagementServerMaintenanceManagerImplTest
11:50:09 [ERROR] Tests run: 34, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.196 s <<< FAILURE! - in org.apache.cloudstack.maintenance.ManagementServerMaintenanceManagerImplTest
11:50:12 [ERROR] unnecessary Mockito stubbings(org.apache.cloudstack.maintenance.ManagementServerMaintenanceManagerImplTest) Time elapsed: 0.019 s <<< ERROR!
11:50:12 org.mockito.exceptions.misusing.UnnecessaryStubbingException: 
11:50:12 
11:50:12 Unnecessary stubbings detected in test class: ManagementServerMaintenanceManagerImplTest
11:50:12 Clean & maintainable test code requires zero unnecessary code.
11:50:12 Following stubbings are unnecessary (click to navigate to relevant line of code):
11:50:12 1. -> at org.apache.cloudstack.maintenance.ManagementServerMaintenanceManagerImplTest.prepareForMaintenanceAndCancelFromPreparingForMaintenanceState(ManagementServerMaintenanceManagerImplTest.java:342)
11:50:12 Please remove unnecessary stubbings or use 'lenient' strictness. More info: javadoc for UnnecessaryStubbingException class.
11:50:12 
11:50:12 [INFO] 
11:50:12 [INFO] Results:
11:50:12 [INFO] 
11:50:12 [ERROR] Errors: 
11:50:12 [ERROR] ManagementServerMaintenanceManagerImplTest.unnecessary Mockito stubbings ? UnnecessaryStubbing
11:50:12 [INFO] 
11:50:12 [ERROR] Tests run: 34, Failures: 0, Errors: 1, Skipped: 0

This time in the ubuntu build and last time in the EL build. I discussed quickly with @vishesh92 and it might be due to a timing issue that makes the stub being called sometimes and not at other times (due to your changes???). I think we need to fix the test to continue :(

Copy link
Member

@NVShawn , every other time we get an unnecessary stubbing error in unpredictable order in

11:50:09 [INFO] Running org.apache.cloudstack.maintenance.ManagementServerMaintenanceManagerImplTest
11:50:09 [ERROR] Tests run: 34, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.196 s <<< FAILURE! - in org.apache.cloudstack.maintenance.ManagementServerMaintenanceManagerImplTest
11:50:12 [ERROR] unnecessary Mockito stubbings(org.apache.cloudstack.maintenance.ManagementServerMaintenanceManagerImplTest) Time elapsed: 0.019 s <<< ERROR!
11:50:12 org.mockito.exceptions.misusing.UnnecessaryStubbingException: 
11:50:12 
11:50:12 Unnecessary stubbings detected in test class: ManagementServerMaintenanceManagerImplTest
11:50:12 Clean & maintainable test code requires zero unnecessary code.
11:50:12 Following stubbings are unnecessary (click to navigate to relevant line of code):
11:50:12 1. -> at org.apache.cloudstack.maintenance.ManagementServerMaintenanceManagerImplTest.prepareForMaintenanceAndCancelFromPreparingForMaintenanceState(ManagementServerMaintenanceManagerImplTest.java:342)
11:50:12 Please remove unnecessary stubbings or use 'lenient' strictness. More info: javadoc for UnnecessaryStubbingException class.
11:50:12 
11:50:12 [INFO] 
11:50:12 [INFO] Results:
11:50:12 [INFO] 
11:50:12 [ERROR] Errors: 
11:50:12 [ERROR] ManagementServerMaintenanceManagerImplTest.unnecessary Mockito stubbings ? UnnecessaryStubbing
11:50:12 [INFO] 
11:50:12 [ERROR] Tests run: 34, Failures: 0, Errors: 1, Skipped: 0

This time in the ubuntu build and last time in the EL build. I discussed quickly with @vishesh92 and it might be due to a timing issue that makes the stub being called sometimes and not at other times (due to your changes???). I think we need to fix the test to continue :(

I am not sure if this is related to the changes in the PR. I am not sure but I think I remember seeing similar failures in a different PR as well. I checked the tests and couldn't find why this might happen. Let me try building the packages again.

@blueorangutan package

DaanHoogland reacted with eyes emoji

Copy link

@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

Copy link

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

Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

code lgtm

Copy link
Member

@blueorangutan package

Copy link

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

Copy link

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

Copy link
Contributor

Copy link

@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

Copy link

[SF] Trillian test result (tid-15327)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 51266 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12410-t15327-kvm-ol8.zip
Smoke tests completed. 147 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestClusterDRS>:setup Error 0.00 test_cluster_drs.py
test_isolate_network_password_server Failure 42.81 test_password_server.py
test_02_list_cpvm_vm Failure 0.04 test_ssvm.py
test_04_cpvm_internals Failure 0.04 test_ssvm.py

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

Reviewers

@DaanHoogland DaanHoogland DaanHoogland left review comments

+1 more reviewer

@weizhouapache weizhouapache weizhouapache approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.23.0

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /