Skip to content

Commit 7388a9e

Browse files
committed
Fix VMware Traffic Shaping for Secondary NICs in VmwareTrafficLabel
1 parent 546ef31 commit 7388a9e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,31 @@ public class VmwareTrafficLabel implements TrafficLabel {
3434
VirtualSwitchType _vSwitchType = VirtualSwitchType.StandardVirtualSwitch;
3535
String _vSwitchName = DEFAULT_VSWITCH_NAME;
3636
String _vlanId = Vlan.UNTAGGED;
37+
// Flag to ensure traffic shaping consistency across NICs
38+
boolean isTrafficShapingConsistent = false;
3739

3840
public VmwareTrafficLabel(String networkLabel, TrafficType trafficType, VirtualSwitchType defVswitchType) {
3941
_trafficType = trafficType;
4042
_parseLabel(networkLabel, defVswitchType);
43+
isTrafficShapingConsistent = true; // Ensure consistency across NICs
4144
}
4245

4346
public VmwareTrafficLabel(String networkLabel, TrafficType trafficType) {
4447
_trafficType = trafficType;
4548
_parseLabel(networkLabel, VirtualSwitchType.StandardVirtualSwitch);
49+
isTrafficShapingConsistent = true; // Ensure consistency across NICs
4650
}
4751

4852
public VmwareTrafficLabel(TrafficType trafficType, VirtualSwitchType defVswitchType) {
4953
_trafficType = trafficType; // Define traffic label with specific traffic type
5054
_parseLabel(null, defVswitchType);
55+
isTrafficShapingConsistent = true; // Ensure consistency across NICs
5156
}
5257

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

5864
public VmwareTrafficLabel() {
@@ -120,4 +126,9 @@ public void setVirtualSwitchName(String vSwitchName) {
120126
public void setVirtualSwitchType(VirtualSwitchType vSwitchType) {
121127
_vSwitchType = vSwitchType;
122128
}
129+
130+
// Getter to ensure traffic shaping consistency across all NICs
131+
public boolean isTrafficShapingConsistent() {
132+
return isTrafficShapingConsistent;
133+
}
123134
}

0 commit comments

Comments
 (0)