Timothy Selivanow
2007-Dec-04 19:27 UTC
[CentOS-virt] Xen not applying custom network script on startup
I'm seeing an issue with xend not running a custom network script
automatically, but works when I run it manually.
In /etc/xen/xend-config.sxp I've changed:
(network-script network-bridge)
TO:
(network-script network-custom)
Here is /etc/xen/scripts/network-custom:
# !/bin/bash
# network-custom
script=/etc/xen/scripts/network-bridge
case $1 in
start)
$script start vifnum=0 bridge=xenbr0 netdev=eth0
$script start vifnum=1 bridge=xenbr1 netdev=dummy0
$script start vifnum=2 bridge=xenbr2 netdev=dummy1
;;
stop)
$script stop vifnum=0 bridge=xenbr0 netdev=eth0
$script stop vifnum=1 bridge=xenbr1 netdev=dummy0
$script stop vifnum=2 bridge=xenbr2 netdev=dummy1
;;
status)
$script status
;;
*)
echo 'Unknown command: ' $1
echo 'Valid commands are: start, stop, status'
exit 1
;;
esac
What am I missing? I'd like the guests to auto-start when the host
starts, but this is preventing that.
--Tim
__________________________________________________________________________
/ I never thought that I'd see the day where Netscape is free software and \
| X11 is proprietary. We live in interesting times. |
\ -- Matt Kimball /
--------------------------------------------------------------------------
\
\ \
\ /\
( )
.( o ).
Christopher G. Stach II
2007-Dec-09 06:25 UTC
[CentOS-virt] Xen not applying custom network script on startup
Timothy Selivanow wrote:> I'm seeing an issue with xend not running a custom network script > automatically, but works when I run it manually. > In /etc/xen/xend-config.sxp I've changed: > > (network-script network-bridge) > > TO: > (network-script network-custom)I've found that configuring the bridges using the Red Hat method (/etc/sysconfig/network-scripts) is easier and more straightforward than finagling around in the Xen scripts. Then you just disable Xen's method with ``(network-script /bin/true)''. The great thing about this is that you can handle bonding, VLANs, and bridges all in the same spot and at the same time. Example bridge interface /etc/sysconfig/network-scripts/ifcfg-xenbr0: DEVICE=xenbr0 TYPE=Bridge BOOTPROTO=none NETWORK=192.168.0.0 NETMASK=255.255.255.0 IPADDR=192.168.0.1 ONBOOT=yes DELAY=0 STP=on Example bridge port interface /etc/sysconfig/network-scripts/ifcfg-eth0: DEVICE=eth0 BOOTPROTO=none ONBOOT=yes USERCTL=no BRIDGE=xenbr0> Here is /etc/xen/scripts/network-custom: > > # !/bin/bash > # network-customMaybe your shebang is busted? -- Christopher G. Stach II