Thanks to visit codestin.com
Credit goes to github.com

Skip to content

server: check startip and startipv6 of shared network #10704

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

Merged
merged 1 commit into from
Apr 16, 2025

Conversation

DaanHoogland
Copy link
Contributor

@DaanHoogland DaanHoogland commented Apr 14, 2025

Description

This PR...

Fixes: #10664

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?

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

@DaanHoogland
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

Copy link

codecov bot commented Apr 14, 2025

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 15.16%. Comparing base (99ea77d) to head (9c78d22).
Report is 2 commits behind head on 4.19.

Files with missing lines Patch % Lines
...ain/java/com/cloud/network/NetworkServiceImpl.java 0.00% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.19   #10704   +/-   ##
=========================================
  Coverage     15.16%   15.16%           
- Complexity    11327    11329    +2     
=========================================
  Files          5415     5415           
  Lines        474848   474853    +5     
  Branches      57914    57917    +3     
=========================================
+ Hits          72018    72024    +6     
+ Misses       394781   394779    -2     
- Partials       8049     8050    +1     
Flag Coverage Δ
uitests 4.28% <ø> (ø)
unittests 15.89% <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 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 13043

@DaanHoogland DaanHoogland force-pushed the ghi10664-specifySharedVlan branch from e178089 to 9c78d22 Compare April 14, 2025 09:56
@blueorangutan
Copy link

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

@DaanHoogland
Copy link
Contributor Author

@weizhouapache , #10114 seems to be unable to occur with these checkjs in place:
Screenshot 2025-04-15 at 12 24 19

@DaanHoogland DaanHoogland marked this pull request as ready for review April 15, 2025 10:27
@weizhouapache
Copy link
Member

weizhouapache commented Apr 15, 2025

@weizhouapache , #10114 seems to be unable to occur with these checkjs in place:
Screenshot 2025-04-15 at 12 24 19

Can you test with a new shared network offering with specifyvlan=false and specifyiprange=false ?

ignore it , it is not supported

Comment on lines +1641 to +1643
if (!ntwkOff.isSpecifyIpRanges()) {
throw new CloudRuntimeException("The 'specifyipranges' parameter should be true for Shared Networks");
}
Copy link
Member

Choose a reason for hiding this comment

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

there is already a check when create the network offering

if (specifyIpRanges) {
if (type == GuestType.Isolated) {
if (serviceProviderMap.containsKey(Service.SourceNat)) {
throw new InvalidParameterValueException("SpecifyIpRanges can only be true for Shared network offerings and Isolated with no SourceNat service");
}
}
} else {
if (type == GuestType.Shared) {
throw new InvalidParameterValueException("SpecifyIpRanges should always be true for Shared network offerings");
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, leaving it in in case someone hacks the DB.

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

#10114 (vlan is not allocated) is caused by missing startip and endip
#10664 is a consequence of #10114

if startip and endip are both passed, #10114 and #10664 will not raise

@blueorangutan
Copy link

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

Test Result Time (s) Test File
test_02_list_cpvm_vm Failure 0.07 test_ssvm.py
test_04_cpvm_internals Failure 0.06 test_ssvm.py

@weizhouapache weizhouapache changed the title remove condition for associated network when !specifyvlan in shared network server: check startip and endip of shared network Apr 16, 2025
@vladimirpetrov vladimirpetrov self-assigned this Apr 16, 2025
Copy link
Contributor

@vladimirpetrov vladimirpetrov left a comment

Choose a reason for hiding this comment

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

LGTM based on manual testing.

@weizhouapache weizhouapache merged commit 53d3d19 into apache:4.19 Apr 16, 2025
25 of 26 checks passed
@DaanHoogland DaanHoogland deleted the ghi10664-specifySharedVlan branch April 17, 2025 06:56
Comment on lines +1647 to +1649
if (ipv6 && Objects.isNull(startIPv6)) {
throw new CloudRuntimeException("IPv6 address range needs to be provided");
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wido , we merged this and then came to the conclusion this may interfere with SLAAC setups. Can you comment?

Copy link
Contributor

Choose a reason for hiding this comment

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

In shared networks you will never use a start and endip as SLAAC does the work. So these variables will never be used.

The subnet needs to be provided, a /64 and that's it. People can fill in dummy information here, it will not do anything and not break anything

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, so in spite of this workaround (no high priority) we don’ t even need the UI elements for ipv6 , you are saying @wido ? (cc @weizhouapache )

Copy link
Member

Choose a reason for hiding this comment

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

yes, I think we do not need the start ipv6 and end ipv6 for shared networks on UI
the UI change is low priority,
the check on startipv6 in java should be removed soon

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see #10746

@weizhouapache weizhouapache changed the title server: check startip and endip of shared network server: check startip and startipv6 of shared network Apr 17, 2025
@Pearl1594 Pearl1594 added this to the 4.19.3 milestone May 1, 2025
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.

Creating Shared Network is failing when using specifyVlan is false
6 participants