Aside from the laughable idea of “militantly” supporting anything with a blog post, Miguel simply noted that these people exist, have written a book, and will be doing the speaking-tour-thing near him. Does he agree with the contents? (shakes eight-ball) Signs point to Yes.
Is he free to do so? Also yes.
Are you free to ignore him? Still yes.
Does His Chomskiness actually take the challenge and provide a better rebuttal to the underlying book than politely demanding Miguel STFU? Yep.
Oh, and here’s a patch that will let you do something cool with XEN 3.0.3:
--- network-bridge 2007-02-08 09:21:12.000000000 -0600
+++ network-vlans 2007-09-14 09:55:20.000000000 -0500
@@ -26,6 +26,7 @@
# bridge The bridge to use (default xenbr${vifnum}).
# netdev The interface to add to the bridge (default eth${vifnum}).
# antispoof Whether to use iptables to prevent spoofing (default no).
+# vlans VLANs to add on top of the bridge
#
# Internal Vars:
# pdev="p${netdev}"
@@ -64,18 +65,27 @@
bridge=${bridge:-xenbr${vifnum}}
netdev=${netdev:-eth${vifnum}}
antispoof=${antispoof:-no}
+vlans=$(echo $vlans | sed -e 's/,/ /g')
pdev="p${netdev}"
vdev="veth${vifnum}"
vif0="vif0.${vifnum}"
get_ip_info() {
- addr_pfx=`ip addr show dev $1 | egrep '^ *inet' | sed -e 's/ *inet //' -e 's/ .*//'`
+ addr_pfx=`ip addr show dev $1 | sed -n 's/^ *inet \(.*\) [^ ]*$/\1/p'`
gateway=`ip route show dev $1 | fgrep default | sed 's/default via //'`
}
+
+is_bonding() {
+ [ -f "/sys/class/net/$1/bonding/slaves" ]
+}
+
+is_ifup() {
+ ip link show dev $1 | awk '{ exit $3 !~ /[< ,]UP[,>]/ }'
+}
do_ifup() {
- if ! ifup $1 ; then
+ if ! ifup $1 || ! is_ifup $1 ; then
if [ ${addr_pfx} ] ; then
# use the info from get_ip_info()
ip addr flush $1
@@ -206,8 +216,8 @@
mac=`ip link show ${netdev} | grep 'link\/ether' | sed -e 's/.*ether \(..:..:..:..:..:..\).*/\1/'`
preiftransfer ${netdev}
transfer_addrs ${netdev} ${vdev}
- if ! ifdown ${netdev}; then
- # If ifdown fails, remember the IP details.
+ if is_bonding ${netdev} || ! ifdown ${netdev}; then
+ # Remember the IP details if necessary.
get_ip_info ${netdev}
ip link set ${netdev} down
ip addr flush ${netdev}
@@ -223,6 +233,18 @@
add_to_bridge ${bridge} ${vif0}
add_to_bridge2 ${bridge} ${pdev}
do_ifup ${netdev}
+
+ if [ -n "$vlans" ]; then
+ vconfig set_name_type VLAN_PLUS_VID_NO_PAD
+
+ for vlan in $vlans; do
+ create_bridge xenbr${vlan}
+
+ vconfig add ${bridge} ${vlan}
+ setup_bridge_port vlan${vlan}
+ add_to_bridge xenbr${vlan} vlan${vlan}
+ done
+ fi
else
# old style without ${vdev}
transfer_addrs ${netdev} ${bridge}
@@ -262,6 +284,20 @@
ip link set ${netdev} name ${vdev}
ip link set ${pdev} name ${netdev}
do_ifup ${netdev}
+
+ if [ -n "$vlans" ]; then
+ for vlan in $vlans; do
+ if [ -n `ip link show vlan${vlan} | grep '${bridge}\:'` ]; then
+ ip link delif ${bridge} xenbr${vlan}
+ ip link set ${bridge} down
+
+ ip link set vlan${vlan} down
+ vconfig rem ${bridge} ${vlan}
+ fi
+ done
+
+ vconfig set_name_type DEV_PLUS_VID_NO_PAD
+ fi
else
transfer_routes ${bridge} ${netdev}
ip link set ${bridge} down
It may be buggy, since I haven’t tested it in production. What it does is this: allows you to run an 802.1Q trunk into your XEN server, then put your virtual machines on any VLAN you want with a couple configuration stanzas.
So, your xend-config.sxp will have:
(network-script 'network-vlans netdev=eth0 vlans=8,9,10,11,13,121,14,15')
Which translates to “create bridges for VLAN 8, 9, 11, 13, 121, 14, and 15 with a xenbr prefix”. Then you set your DomU vif stanza to be “bridge=xenbr13” and bam! your DomU exists on the VLAN13. The primary limitation of this is that it keeps your Dom0 on the untagged/native VLAN, which isn’t best practice.
The stack of modules a packet traverses to get to a DomU will look like this (with relevant modules):
[network] -->
dom0: peth0 (dev) -->
dom0: xenbr0 (bridge) -->
dom0: vlan13 (dot1q attached to xenbr0) -->
dom0: xenbr13 (bridge) -->
dom0: vifX.0 (netloop) -->
domU: xen0 (xennet)
Be the second to comment on this...