Hi,
just for your information (in case anybody else stumbles upon this problem).

We just had this problem after upgrading to 2.2:
- booting a compute node caused vhost0 and bond0 to have different MACs
causing networking not working at all

This seems to be caused by Ubuntu 14.04s networking ordering which is
not completed for bond0 when vhost0 is created.

For reference, we seemed to have workarounded that for now with (a
script which waits until bond0 has all the members it should have):

$ cat /etc/network/interfaces
# Interface lo
auto lo
iface lo inet loopback
    address 127.0.0.1
# Interface em1
auto em1
iface em1 inet static
    address 0.0.0.0
    mtu 1500
# Interface em2
auto em2
iface em2 inet static
    address 0.0.0.0
    mtu 1500
# Interface bond0
auto bond0
iface bond0 inet static
    address 0.0.0.0
    mtu 1500
    pre-up /etc/network/local/sys11bonding em1 em2
    bond-mode 4
    bond-miimon 100
    bond_xmit_hash_policy layer2
# Interface vhost0
auto vhost0
iface vhost0 inet static
    address x.x.x.x
    netmask 255.255.255.192
    mtu 1500
    dns-nameservers x.x.x.x
    gateway x.x.x.x
    pre-up /etc/network/local/vhost0.pre-up
    post-up ip route change default via x.x.x.x mtu 1500
    post-up service contrail-vrouter-agent start
    post-down service contrail-vrouter-agent stop || true
    post-down modprobe -r vrouter || true

$ cat /etc/network/local/vhost0.pre-up
#!/usr/bin/env bash
# 2015, [email protected]
# configure vhost0, wait until bonding is setup before

set -x
exec >/tmp/vhost0.pre-up  2>&1
ifconfig -a


slavecount=$(tr ' ' '\n' < /sys/class/net/bond0/bonding/slaves | wc -l)
until ((slavecount == 2)); do
  sleep 1
  ((i++))
  if ((i==120)); then
    logger -t network "Could not start vhost0 because there are only
$slavecount slaves instead of 2"
    exit 1
  fi
  slavecount=$(tr ' ' '\n' < /sys/class/net/bond0/bonding/slaves | wc -l)
done

mac=$(cat /sys/class/net/bond0/address)

echo 2 | tee /proc/sys/vm/drop_caches
modprobe vrouter || true
vif --create vhost0 --mac $mac
vif --add bond0 --mac $mac --vrf 0 --vhost-phys x --type physical
vif --add vhost0 --mac $mac --vrf 0 --type vhost --xconnect bond0

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Dev mailing list
[email protected]
http://lists.opencontrail.org/mailman/listinfo/dev_lists.opencontrail.org

Reply via email to