Hi, I''m using two bridges. Since upgrading from 3.0-2 to 3.0-4 the vif''s are randomly interchanged when passed to domU. sometimes vif1.0 gets assigned to eth0 and vif1.1 to eth1 on domU sometimes vif1.1 gets assigned to eth0 and vif1.0 to eth1 on domU I''ve tried two ''my-network-bridge'' scripts. 1. #!/bin/bash case "$1" in start) /etc/xen/scripts/network-bridge start bridge=xenbr0 netdev=eth0 vifnum=0 antispoof=no /etc/xen/scripts/network-bridge start bridge=xenbr1 netdev=eth1 vifnum=1 antispoof=no ;; stop) /etc/xen/scripts/network-bridge stop bridge=xenbr0 netdev=eth0 vifnum=0 /etc/xen/scripts/network-bridge stop bridge=xenbr1 netdev=eth1 vifnum=1 ;; restart) $0 stop $0 start ;; *) echo "usage: $0 {start|stop|restart}" esac exit 0 and 2. #!/bin/sh dir=$(dirname "$0") "$dir/network-bridge" "$@" vifnum=0 "$dir/network-bridge" "$@" vifnum=1 Both with the same result. Any ideas? Thanks. Chris. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Chris Fanning
2007-Mar-21 17:25 UTC
Re: [Xen-users] unpredictible multiple bridge behaviour.
Hi,> you can work around the problem by specifying static mac addresses > and using a bit of udev magic in domU.Yep, that did it. Still, I wonder why this had never been a problem before upgrade. Thanks, Chris. On 3/21/07, jez <jez@jinsky.com> wrote:> On Wed, Mar 21, 2007 at 04:41:30PM +0100, Chris Fanning wrote: > > Hi, > > > > I''m using two bridges. > > Since upgrading from 3.0-2 to 3.0-4 the vif''s are randomly > > interchanged when passed to domU. > > > > sometimes vif1.0 gets assigned to eth0 and vif1.1 to eth1 on domU > > sometimes vif1.1 gets assigned to eth0 and vif1.0 to eth1 on domU > > > > I''ve tried two ''my-network-bridge'' scripts. > > > > Hi Chris > > Assuming that the output of "brctl show" (ignoring the bridge-id > field), looks like this: > > bridge name bridge id STP enabled interfaces > xenbr0 8000.feffffffffff no vif0.0 > peth0 > xenbr1 8000.feffffffffff no vif0.1 > peth1 > > then you don''t need to worry about the bridge building script you are > running. > > I have no idea why your vif interfaces are being assigned randomly to > eth interfaces in your domUs, but a quick test here suggests that > you can work around the problem by specifying static mac addresses > and using a bit of udev magic in domU. The following are instructions > on how to acheive this. > > 1. In the configuration file for a domU, specify a static mac address > and a bridge for each interface as follows: > > vif = [ ''mac=00:16:3e:00:00:11, bridge=xenbr0'', > ''mac=00:16:3e:00:00:22, bridge=xenbr1'' ] > > Make sure you put commas in all the right places. > > 2. Then inside the domU create a file called /etc/udev/vm-local.rules > and put the following in it: > > SUBSYSTEM=="net", ATTRS{address}=="00:16:3e:00:00:11", NAME="eth0" > SUBSYSTEM=="net", ATTRS{address}=="00:16:3e:00:00:22", NAME="eth1" > > 3. Now just add a symlink to the udev rules directory so that your > rules file, vm-local.rules, is processed before all the other rules > files. The following works on my distro: > > cd /etc/udev/rules.d > ln -s ../vm-local.rules 010_vm-local.rules > > Make sure that your symlink ends in ".rules" or it will be ignored. > > Now, every time you start this domU, udev should ensure that eth0 and > eth1 are always the same devices. > > Probably not the answer you were hoping for, but hopefully it helps. > > jez > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Wed, Mar 21, 2007 at 04:41:30PM +0100, Chris Fanning wrote:> Hi, > > I''m using two bridges. > Since upgrading from 3.0-2 to 3.0-4 the vif''s are randomly > interchanged when passed to domU. > > sometimes vif1.0 gets assigned to eth0 and vif1.1 to eth1 on domU > sometimes vif1.1 gets assigned to eth0 and vif1.0 to eth1 on domU > > I''ve tried two ''my-network-bridge'' scripts. >Hi Chris Assuming that the output of "brctl show" (ignoring the bridge-id field), looks like this: bridge name bridge id STP enabled interfaces xenbr0 8000.feffffffffff no vif0.0 peth0 xenbr1 8000.feffffffffff no vif0.1 peth1 then you don''t need to worry about the bridge building script you are running. I have no idea why your vif interfaces are being assigned randomly to eth interfaces in your domUs, but a quick test here suggests that you can work around the problem by specifying static mac addresses and using a bit of udev magic in domU. The following are instructions on how to acheive this. 1. In the configuration file for a domU, specify a static mac address and a bridge for each interface as follows: vif = [ ''mac=00:16:3e:00:00:11, bridge=xenbr0'', ''mac=00:16:3e:00:00:22, bridge=xenbr1'' ] Make sure you put commas in all the right places. 2. Then inside the domU create a file called /etc/udev/vm-local.rules and put the following in it: SUBSYSTEM=="net", ATTRS{address}=="00:16:3e:00:00:11", NAME="eth0" SUBSYSTEM=="net", ATTRS{address}=="00:16:3e:00:00:22", NAME="eth1" 3. Now just add a symlink to the udev rules directory so that your rules file, vm-local.rules, is processed before all the other rules files. The following works on my distro: cd /etc/udev/rules.d ln -s ../vm-local.rules 010_vm-local.rules Make sure that your symlink ends in ".rules" or it will be ignored. Now, every time you start this domU, udev should ensure that eth0 and eth1 are always the same devices. Probably not the answer you were hoping for, but hopefully it helps. jez _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Wed, Mar 21, 2007 at 06:25:43PM +0100, Chris Fanning wrote:> Hi, > > >you can work around the problem by specifying static mac addresses > >and using a bit of udev magic in domU. > > Yep, that did it. > Still, I wonder why this had never been a problem before upgrade. >The problem might actually spring from udev on domU. On my debian systems it keeps a record of mac -> eth mappings in a generated udev rules file called /etc/udev/rules.d/z25_persistent-net.rules. When I started switching between using both Xen and UML with the same filesystem images I ran into eth naming problems - specifically, eth0 incremented it''s interface number by one each time I booted (eth1, eth2, eth3 ...). The problem had something to do with the different ways that mac addresses were generated. I haven''t had time to look into it properly. I put the following in my vm-local.rules file, which solves things for me: KERNEL=="eth*", NAME="%k" I didn''t recommend this to you because your symtoms are obviously different. However, you might want to try it since it has the advantage that you can use domU config files without static macs: vif = [ ''bridge=xenbr0'', ''bridge=xenbr1'' ] In short, it''s conceivable that the algorithm used to generate mac addresses changed between Xen versions and that this had an effect because your system had been keeping track of previous mac addresses. If this is the cause, another fix might be to just remove the file containing the generated mac -> eth address mappings if one exists in your system. I don''t bother with this because I''m still using the same images for Xen, UML, kvm, etc. I''m sure that clears things up! ;-) jez _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users