[Ovirt-devel] [PATCH node] Updated the configuration processing to remove the need for scripts.

Daniel P. Berrange berrange at redhat.com
Wed Oct 8 20:13:03 UTC 2008


On Wed, Oct 08, 2008 at 04:05:39PM -0400, Darryl Pierce wrote:
> Daniel P. Berrange wrote:
> >> +    # now build the list of module aliases to load and load them
> >> +    modules=$(awk '/bonding=/ {
> >> +            match($0, "bonding=(.*)", data)
> >> +            split(data[1], mod, "|")
> >> +
> >> +            printf("%s ", mod[1])
> >> +        }' $CONFIG)
> >> +
> >> +    /sbin/modprobe $modules
> > 
> > This is all rather the wrong way to go about setting up bonding, 
> > reinventing stuff that's basically done automatically if you
> > configure things correctly. For module configuration the only
> > thing that should be neccessary is to add
> > 
> >   alias bond0 bonding
> > 
> > To '/etc/modprobe.conf' to define a network device bond0. Repeat
> > for bond1, bond2, etc as you need.
> >
> > This causes the neccessary module to be loaded. Everything else
> > should then be done in the ifcfg-XXX scripts.
> 
> 
> 
> In working on this, doing the above failed every time. The error is:
> 
> FATAL: Error inserting bonding
> (/lib/modules/2.6.26.5-45.fc9.i686/kernel/drivers/net/bonding/bonding.ko):
> Unknown symbol in module, or unknown parameter (see dmesg)

What is giving you that error message ? 

It 'just works' when I try it.

  # echo "alias bond2 bonding" >> /etc/modprobe.conf
  # depmod -a
  # cat > ifcfg-bond2
  DEVICE=bond2
  IPADDR=192.168.122.78
  BOOTPROTO=static
  NETMASK=255.255.255.0
  GATEWAY=192.168.122.1
  ONBOOT=yes
  # ifup bond2
  arping: recvfrom: Network is down
  # ifconfig bond2
  bond2     Link encap:Ethernet  HWaddr 00:00:00:00:00:00  
            inet addr:192.168.122.78  Bcast:192.168.122.255  Mask:255.255.255.0
            UP BROADCAST MASTER MULTICAST  MTU:1500  Metric:1
            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:0 
            RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)


NB, you don't need to insmod the bonding module multiple times - we're
just defining aliases for it - its only ever loaded one time

  # lsmod  | grep bond
  bonding                81197  0 


The network init scripts look in modprobe.conf for any lines defining
an alias to bonding module, load it if not already loaded, and then
use /sys/class/net/bonding_masters to add the actual devices. See
the network-functions  script and the install_bonding_driver() function

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the ovirt-devel mailing list