Skip to content

Update CIDR/Gateway of the Shared Networks from Guest IP ranges #11249

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
wants to merge 4 commits into
base: 4.19
Choose a base branch
from

Conversation

sureshanaparti
Copy link
Contributor

@sureshanaparti sureshanaparti commented Jul 20, 2025

Description

This PR updates the CIDR/Gateway of the Shared Networks from Guest IP ranges.

CIDR/Gateway list are maintained for shared networks in networks table (null when there are no Guest IP ranges), and only the first one would be returned through the list networks response (for backward compatibility).

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):

How Has This Been Tested?

Created a shared network with gateway/netmask/startip/endip, Checked the network cidr/gateway after the following operations - added more guest ip ranges to the shared network, removed some ranges and added new ranges, removed all ranges and added new ranges. Deployed instances on the shared network.

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

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances shared network functionality by allowing network CIDR and gateway fields to store comma-separated values representing multiple IP ranges. When guest IP ranges are added or removed from a shared network, the corresponding CIDR and gateway values are automatically updated to reflect all active ranges.

  • Adds utility methods for managing comma-separated strings and extracting first values
  • Modifies network CIDR/gateway management to support multiple values during IP range operations
  • Updates API responses to display only the first CIDR/gateway value for backward compatibility

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
StringUtils.java Adds utility methods for comma-separated string manipulation and first value extraction
ConfigurationManagerImpl.java Updates VLAN creation/deletion to maintain network CIDR/gateway lists
ApiResponseHelper.java Modifies network response to show first CIDR/gateway value only
schema-41930to41940.sql Increases database column sizes for CIDR and gateway fields
schema-41930to41940-cleanup.sql Empty cleanup script for database migration
Upgrade41930to41940.java Database upgrade handler for version 4.19.3.0 to 4.19.4.0
Upgrade41920to41930.java Database upgrade handler for version 4.19.2.0 to 4.19.3.0
DatabaseUpgradeChecker.java Registers new upgrade handlers in the upgrade chain

@sureshanaparti sureshanaparti added this to the 4.19.4 milestone Jul 20, 2025
@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

Copy link

codecov bot commented Jul 20, 2025

Codecov Report

Attention: Patch coverage is 9.60000% with 113 lines in your changes missing coverage. Please review.

Project coverage is 15.18%. Comparing base (bf46458) to head (01ef7f3).
Report is 2 commits behind head on 4.19.

Files with missing lines Patch % Lines
.../cloud/configuration/ConfigurationManagerImpl.java 0.00% 38 Missing ⚠️
...ava/com/cloud/upgrade/dao/Upgrade41930to41940.java 18.51% 22 Missing ⚠️
...ils/src/main/java/com/cloud/utils/StringUtils.java 0.00% 22 Missing ⚠️
...ava/com/cloud/upgrade/dao/Upgrade41920to41930.java 26.31% 14 Missing ⚠️
...src/main/java/com/cloud/api/ApiResponseHelper.java 0.00% 9 Missing ⚠️
...com/cloud/network/element/BigSwitchBcfElement.java 0.00% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              4.19   #11249       +/-   ##
============================================
+ Coverage     4.28%   15.18%   +10.89%     
- Complexity       0    11368    +11368     
============================================
  Files          372     5417     +5045     
  Lines        29746   476015   +446269     
  Branches      5230    58111    +52881     
============================================
+ Hits          1274    72269    +70995     
- Misses       28327   395660   +367333     
- Partials       145     8086     +7941     
Flag Coverage Δ
uitests 4.28% <ø> (ø)
unittests 15.90% <9.60%> (-0.01%) ⬇️

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.

@blueorangutan
Copy link

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

@sureshanaparti
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File

@sureshanaparti sureshanaparti marked this pull request as ready for review July 21, 2025 10:40
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.

2 participants