Bug 1020204 - netcf set BONDING_OPTS error, passing more single quote marks
netcf set BONDING_OPTS error, passing more single quote marks
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: netcf (Show other bugs)
7.0
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Laine Stump
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-17 05:32 EDT by Jincheng Miao
Modified: 2014-06-18 04:35 EDT (History)
6 users (show)

See Also:
Fixed In Version: netcf-0.2.3-6.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 08:19:21 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jincheng Miao 2013-10-17 05:32:23 EDT
Description of problem:
While define a nic bonding, libvirt will passing two more single quote marks to BONDING_OPTS in /etc/sysconfig/network-scripts/ifcfg-bond0.
It will cause ifup cann't set mode and primary in /sys/class/net/bond0/bonding/, in other word, bonding mode will not be set correctly.

Version-Release number of selected component (if applicable):
libvirt-1.1.1-9.el7.x86_64
qemu-kvm-rhev-1.5.3-7.el7.x86_64
netcf-0.2.3-4.el7.x86_64

How reproducible:
100%

Steps to Reproduce:

1. prepare a bond xml
# cat bond0.xml
<interface type='bond' name='bond0'>
   <start mode='onboot'/>
   <protocol family='ipv4'>
    <dhcp/>
   </protocol>
  <bond mode='active-backup'>
    <interface type='ethernet' name='em1'>
     </interface>
    <interface type='ethernet' name='em2'>
    </interface>
   </bond>
</interface>

2. define this nic bond
# virsh iface-define bond0.xml
Interface bond0 defined from bond0.xml

3. check BONDING_OPTS 
# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=dhcp
BONDING_OPTS="'mode=active-backup primary=em1'" <=== look here

4. start bond
# virsh iface-start bond0
error: Failed to start interface bond0
error: internal error: failed to create (start) interface bond0: failed to execute external program - Running 'ifup bond0' failed with exit code 1: ./network-functions: line 460: /sys/class/net/bond0/bonding/'mode: No such file or directory
./network-functions: line 460: echo: write error: Invalid argument
./network-functions: line 460: /sys/class/net/bond0/bonding/'mode: No such file or directory
./network-functions: line 460: echo: write error: Invalid argument
./network-functions: line 460: /sys/class/net/bond0/bonding/'mode: No such file or directory
./network-functions: line 460: echo: write error: Invalid argument
./network-functions: line 460: /sys/class/net/bond0/bonding/'mode: No such file or directory
./network-functions: line 460: echo: write error: Invalid argument

Actual results:
ifup fails 

Expected results:
ifup successes
Comment 1 Laine Stump 2013-10-18 04:35:17 EDT
This bug had been reported against netcf for F19 and fixed upstream. Here is the upstream fix, which needs to be backported to the RHEL7 build of netcf:

commit 581ff3f252552cf5edc8e47c4a72667a39e133ba
Author: Satoru SATOH <ssato@redhat.com>
Date:   Wed Jul 3 13:17:27 2013 -0400

    remove extraneous quotes from BONDING_OPTS
    
    This fixes: https://bugzilla.redhat.com/show_bug.cgi?id=798851
Comment 5 Jincheng Miao 2014-01-24 03:22:32 EST
# rpm -q netcf
netcf-0.2.3-6.el7.x86_64

# cat bond0.xml 
<interface type='bond' name='bond0'>
   <start mode='onboot'/>
   <protocol family='ipv4'>
    <dhcp/>
   </protocol>
  <bond mode='active-backup'>
    <interface type='ethernet' name='em4_1'>
     </interface>
    <interface type='ethernet' name='em4_2'>
    </interface>
   </bond>
</interface>

# ncftool define bond0.xml
Defined interface bond0

# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=dhcp
BONDING_OPTS="mode=active-backup primary=em4_1"

The single quote marks are gone, the bug is fixed, so I change the status to VERIFEID
Comment 6 Ludek Smid 2014-06-13 08:19:21 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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