On Tue, Sep 22, 2009 at 3:32 PM, Iustin Pop <[email protected]> wrote: > On Tue, Sep 22, 2009 at 03:30:25PM +0100, Guido Trotter wrote: >> >> In order to be able to maintain the node network standard routing >> untouched while routing instance traffic through a different dedicated >> interface (eg: a gre tunnel) we need to specify the instance routing >> path inside a separate table, which will also contain different default >> gateway values. This patch fixes the kvm default network script to use >> the nic link, if present, as a routing table to use instead of the >> default one. >> >> Signed-off-by: Guido Trotter <[email protected]> >> --- >> lib/hypervisor/hv_kvm.py | 5 ++++- >> 1 files changed, 4 insertions(+), 1 deletions(-) >> >> diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py >> index fd51ae5..a2bca1e 100644 >> --- a/lib/hypervisor/hv_kvm.py >> +++ b/lib/hypervisor/hv_kvm.py >> @@ -169,7 +169,10 @@ class KVMHypervisor(hv_base.BaseHypervisor): >> script.write(" /usr/sbin/brctl addif $BRIDGE $INTERFACE\n") >> elif nic.nicparams[constants.NIC_MODE] == constants.NIC_MODE_ROUTED: >> script.write(" # Route traffic targeted at the IP to the >> interface\n") >> - script.write(" /sbin/ip route add $IP/32 dev $INTERFACE\n") >> + if nic.nicparams[constants.NIC_LINK]: >> + script.write(" /sbin/ip route replace $IP/32 table $LINK dev >> $INTERFACE\n") >> + else: >> + script.write(" /sbin/ip route replace $IP/32 dev $INTERFACE\n") > > The change LGTM, but where are the rules for the new table created? And > is this (NIC_LINK == table_name) documented somewhere else?
The rules will need to be outside of ganeti (as is today setting up the bridge). I will send a separate patch to update the manpage about this. Any other place where we should document this? Thanks, Guido > > iustin > -- Guido Trotter Google - Sysops Team Google Ireland Ltd. : Registered in Ireland with company number 368047. Gordon House, Barrow Street, Dublin 4, Ireland.
