WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] BUG: [?] host-only networking under HVM is broken with custo

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] BUG: [?] host-only networking under HVM is broken with custom script
From: "Ray Barnes" <tical.net@xxxxxxxxx>
Date: Mon, 2 Jun 2008 02:37:29 -0400
Delivery-date: Sun, 01 Jun 2008 23:37:52 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=qgApeoOxN5cmq0YotCZ1Aqd2PnmwsxMCKiO55TJBCV4=; b=Y47raGGkiZIeIQtlgsZ1ODjICEeHxaMWnIpmmI6OZXUF2AJq3GrtbDLIXq64HWyHH8K331QZpCmUj5Tn2i2ARlFrTML6COYD3eZCO7UQQPUC2Rm4oAkIpdsbRF6dVm5BJNaBA8FWq2DJHVfb/zv/Bin9OZq9IzaSjNMnMO5+liE=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=bPBXQVxc4rsvwU1xwiKCkO1Nk9brLOKwfpB8lhBNts5MtTdT9cFvJUtQB6GTjOG0xm+LikiApA7kNEBGxpYNXZ4MWY3bcPPS6UT1wOYJ6tstlhEMVM7cJPim1JnhhAAWuCwRGkfA18VJo6XYTw7ukQ63JcIKwrV2Dr1kme7lVaw=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Resending this to xen-devel since no one rendered a response on xen-users

---

I'm bumping into a problem which looks like a bug.  Perhaps it's for
lack of knowledge (and _documentation_ of HVM).  If I do the
following:

brctl addbr bmette31
ifconfig bmette31 1.2.3.249 netmask 255.255.255.248
xm create bmette31

Where "bmette31" has a config file that has a vif entry like: vif = [
'type=ioemu, mac=00:16:3e:00:00:07, bridge=bmette31']  this works
*just fine*.  I'm able to route through the host to the HVM domain
which is set to 1.2.3.250.  However, whenever I use a script which is
loosely based on a vif-bridge script that I got from /etc/xen/scripts
running Xen 3.2.1 compiled from source, it does not work.
Specifically, I can reach 1.2.3.249 from the outside but not
1.2.3.250.  As far as I can tell, the problem is that whenever 'brctl
addbr bmette31' is invoked from outside the script, networking between
the host and the HVM guest works fine, but when invoked from within
the script, networking between the host and the HVM guest does not
work.  Note that while the domain is running (and using the script
below), 'brctl show' indicates that I have a bridge called bmette31
and that 'ifconfig bmette31' shows the right IP.  So just to recap -
if I comment out 'brctl addbr bmette31' from the script below and run
it manually then start the HVM guest, networking is fine, but if I run
that from within the script it does not work.

One thing I notice immediately is that when I create the bridge from
the command-line, the bridge starts out with all zeros in the MAC
address, and once the custom script runs upon starting the domU, it
gets a MAC address like so:

bridge name     bridge id               STP enabled     interfaces
bmette31                8000.8a10ff068f3f       no              vif61.0

That's the working scenario as seen by 'brctl show'.  The non-working
scenario (invoking 'brctl addbr bmette31' from within the script) look
like this:

bridge name     bridge id               STP enabled     interfaces
bmette31                8000.feffffffffff       no              vif62.0

FYI, I only care about this because I'm trying to make my domUs
extremely portable (relying only on a config file and a vif script),
i.e. for live migration.  Staticly creating hundreds (thousands?) of
bridges across all nodes isn't an option.  Any ideas?


-Ray


#!/bin/bash
#
#vif bridge script for HVMs
#invoke like this:
#
#vif = [ 'type=ioemu, mac=00:16:3e:00:00:07, bridge=bmette31,
script=vif-bmette31' ]

/usr/sbin/brctl addbr bmette31

dir=$(dirname "$0")
. "$dir/vif-common.sh"

bridge=${bridge:-}
bridge=$(xenstore_read_default "$XENBUS_PATH/bridge" "$bridge")


RET=0
ip link show $bridge 1>/dev/null 2>&1 || RET=1
if [ "$RET" -eq 1 ]
then
#       do_without_error brctl addbr "$bridge"
    fatal "Could not find bridge device $bridge"
fi

case "$command" in
    online)
        setup_bridge_port "$vif"
        add_to_bridge "$bridge" "$vif"
        sleep 2
        ifconfig "$bridge" 1.2.3.249 netmask 255.255.255.248
        ;;

    offline)
        do_without_error ifconfig "$bridge" down
        do_without_error brctl delbr "$bridge"
        ;;
esac


log debug "Successful vif-bridge $command for $vif, bridge $bridge."
if [ "$command" == "online" ]
then
  success
fi

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel