Novell Home

NIC Bonding with Xen Virtualization

Novell Cool Solutions: Feature
By Jim Short, Joe Harmon

Digg This - Slashdot This

Posted: 21 Nov 2007
 

Applies To:

  • SUSE Linux Enterprise Server 10 SP1
  • openSUSE 10.3

Written and Compiled by:

  • Joe Harmon
  • Jim Short

The easiest way we found to test this setup is to split this up into two sections. First we will be setting up the host machine (Dom0). The second section will go over changing the Xen configuration in order to allow the guest machine (DomU) to use the same NIC bonding that we configured for Dom0.

Note: Since this document goes over setting up NIC bonding with Xen virtualization then it is assumed that you have already booted into Xen kernel. If not, please do so at this time. It is also important to note that no guest VMs should be running when you make the changes to the network in Dom0.

Some updates came out after SLES 10 SP1 through the update channel so be sure that you are fully updated from the update channel. Otherwise ARP problems will occur during failover.

Dom0 (Host) Setup

  1. We start by making modifications to the host machines network setup. These modifications cannot be performed in Yast until the Xen network has been stopped. This is done by executing the following commands in a terminal:
    su
    /etc/xen/scripts/network-bridge stop
  2. Once the Xen network has been stopped, go into Yast, Network Devices, Network Card and make sure it is set for traditional method.
  3. You should see your two interfaces that you are going to bond together. It is recommended that the two NIC cards are of the same type and version.
  4. Click Edit on the first interface and on the Address tab select None Address Setup.
  5. Now select the General tab and change the Device Activation to Never. Then click Next to finish the setup.

  6. Repeat steps 4 and 5 for the second interface and then save those setting by clicking Finish.

    **NOTE** If you don't click finish, you interfaces will not show up under the bond interface configuration.

  7. Go back into Yast, Network Devices, Network Card and again leave the setting at traditional method.
  8. Add a new interface and change the Device Type to bond.

  9. You should then see both interfaces under the Bond Slaves section. If you don't see both interfaces then you need to go back and follow steps one through six again.

    Configure your address setup (static or dhcp) and make sure that you select both interfaces under the Bond Slaves section. Select appropriate Bond Driver Option. In this example we will be using active-backup. Then add to the same line the following parameters: miimon=100 use_carrier=1

    If these parameters are not set properly, the fail over will not occur on one of the devices. There are different parameters that you might need to use depending on the type of router you have, but these are the options that work in most cases.

    Be sure to also configure the Host and Name Server and Routing sections appropriately.

  10. You should then see the configuration in the summary screen.

  11. Now you can test it out by opening a terminal and starting a ping. Then unplug each interface and make sure the ping continues.

Xen Setup for Guest Usage

The default script that comes with SLES 10 SP1 will not work with bonding. We will be downloading some new scripts for bonding. If you are using openSUSE 10.3 then you don't need to download the script since it is already included with the OS. However openSUSE 10.3 doesn't use this configuration file by default, therefore the rest of the document will need to be followed. It is important to note that these scripts are not officially supported by Novell at this time, although an attempt at getting them included in the official code is being made.

  1. Go to http://thepenguinpriest.com/linux/scripts/network-multinet.html and download the network-multinet and the xend files.

  2. Open a terminal and su to root.
    su
  3. Copy the the network-multinet script to the /etc/xen/scripts directory.
    cp network-multinet /etc/xen/scripts
  4. Make sure that the script has execute rights
    chmod 755 /etc/xen/scripts/network-multinet
  5. Copy the xend script to the /etc/sysconfig directory
    cp xend /etc/sysconfig/
  6. Edit the /etc/xen/xend-config.sxp
    gedit /etc/xen/xend-config.sxp
  7. Go into Edit, Preferences within gedit and enable the display line numbers and highlight current line options.
  8. Change line 128 from (networt-script network-bridge) to (network-script network-multinet) and save the file. You could also copy it so that you have the old setting as shown below. However be sure you comment out the old line.

  9. Make sure the firewall is turned off on DomO (host machine). This can be done by going into Yast, Security and Users, Firewall, and choose Stop Firewall Now and set the Service Start section to Manually start.

  10. Modify the /etc/sysconfig/xend file. Change the BRIDGE_NETDEV_LIST=?eth0? to BRIDGE_NETDEV_LIST=?bond0?
    gedit /etc/sysconfig/xend
  11. Start the new network script:
    /etc/xen/scripts/network-multinet start
  12. The Guest VMs (DomUs) will now communicate through the bonded interface in Dom0.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell