Bug 1286890
Summary: | interface name can't be changed when define a vlan type interface | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Shanzhi Yu <shyu> |
Component: | netcf | Assignee: | Laine Stump <laine> |
Status: | CLOSED ERRATA | QA Contact: | Jingjing Shao <jishao> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.3 | CC: | dyuan, jishao, laine, lenohou, mzhan, rbalakri, xuzhang, yalzhang |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | netcf-0.2.8-3.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-08-01 21:46:42 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Shanzhi Yu
2015-12-01 03:04:08 UTC
This is a limitation of netcf, and isn't easy to change due to both netcf's assumption that the name of the ifcfg file will always be based on the device name, and that netcf doesn't support the ifcfg file parameter for naming a vlan device differently from "$physdev.$vlantag". How about add support the ifcfg file parameter for naming a vlan device differently from "$physdev.$vlantag" ? We have a case of: error: XML error: vlan interface misses the tag attribute by below steps. 1) Define the vlan interface with ifcfg-vlan1292 VLAN=yes VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD DEVICE=vlan1292 PHYSDEV=en5sp0 ONBOOT=yes BOOTPROTO=static IPADDR=10.254.5.254 NETMASK=255.255.255.0 TYPE=Ethernet NM_CONTROLLED=no 2)ifup and ifdown this vlan1292 #ifup ifcfg-vlan1292 #ifdown ifcfg-vlan1292 3)# virsh iface-list --all Name State MAC Address --------------------------------------------------- en5sp0 active 02:38:53:00:76:00 lo active 00:00:00:00:00:00 vlan1292 inactive # virsh iface-dumpxml vlan1292 error: XML error: vlan interface misses the tag attribute 4) setup active and dumpxml # ifup ifcfg-vlan1292 [root@s38lp53 network-scripts]# virsh iface-list --all Name State MAC Address --------------------------------------------------- en5sp0 active 02:38:53:00:76:00 lo active 00:00:00:00:00:00 vlan1292 active 02:38:53:00:76:00 # virsh iface-dumpxml vlan1292 <interface type='vlan' name='vlan1292'> <protocol family='ipv4'> <ip address='10.254.5.254' prefix='24'/> </protocol> <protocol family='ipv6'> <ip address='fe80::38:53ff:fe00:7600' prefix='64'/> </protocol> <link speed='1000' state='up'/> <vlan tag='1292'> <interface name='en5sp0'/> </vlan> </interface> Leno kindly made a patch for this which was pushed upstream last December, so we may as well get it into the next release of RHEL. commit 0f6596c3e2f914fd36a771421151f409924f65e2 Author: Leno Hou <lenohou> Date: Thu Dec 8 21:04:15 2016 +0800 redhat: support vlan devices named as "vlan${TAG}" Resolved in this RHEL7.4-candidate build: https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=546862 *** Bug 1398143 has been marked as a duplicate of this bug. *** Hi Laine, According to the user guide, https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Naming_Scheme_for_VLAN_Interfaces.html I did seven test scenarios and got the issues as below (1) In the scenario 4 and 5, I got the info "Interface eno1.0001 defined from eno1.0001.xml" and "Interface eth0.1 defined from eth0.1.xml" but the interface turn to eno1.1 (2) In the scenario 6, I got the error info "vlan interface misses the tag attribute", if so, we should forbid to define this interface (3) In the scenario 7, if I edit the name of the interface, it will create another interface instead. Is it expected ? # virsh iface-list --all Name State MAC Address --------------------------------------------------- eno1 active 44:37:e6:95:03:e4 lo active 00:00:00:00:00:00 (1) # cat vlan1.xml <interface type='vlan' name='vlan1'> <start mode='onboot'/> <protocol family='ipv4'> <ip address='192.168.177.1' prefix='24'/> </protocol> <vlan tag='1'> <interface name='eno1'/> </vlan> </interface> # virsh iface-define vlan1.xml Interface vlan1 defined from vlan1.xml # virsh iface-list --all Name State MAC Address --------------------------------------------------- eno1 active 44:37:e6:95:03:e4 lo active 00:00:00:00:00:00 vlan1 inactive # virsh iface-dumpxml vlan1 <interface type='vlan' name='vlan1'> <start mode='onboot'/> <protocol family='ipv4'> <ip address='192.168.177.1' prefix='24'/> </protocol> <vlan tag='1'> <interface name='eno1'/> </vlan> </interface> # virsh iface-start vlan1 Interface vlan1 started # virsh iface-dumpxml vlan1 <interface type='vlan' name='vlan1'> <protocol family='ipv4'> <ip address='192.168.177.1' prefix='24'/> </protocol> <protocol family='ipv6'> <ip address='fe80::4637:e6ff:fe95:3e4' prefix='64'/> </protocol> <link speed='100' state='up'/> <vlan tag='1'> <interface name='eno1'/> </vlan> </interface> # virsh iface-destroy vlan1 Interface vlan1 destroyed # virsh iface-undefine vlan1 Interface vlan1 undefined (2)# cat vlan0001.xml <interface type='vlan' name='vlan0001'> <start mode='onboot'/> <protocol family='ipv4'> <ip address='192.168.177.2' prefix='24'/> </protocol> <vlan tag='1'> <interface name='eno1'/> </vlan> </interface> # virsh iface-define vlan0001.xml Interface vlan0001 defined from vlan0001.xml # virsh iface-list --all Name State MAC Address --------------------------------------------------- eno1 active 44:37:e6:95:03:e4 lo active 00:00:00:00:00:00 vlan0001 inactive # virsh iface-dumpxml vlan0001 <interface type='vlan' name='vlan0001'> <start mode='onboot'/> <protocol family='ipv4'> <ip address='192.168.177.2' prefix='24'/> </protocol> <vlan tag='0001'> <interface name='eno1'/> </vlan> </interface> # virsh iface-start vlan0001 Interface vlan0001 started # virsh iface-dumpxml vlan0001 <interface type='vlan' name='vlan0001'> <protocol family='ipv4'> <ip address='192.168.177.2' prefix='24'/> </protocol> <protocol family='ipv6'> <ip address='fe80::4637:e6ff:fe95:3e4' prefix='64'/> </protocol> <link speed='100' state='up'/> <vlan tag='1'> <interface name='eno1'/> </vlan> </interface> (3)# cat eno1.1.xml <interface type='vlan' name='eno1.1'> <start mode='onboot'/> <protocol family='ipv4'> <ip address='192.168.177.4' prefix='24'/> </protocol> <vlan tag='1'> <interface name='eno1'/> </vlan> </interface> # virsh iface-list --all Name State MAC Address --------------------------------------------------- eno1 active 44:37:e6:95:03:e4 eno1.1 inactive lo active 00:00:00:00:00:00 # virsh iface-dumpxml eno1.1 <interface type='vlan' name='eno1.1'> <start mode='onboot'/> <protocol family='ipv4'> <ip address='192.168.177.4' prefix='24'/> </protocol> <vlan tag='1'> <interface name='eno1'/> </vlan> </interface> # virsh iface-start eno1.1 Interface eno1.1 started # virsh iface-list --all Name State MAC Address --------------------------------------------------- eno1 active 44:37:e6:95:03:e4 eno1.1 active 44:37:e6:95:03:e4 lo active 00:00:00:00:00:00 (4)# cat eno1.0001.xml <interface type='vlan' name='eno1.0001'> <start mode='onboot'/> <protocol family='ipv4'> <ip address='192.168.177.3' prefix='24'/> </protocol> <vlan tag='1'> <interface name='eno1'/> </vlan> </interface> # virsh iface-define eno1.0001.xml Interface eno1.0001 defined from eno1.0001.xml # virsh iface-list --all Name State MAC Address --------------------------------------------------- eno1 active 44:37:e6:95:03:e4 eno1.1 inactive lo active 00:00:00:00:00:00 # virsh iface-dumpxml eno1.1 <interface type='vlan' name='eno1.1'> <start mode='onboot'/> <protocol family='ipv4'> <ip address='192.168.177.3' prefix='24'/> </protocol> <vlan tag='1'> <interface name='eno1'/> </vlan> </interface> (5)# cat eth0.1.xml <interface type='vlan' name='eth0.1'> <start mode='onboot'/> <protocol family='ipv4'> <ip address='192.168.177.1' prefix='24'/> </protocol> <vlan tag='1'> <interface name='eno1'/> </vlan> </interface> # virsh iface-define eth0.1.xml Interface eth0.1 defined from eth0.1.xml # virsh iface-list --all Name State MAC Address --------------------------------------------------- eno1 active 44:37:e6:95:03:e4 eno1.1 inactive lo active 00:00:00:00:00:00 # virsh iface-dumpxml eno1.1 <interface type='vlan' name='eno1.1'> <start mode='onboot'/> <protocol family='ipv4'> <ip address='192.168.177.1' prefix='24'/> </protocol> <vlan tag='1'> <interface name='eno1'/> </vlan> </interface> (6)# cat vlan.xml <interface type='vlan' name='vlan'> <start mode='onboot'/> <protocol family='ipv4'> <ip address='192.168.177.1' prefix='24'/> </protocol> <vlan tag='1'> <interface name='eno1'/> </vlan> </interface> # virsh iface-define vlan.xml Interface vlan defined from vlan.xml # virsh iface-list --all Name State MAC Address --------------------------------------------------- eno1 active 44:37:e6:95:03:e4 lo active 00:00:00:00:00:00 vlan inactive # virsh iface-dumpxml vlan error: XML error: vlan interface misses the tag attribute (7)# virsh iface-list --all Name State MAC Address --------------------------------------------------- eno1 active 44:37:e6:95:03:e4 lo active 00:00:00:00:00:00 vlan1 inactive # virsh iface-edit vlan1 Interface vlan2 XML configuration edited. <===edit vlan1 to vlan2 # virsh iface-list --all Name State MAC Address --------------------------------------------------- eno1 active 44:37:e6:95:03:e4 lo active 00:00:00:00:00:00 vlan1 inactive vlan2 inactive # virsh iface-dumpxml vlan1 <interface type='vlan' name='vlan1'> <start mode='onboot'/> <protocol family='ipv4'> <ip address='192.168.177.1' prefix='24'/> </protocol> <vlan tag='1'> <interface name='eno1'/> </vlan> </interface> # virsh iface-dumpxml vlan2 <interface type='vlan' name='vlan2'> <start mode='onboot'/> <protocol family='ipv4'> <ip address='192.168.177.1' prefix='24'/> </protocol> <vlan tag='2'> <interface name='eno1'/> </vlan> </interface> # virsh iface-start vlan1 Interface vlan1 started # virsh iface-start vlan2 Interface vlan2 started (In reply to Jingjing Shao from comment #10) > Hi Laine, > > According to the user guide, > https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/ > html/Networking_Guide/sec-Naming_Scheme_for_VLAN_Interfaces.html > > > I did seven test scenarios and got the issues as below > > (1) In the scenario 4 and 5, I got the info "Interface eno1.0001 defined > from eno1.0001.xml" and "Interface eth0.1 defined from eth0.1.xml" > but the interface turn to eno1.1 The vlan tag is stored in the ifcfg file *only* embedded in the interface name, there is no other place for it. Somewhere there is conversion going back and forth, and the leading 0's are truncated. I wouldn't be surprised if there is no way around this, so just define the interfaces without leading 0's on the vlan tag. > > (2) In the scenario 6, I got the error info "vlan interface misses the tag > attribute", if so, we should forbid to define this interface You're correct here. The name must include the tag id (which is kind of silly when you look from the point of view of netcf's config, but not from the POV of the ifcfg files), so we should refuse to define any vlan interface whose name doesn't contain its tag. Please open this as a separate BZ though. > > (3) In the scenario 7, if I edit the name of the interface, it will create > another interface instead. Is it expected ? Yes. Also, I noticed a scenario where you tried to define "eth0.1" that was based on the physical device "en0". That can't work. (In reply to Laine Stump from comment #11) > (In reply to Jingjing Shao from comment #10) > > Hi Laine, > > > > According to the user guide, > > https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/ > > html/Networking_Guide/sec-Naming_Scheme_for_VLAN_Interfaces.html > > > > > > I did seven test scenarios and got the issues as below > > > > (1) In the scenario 4 and 5, I got the info "Interface eno1.0001 defined > > from eno1.0001.xml" and "Interface eth0.1 defined from eth0.1.xml" > > but the interface turn to eno1.1 > > The vlan tag is stored in the ifcfg file *only* embedded in the interface > name, there is no other place for it. Somewhere there is conversion going > back and forth, and the leading 0's are truncated. I wouldn't be surprised > if there is no way around this, so just define the interfaces without > leading 0's on the vlan tag. > > > > > > (2) In the scenario 6, I got the error info "vlan interface misses the tag > > attribute", if so, we should forbid to define this interface > > You're correct here. The name must include the tag id (which is kind of > silly when you look from the point of view of netcf's config, but not from > the POV of the ifcfg files), so we should refuse to define any vlan > interface whose name doesn't contain its tag. Please open this as a separate > BZ though. > > > > (3) In the scenario 7, if I edit the name of the interface, it will create > > another interface instead. Is it expected ? > > Yes. > > > Also, I noticed a scenario where you tried to define "eth0.1" that was based > on the physical device "en0". That can't work. Thanks laine's feedback and add a bug according to the issue. https://bugzilla.redhat.com/show_bug.cgi?id=1447339 According to the other scenarios, verify this bug Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2220 Hi laine, With libvirt-3.8.0-1.el7.x86_64, I found a issue about the name change of vlan interface. The name of vlan interface eno1.1 just can be edited to vlan or test these names ,but can not be changed to eno1.2 or eno1.0005. Is this a bug ? # virsh iface-list --all Name State MAC Address --------------------------------------------------- eno1 active 34:40:b5:b1:09:30 eno1.1 inactive (1) # virsh iface-edit eno1.1 ===》Change the interface name to eno1.2 Interface eno1.2 XML configuration edited. # virsh iface-list --all ===》Can not find the eno1.2 Name State MAC Address --------------------------------------------------- eno1 active 34:40:b5:b1:09:30 eno1.1 inactive (2) # virsh iface-edit eno1.1 ===》Change the interface name to eno1.0005 Interface eno1.0005 XML configuration edited. # virsh iface-list --all ===》Can not find the eno1.0005 Name State MAC Address --------------------------------------------------- eno1 active 34:40:b5:b1:09:30 eno1.1 inactive (3) # virsh iface-edit eno1.1 ===》Change the interface name to vlan1 Interface vlan1 XML configuration edited. # virsh iface-list --all ===》Can find the vlan1 Name State MAC Address --------------------------------------------------- eno1 active 34:40:b5:b1:09:30 eno1.1 inactive vlan1 inactive Since the scripts that process the ifcfg files store/retrieve the vlan tag to/from the interface's name (in the "DEVICE" attribute of the ifcfg file), the tag given to the interface must match the number at the end of the device name. Your description implies that you changed the device name, but not the vlan tag, which would explain the behavior you saw. Note that if you modify the device name *and* the tag, this ends up creating a completely new vlan device, and the original vlan device is still in place. That's due to the way that editing of a device works (a new ifcfg file is just written with a name according to the attributes in the XML with the assumption that the name has remained the same; since the API that gets the new XML and writes the new ifcfg file has no way of knowing what the original XML had been, there is no way for it to automatically remove the original. |