Skip to content

Allow CIDR update for the shared network when the network IPs are not in use #10839

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 1 commit into
base: 4.19
Choose a base branch
from

Conversation

sureshanaparti
Copy link
Contributor

@sureshanaparti sureshanaparti commented May 8, 2025

Description

This PR allows allows CIDR update for the shared network when the network IPs are not in use (i.e. IPs not allocated)

Addresses #10459 / #10692.

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 shared network, deployed instances on it, Successfully updated CIDR after destroying the instances & destroying router (to ensure there are no allocated IPs). Deployed the instances after CIDR updated. Other tests:

Updated CIDR 10.0.0.0/22 (not subset of cidr) =>

SharedNetworkCIDR_SubnetCIDR

Updated CIDR when instance is deployed, and IP reserved =>

SharedNetworkCIDR_IPsInUse

Updated CIDR 10.0.0.0/25 (outside of existing IP range) =>

SharedNetworkCIDR_IPsRange SharedNetworkCIDR_OutsideIPRange

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

@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 May 8, 2025

Codecov Report

Attention: Patch coverage is 2.00000% with 49 lines in your changes missing coverage. Please review.

Project coverage is 4.28%. Comparing base (f0838cd) to head (1af11e6).
Report is 10 commits behind head on 4.19.

Files with missing lines Patch % Lines
...ain/java/com/cloud/network/NetworkServiceImpl.java 0.00% 41 Missing ⚠️
...ema/src/main/java/com/cloud/vm/dao/NicDaoImpl.java 12.50% 7 Missing ⚠️
.../java/com/cloud/network/guru/GuestNetworkGuru.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##               4.19   #10839       +/-   ##
=============================================
- Coverage     15.17%    4.28%   -10.89%     
=============================================
  Files          5414      371     -5043     
  Lines        475185    29700   -445485     
  Branches      57991     5211    -52780     
=============================================
- Hits          72105     1274    -70831     
+ Misses       395018    28281   -366737     
+ Partials       8062      145     -7917     
Flag Coverage Δ
uitests 4.28% <ø> (ø)
unittests 15.89% <2.00%> (-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 13304

@DaanHoogland DaanHoogland added this to the 4.19.3 milestone May 9, 2025
@sureshanaparti sureshanaparti force-pushed the allow-cidr-update-for-shared-network-with-ips-not-in-use branch from d037d0c to 1af11e6 Compare May 12, 2025 14:19
@sureshanaparti sureshanaparti changed the title [WIP] Allow CIDR update for the shared network when the network IPs are not in use (i.e. IPs not allocated to any instances) [WIP] Allow CIDR update for the shared network when the network IPs are not in use May 12, 2025
@sureshanaparti sureshanaparti changed the title [WIP] Allow CIDR update for the shared network when the network IPs are not in use Allow CIDR update for the shared network when the network IPs are not in use May 12, 2025
@sureshanaparti sureshanaparti marked this pull request as ready for review May 12, 2025 14:25
@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.

@blueorangutan
Copy link

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

@DaanHoogland
Copy link
Contributor

DaanHoogland commented May 13, 2025

@alexandremattioli @wido , any thoughts on this solution?

@weizhouapache
Copy link
Member

@sureshanaparti
to be frank, I think it would be good to update the cidr shared network, to the cidr of first available vlan IP range of the network, when

  • add vlan ip range
  • delete vlan ip range
  • update vlan ip range

the cidr will be more accurate, and does not require users to call another API (updateNetwork)

@wido
Copy link
Contributor

wido commented May 13, 2025

Overall I think this is a good change, you should be able to change the IPs of an empty network. But what about IPv6 in this case?

And we could even argue that you can change start and endip as long as these changes do not shorten the range so that existing VMs fall outside start and end.

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.

6 participants