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

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

To: Ray Barnes <tical.net@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] BUG: [?] host-only networking under HVM is broken with custom script
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Mon, 02 Jun 2008 07:55:51 +0100
Delivery-date: Sun, 01 Jun 2008 23:55:44 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <afa5bb590806012337q6d21dfeetc70b822d1b3d7fa6@xxxxxxxxxxxxxx>
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
Thread-index: AcjEfbGe8FyNszBwEd2r3wAWy6hiGQ==
Thread-topic: [Xen-devel] BUG: [?] host-only networking under HVM is broken with custom script
User-agent: Microsoft-Entourage/11.4.0.080122
I doubt your script is getting executed. HVM guests have a script run by
qemu-dm: the default location of that is /etc/xen/qemu-ifup and I think xend
never overrides that. You probably need to do some command-line splicing in
tools/python/xen/xend/image.py -- we already extract the 'bridge' parameter
and pass that along to qemu-dm, but the same is not done for the 'script'
parameter.

 -- Keir

On 2/6/08 07:37, "Ray Barnes" <tical.net@xxxxxxxxx> wrote:

> 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



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