Skip to content

Fix VMware Traffic Shaping for Secondary NICs in VmwareTrafficLabel #10060

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 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,31 @@
VirtualSwitchType _vSwitchType = VirtualSwitchType.StandardVirtualSwitch;
String _vSwitchName = DEFAULT_VSWITCH_NAME;
String _vlanId = Vlan.UNTAGGED;
// Flag to ensure traffic shaping consistency across NICs
boolean isTrafficShapingConsistent = false;

public VmwareTrafficLabel(String networkLabel, TrafficType trafficType, VirtualSwitchType defVswitchType) {
_trafficType = trafficType;
_parseLabel(networkLabel, defVswitchType);
isTrafficShapingConsistent = true; // Ensure consistency across NICs

Check warning on line 43 in plugins/hypervisors/vmware/src/main/java/com/cloud/network/VmwareTrafficLabel.java

View check run for this annotation

Codecov / codecov/patch

plugins/hypervisors/vmware/src/main/java/com/cloud/network/VmwareTrafficLabel.java#L43

Added line #L43 was not covered by tests
}

public VmwareTrafficLabel(String networkLabel, TrafficType trafficType) {
_trafficType = trafficType;
_parseLabel(networkLabel, VirtualSwitchType.StandardVirtualSwitch);
isTrafficShapingConsistent = true; // Ensure consistency across NICs

Check warning on line 49 in plugins/hypervisors/vmware/src/main/java/com/cloud/network/VmwareTrafficLabel.java

View check run for this annotation

Codecov / codecov/patch

plugins/hypervisors/vmware/src/main/java/com/cloud/network/VmwareTrafficLabel.java#L49

Added line #L49 was not covered by tests
}

public VmwareTrafficLabel(TrafficType trafficType, VirtualSwitchType defVswitchType) {
_trafficType = trafficType; // Define traffic label with specific traffic type
_parseLabel(null, defVswitchType);
isTrafficShapingConsistent = true; // Ensure consistency across NICs

Check warning on line 55 in plugins/hypervisors/vmware/src/main/java/com/cloud/network/VmwareTrafficLabel.java

View check run for this annotation

Codecov / codecov/patch

plugins/hypervisors/vmware/src/main/java/com/cloud/network/VmwareTrafficLabel.java#L55

Added line #L55 was not covered by tests
}

public VmwareTrafficLabel(TrafficType trafficType) {
_trafficType = trafficType; // Define traffic label with specific traffic type
_parseLabel(null, VirtualSwitchType.StandardVirtualSwitch);
isTrafficShapingConsistent = true; // Ensure consistency across NICs
}

public VmwareTrafficLabel() {
Expand Down Expand Up @@ -120,4 +126,9 @@
public void setVirtualSwitchType(VirtualSwitchType vSwitchType) {
_vSwitchType = vSwitchType;
}

// Getter to ensure traffic shaping consistency across all NICs
public boolean isTrafficShapingConsistent() {
Copy link
Member

Choose a reason for hiding this comment

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

@iishitahere
this method is not used anywhere. did I miss something ?

return isTrafficShapingConsistent;
}

Check warning on line 133 in plugins/hypervisors/vmware/src/main/java/com/cloud/network/VmwareTrafficLabel.java

View check run for this annotation

Codecov / codecov/patch

plugins/hypervisors/vmware/src/main/java/com/cloud/network/VmwareTrafficLabel.java#L131-L133

Added lines #L131 - L133 were not covered by tests
}