RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1398143 - netcf: ncftool dumpxml vlan1292 leads libvirt throw error
Summary: netcf: ncftool dumpxml vlan1292 leads libvirt throw error
Keywords:
Status: CLOSED DUPLICATE of bug 1286890
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: netcf
Version: 7.2
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Laine Stump
QA Contact: Jingjing Shao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-24 08:12 UTC by Leno Hou
Modified: 2017-03-28 15:12 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-28 15:12:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
This is patch for this bug (3.09 KB, patch)
2016-11-28 03:25 UTC, Leno Hou
no flags Details | Diff

Description Leno Hou 2016-11-24 08:12:09 UTC
Description of problem:


Version-Release number of selected component (if applicable):
netcf-0.2.8-1.el7_2


How reproducible:


Steps to Reproduce:

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) setup active and dumpxml
# ifup ifcfg-vlan1292 
# 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>

3) setup active and dumpxml
# ifdown ifcfg-vlan1292
# 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
#

Actual results:

[root@s38lp53 SOURCES]# ncftool dumpxml vlan1292
<?xml version="1.0"?>
<interface type="vlan" name="vlan1292">
  <start mode="onboot"/>
  <protocol family="ipv4">
    <ip address="10.254.5.254" prefix="24"/>
  </protocol>
  <vlan tag="">
    <interface name=""/>
  </vlan>
</interface>

Expected results:
[root@s38lp53 SOURCES]# ncftool dumpxml vlan1292
<?xml version="1.0"?>
<interface type="vlan" name="vlan1292">
  <start mode="onboot"/>
  <protocol family="ipv4">
    <ip address="10.254.5.254" prefix="24"/>
  </protocol>
  <vlan tag="1292">
    <interface name="en5sp0"/>
  </vlan>
</interface>

Additional info:

Comment 1 Leno Hou 2016-11-24 10:45:58 UTC
If we don't support this functionality, I think we should change the User Guide as shown below directly

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Naming_Scheme_for_VLAN_Interfaces.html

If we want to support this functionality, just modify the code in netcf/data/xml/redhat-put.xsl between line 57-64 as shown below:

  <xsl:template name="vlan-device">
    <xsl:variable name="name" select="node[@label = 'DEVICE']/@value"/>
    <xsl:variable name="device" select="substring-before($name, '.')"/>
    <xsl:variable name="tag" select="substring-after($name, '.')"/>
    <vlan tag="{$tag}">
      <interface name="{$device}"/>
    </vlan>
  </xsl:template>

Comment 3 Leno Hou 2016-11-28 03:25:39 UTC
Created attachment 1225096 [details]
This is patch for this bug

Hi all,

Could anyone help me to review this patch? Thanks.

Comment 4 Leno Hou 2016-12-13 09:21:32 UTC
Hi Laine,

I've pushed the patch that fixed this issue including testcase in the netcf mail list. Could you help to me merge it into upstream? Thanks

commit d59c5aa7e6d40a7b4ec6116b30784e06b53ef231
Author: Leno Hou <lenohou>
Date:   Sat Nov 26 01:24:07 2016 +0800

    vlan: fix vlan interface misses tag attribute when inactive
    
    This patch fixes the problem as shown below.
    * virsh dumpxml failed with vlan1292 in inactive status
    * virt-manager failed to view vlan1292 interface details.
    RedHat Bugzilla:#1398143

Comment 5 Laine Stump 2016-12-13 16:31:42 UTC
yes, it's been at the top of my list all week, but other things keep distracting me.

Comment 6 Laine Stump 2016-12-15 19:48:12 UTC
Leno's patch has been pushed upstream:

commit 0f6596c3e2f914fd36a771421151f409924f65e2
Author: Leno Hou <lenohou>
Date:   Thu Dec 8 21:04:15 2016 +0800

    redhat: support vlan devices named as "vlan${TAG}"
    


Sometime between now and RHEL7.4 I will either backport that patch to the current RHEL7 netcf package, or I will rebase netcf for RHEL7.

Comment 7 Leno Hou 2016-12-16 03:05:04 UTC
Thanks Laine! ;-)

Comment 8 Laine Stump 2017-03-28 15:12:12 UTC
I hadn't noticed that this is the same as Bug 1286890, and that one has already been moved to MODIFIED.

*** This bug has been marked as a duplicate of bug 1286890 ***


Note You need to log in before you can comment on or make changes to this bug.