5

I'm trying to build my personal holy grail: booting my Debian Wheezy KVM server diskless from a iSCSI target and the only configuration needed on the diskless server is the iSCSI parameters in the NIC ROM. The rest of the config should all be `inside' the iSCSI LUN.

The system has two NICs that are connected to a switch that supports LACP. So, I want to boot the machine over the bonded interface, that is also inside a bridge vmbr0. Although this combination isn't exactly working.

Because I read that the iSCSI connection should not be interrupted after boot (for example by reconfiguring the interfaces), I tried to set all my IP configuration before boot (in the kernel parameters/cmdline).

The iSCSI boot part is handled by the ROM of my Broadcom dual-port NIC. This seems to work nicely: grub is started and boot continues after that. In my grub configuration, I have this:

linux /vmlinuz-2.6.32-26-pve root=UUID={iscsi-disk-uuid} ro  quiet bond=bond0:eth0,eth1:mode=802.3ad,lacp_rate=1,miimon=100,xmit_hash_policy=layer2+3 bridge=vmbr0:bond0 ip=192.168.15.4::192.168.15.1:255.255.0.0::vmbr0:off

When grub launches the kernel, I get these errors:

ipconfig: vmbr0: SIOCGIFINDEX: No such device
ipconfig: no devices to configure
... repeated 10 times...
/scripts/local-top/iscsi: .: line 426: can't open '/run/net-vmbr0.conf'

And I'm dropped in the initramfs shell, where I find that bond0 is not configured at all (the bonding module is however loaded) and vmbr0 neither (the bridge module is apparently builtin).

When I make the scope smaller, by excluding the bonding configuration, with this grub line:

linux /vmlinuz-2.6.32-26-pve root=UUID={iscsi-disk-uuid} ro  quiet bridge=vmbr0:eth0 ip=192.168.15.4::192.168.15.1:255.255.0.0::vmbr0:off

Also here, vmbr0 is not created.

So it seems to me that Debian Wheezy's initramfs isn't configuring both bonding and bridging. brctl is available in the initramfs, ifenslave on the other hand is not.

What is there to do about this? Or are my kernel parameters (cmdline) not supported/allowed? Or should I consider another booting sequence?

hvtilborg
  • 217
  • 1
  • 2
  • 5

1 Answers1

2

It is defenitely interesting question and here is how I did a trick. My configuration is about the same as yours: Proxmox booting via iSCSI bridged interface. My grub boot line looks like this:

GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 ISCSI_INITIATOR=iqn.2007-08.com.example.client:client ISCSI_TARGET_NAME=iqn.2005-10.org.freenas.ctl:proxmox ISCSI_TARGET_IP=192.168.11.3 ISCSI_TARGET_PORT=3260 root=UUID=04709453-9d82-47d6-a898-81ea6408f88e ip=192.168.11.1:::255.255.255.0:client:vmbr2:off"

To boot with this grub configuration I need to start the bridge before grub mounts root. I make it by assigning a script in /etc/udev/rules.d/70-persistent-net.rules like this:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:30:48:94:61:ec", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="ens6f0", RUN+="/bin/brctl-iscsi ens6f0 vmbr2"

this /bin/brctl-iscsi script looks like this:

#!/bin/sh

ifconfig $1 mtu 9000 up
brctl addbr $2
brctl addif $2 $1
ip link set dev $2 type bridge forward_delay 0 stp_state 0

I also need a initramfs hook to put this script in initrd:

root@proxmox-2:~# cat /usr/share/initramfs-tools/hooks/brctl_iscsi
#!/bin/sh -e

PREREQS=""

prereqs() { echo "$PREREQS"; }

case "$1" in
    prereqs)
    prereqs
    exit 0
    ;;
esac

. /usr/share/initramfs-tools/hook-functions

copy_exec /bin/brctl-iscsi    /bin

And finally in /etc/network/interfaces I have this for iscsi interface and its bridge:

no-auto-down ens6f0
no-auto-down vmbr2

iface ens6f0 inet manual

iface vmbr2 inet manual
    address  192.168.11.2
    netmask  255.255.255.0
    bridge-ports ens6f0
    bridge-stp off
    bridge-fd 0
    down ifconfig vmbr2 down; brctl delbr vmbr2
#iSCSI network

That's it Regards, Dmitry

Dmitry Ra
  • 36
  • 4