Skip to content

kvm, ui: fix interface when using vlan subnet for storage traffic type #11245

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

Draft
wants to merge 2 commits into
base: 4.19
Choose a base branch
from

Conversation

shwstppr
Copy link
Contributor

@shwstppr shwstppr commented Jul 18, 2025

Description

Fixes #7816

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?

After adding the changes I was able to see new bridge with vlan tag getting created,

# brctl show
bridge name	bridge id		STP enabled	interfaces
breth0-2500		8000.1e0050000c49	no		eth0.2500
							vnet17
breth1-51		8000.020073851163	no		eth1.51
							vnet16
							vnet2
cloud0		8000.fe00a9fe46d2	no		vnet0
							vnet14
cloudbr0		8000.1e0050000c49	yes		eth0
							vnet1
							vnet15
cloudbr1		8000.020073851163	yes		eth1

UI shows VLAN correctly,

image

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

Copy link

codecov bot commented Jul 18, 2025

Codecov Report

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

Project coverage is 15.17%. Comparing base (6e19c07) to head (720ad1b).
Report is 28 commits behind head on 4.19.

Files with missing lines Patch % Lines
...cloud/hypervisor/kvm/resource/BridgeVifDriver.java 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               4.19   #11245    +/-   ##
==========================================
  Coverage     15.17%   15.17%            
- Complexity    11349    11363    +14     
==========================================
  Files          5416     5415     -1     
  Lines        475621   476037   +416     
  Branches      58054    58117    +63     
==========================================
+ Hits          72168    72246    +78     
- Misses       395380   395708   +328     
- Partials       8073     8083    +10     
Flag Coverage Δ
uitests 4.28% <ø> (+<0.01%) ⬆️
unittests 15.90% <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.

@sureshanaparti sureshanaparti added this to the 4.19.4 milestone Jul 23, 2025
@sureshanaparti sureshanaparti linked an issue Jul 25, 2025 that may be closed by this pull request
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 fixes an issue where VLAN subnet configurations for storage traffic type were not properly handled in both the KVM hypervisor and the UI. The fix ensures that VLAN-tagged storage networks are correctly created and displayed.

  • Updates the UI to display the correct VLAN field for storage IP ranges
  • Adds VLAN support for storage traffic type in the KVM bridge VIF driver

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
ui/src/views/infra/network/IpRangesTabStorage.vue Changes dataIndex from 'vlanid' to 'vlan' to fix VLAN display in storage IP ranges table
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java Adds VLAN handling logic for storage traffic type to create proper VLAN bridges

protocol = Networks.BroadcastDomainType.Vlan.scheme();
}
if (isValidProtocolAndVnetId(vNetId, protocol)) {
s_logger.debug("creating a vNet dev and bridge for public traffic per traffic label {}" + trafficLabel);
Copy link
Preview

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

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

The debug message incorrectly refers to 'public traffic' when this code is handling storage traffic. It should say 'storage traffic' instead.

Suggested change
s_logger.debug("creating a vNet dev and bridge for public traffic per traffic label {}" + trafficLabel);
s_logger.debug("creating a vNet dev and bridge for storage traffic per traffic label {}" + trafficLabel);

Copilot uses AI. Check for mistakes.

protocol = Networks.BroadcastDomainType.Vlan.scheme();
}
if (isValidProtocolAndVnetId(vNetId, protocol)) {
s_logger.debug("creating a vNet dev and bridge for public traffic per traffic label {}" + trafficLabel);
Copy link
Preview

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

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

String concatenation is used incorrectly with a placeholder '{}'. Either use String.format() or replace '{}' with '%s' for proper formatting, or use simple concatenation without the placeholder.

Suggested change
s_logger.debug("creating a vNet dev and bridge for public traffic per traffic label {}" + trafficLabel);
s_logger.debug("creating a vNet dev and bridge for public traffic per traffic label {}", trafficLabel);

Copilot uses AI. Check for mistakes.

Signed-off-by: Abhishek Kumar <[email protected]>
Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

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

clgtm

@sureshanaparti
Copy link
Contributor

@shwstppr is this ready for review/test?

Copy link
Contributor

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

@shwstppr
Copy link
Contributor Author

@sureshanaparti this would need testing with the specific setup. I need to check with @rajujith about that. Will update you next week

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.

Storage VLAN configuration on KVM
5 participants