Skip to content

Unable to create network with long broadcastUri in vSwitch #9507

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

Open
borisstoyanov opened this issue Aug 9, 2024 · 5 comments · May be fixed by #10708
Open

Unable to create network with long broadcastUri in vSwitch #9507

borisstoyanov opened this issue Aug 9, 2024 · 5 comments · May be fixed by #10708

Comments

@borisstoyanov
Copy link
Contributor

ISSUE TYPE
  • Bug Report
COMPONENT NAME
VMware integration
CLOUDSTACK VERSION
4.19 and before 
SUMMARY

When the broadcastUri is too long, it is being refused at vCenter for violating max length of 80 chars.
A specified parameter was not correct: spec.name The name value : cloud.guest.3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020.3000.1-dvS-ext in spec.name is too long. Maximum length cannot exceed 80 characters.
It's possible to workaround this on dvSwitch with the following syntax vlan://3001-3020, but not on normal vSwitch.

STEPS TO REPRODUCE
Create a shared network with long broadcastUri
Deploy a VM in the network 
EXPECTED RESULTS
Network implemented at vCenter
ACTUAL RESULTS
Error for max length exceeded. 
@JoaoJandre
Copy link
Contributor

@borisstoyanov did you mean 4.19 and after?

@sureshanaparti
Copy link
Contributor

sureshanaparti commented Aug 23, 2024

It seems, for vSwitch and dvSwitch port groups in VMware, only VLAN ID between 0 and 4095 is accepted, not the range or multiple comma-separated VLANs. For dvSwitch port groups, VLAN range is accepted through VLAN trunking.

VLANs range check in vSwitch port group:
VMware-vSwitch-VLANs-range

VLANs comma-separated check in vSwitch port group:
VMware-vSwitch-VLANs-comma-separated

VLANs range check in dvSwitch port group:

VMware-dvSwitch-VLANs-range

@sureshanaparti
Copy link
Contributor

VLANs range check using trunking in dvSwitch port group:

VMware-dvSwitch-VLAN-trunking-range VMware-dvSwitch-VLAN-trunking-comma-separated-2

VLANs comma-separated check using trunking in dvSwitch port group:

VMware-dvSwitch-VLAN-trunking-comma-separated

@sureshanaparti
Copy link
Contributor

sureshanaparti commented Aug 23, 2024

CloudStack supports dvSwitch with VLAN trunking, it is recommended to specify the vlan range wherever possible along with the vlan:// scheme prefix.

public static VmwareDistributedVirtualSwitchVlanSpec createDVPortVlanSpec(Integer vlanId, String vlanRange) {
if (vlanId != null && vlanId == 4095){
vlanId = null;
vlanRange = "0-4094";
}
if (vlanId == null && vlanRange != null && !vlanRange.isEmpty()) {
LOGGER.debug("Creating dvSwitch port vlan-trunk spec with range: " + vlanRange);
VmwareDistributedVirtualSwitchTrunkVlanSpec trunkVlanSpec = new VmwareDistributedVirtualSwitchTrunkVlanSpec();

In case, multiple individual/seperate VLANs, there are chances that the port group name exceeds 80 chars limit as the vlans are part of port group name, this may be improved using a custom attribute (say, cloud.vlan) for the port group, and use network uuid for naming.

@DaanHoogland
Copy link
Contributor

@sureshanaparti , can you specify the work to be done for this, please? (documentation? improvement?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment