Skip to content

server: check startip and startipv6 of shared network - #10704

Merged
weizhouapache merged 1 commit into
apache:4.19from
shapeblue:ghi10664-specifySharedVlan
Apr 16, 2025
Merged

server: check startip and startipv6 of shared network#10704
weizhouapache merged 1 commit into
apache:4.19from
shapeblue:ghi10664-specifySharedVlan

Conversation

@DaanHoogland

@DaanHooglandDaanHoogland commented Apr 14, 2025

Copy link
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@codecov

codecovBot commented Apr 14, 2025

Copy link
Copy Markdown

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 linesPatch %Lines
...ain/java/com/cloud/network/NetworkServiceImpl.java0.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 
FlagCoverage Δ
uitests4.28% <ø> (ø)
unittests15.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
Copy Markdown

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

@DaanHoogland
DaanHooglandforce-pushed the ghi10664-specifySharedVlan branch from e178089 to 9c78d22CompareApril 14, 2025 09:56
@blueorangutan

Copy link
Copy Markdown

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

@DaanHoogland

Copy link
Copy Markdown
ContributorAuthor

@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

weizhouapache commented Apr 15, 2025

Copy link
Copy Markdown
Member

@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
Copy Markdown
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)) {
thrownewInvalidParameterValueException("SpecifyIpRanges can only be true for Shared network offerings and Isolated with no SourceNat service");
}
}
} else {
if (type == GuestType.Shared) {
thrownewInvalidParameterValueException("SpecifyIpRanges should always be true for Shared network offerings");
}
}

Copy link
Copy Markdown
ContributorAuthor

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.

@weizhouapacheweizhouapache left a comment

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.

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
Copy Markdown

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

TestResultTime (s)Test File
test_02_list_cpvm_vmFailure0.07test_ssvm.py
test_04_cpvm_internalsFailure0.06test_ssvm.py

@weizhouapacheweizhouapache changed the title remove condition for associated network when !specifyvlan in shared networkserver: check startip and endip of shared networkApr 16, 2025
@vladimirpetrovvladimirpetrov self-assigned this Apr 16, 2025

@vladimirpetrovvladimirpetrov left a comment

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.

LGTM based on manual testing.

Comment on lines +1647 to +1649
if (ipv6 && Objects.isNull(startIPv6)) {
throw new CloudRuntimeException("IPv6 address range needs to be provided");
}

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
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
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

see #10746

@weizhouapacheweizhouapache changed the title server: check startip and endip of shared networkserver: check startip and startipv6 of shared networkApr 17, 2025
@Pearl1594Pearl1594 added this to the 4.19.3 milestone May 1, 2025
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jun 19, 2025
Sign up for freeto 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

@DaanHoogland@blueorangutan@weizhouapache@wido@vladimirpetrov@Pearl1594