kimchi-project / kimchi

An HTML5 management interface for KVM guests
https://github.com/kimchi-project/kimchi/releases/latest
Other
3.09k stars 365 forks source link

VLAN ID accepting only one digit #694

Closed atreyeemukhopadhyay closed 7 years ago

atreyeemukhopadhyay commented 9 years ago

I tried creating Bridged network enabling VLAN. I am running kimchi https://9.152.151.63:8001/#tabs/host "mozilla firefox ESR 31.8.0 ESR".

Steps to reproduce 1)Install and launch the kimchi. Login with admin user. 2)Navigate to 'Network' tab. 3)click '+' icon to add a network. 4)Select network type as 'Bridged', destination from the drop-down option and check 'Enable VLAN'. 5)In VLAN ID field provide a value having more than one digit.

VLAN ID should accept value between 1 to 4094. It's accepting only single digit.

net1 net2

ramonmedeiros commented 9 years ago

I just reproduced this issue using only one digit in my laptop, with NetworkManager enabled. Please, disabled NetworkManager and try again.

I tried this on RHEL 7.1, disabling NetworkManager and i successful created vlans with 1, 12, 123 and 1234.

ramonmedeiros commented 9 years ago

Hi, any updates on this?

potula-chandra commented 9 years ago

Hi, I guess this is happens only on the s390 (Systemz) architecture since the interface name is too big. Please do not take any action on this issue since issue is not reproducible on x86/PPC.

However we can keep this issue as it is and will be taken care in some time (supporting s390) if it make sense.

ramonmedeiros commented 9 years ago

Can you try create a vlan by hand?

potula-chandra commented 9 years ago

I am sure it works if the interface name is short.

walterniklaus commented 9 years ago

From what I can see, the issue comes due to the fact that the initial interface name is already too long. With RHEL7 due to the introduction of the concept of "Consistent Network Device Naming" https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/ch-Consistent_Network_Device_Naming.html

the Interface Names are already getting to a string length of 13 Characters. Here the link to the section describing the System z name-scheme:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Naming_Scheme_for_Network_Devices_Available_for_Linux_on_System_z.html

The overall limit for the name of a VLAN Device is 15 Characters: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Naming_Scheme_for_VLAN_Interfaces.html.

With this restriction we will not be able to simply add the VLAN-ID at the end of the full interface name.

One possibility I could see for now is to eliminate some of the characters from the original interface name, characters which are not relevant for the device identification: Interface Name VLAN-Id = abcd enccw0.0.1234 encw001234.abcd

ramonmedeiros commented 9 years ago

I'm not understanding why this is happening, since the code truncate the interface name to avoid making it too big:

src/kimchi/model/networks.py:210 def _create_vlan_tagged_bridge(self, interface, vlan_id):

Truncate the interface name if it exceeds 8 characters to make sure

    # the length of bridge name is less than 15 (its maximum value).
    br_name = KIMCHI_BRIDGE_PREFIX + interface[-8:] + '-' + vlan_id

Can you please give me access to this machine? My email is ramonn at linux vnet ibm com

alinefm commented 7 years ago

I am unable to reproduce that with the current upstream code. I am closing this issue by now. Please, reopen if the problem persists to you.