[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Possible issue in vif-route script



On Sun, 2015-08-02 at 18:49 +0300, Martti wrote:
> I may have misconfigured something, but it seems that the vif-route 
> script executes ip route with invalid parameters when it is run with the 
> 'add' and 'remove' commands.

I agree that the issue is real.

The issues seems to relate to the vif script being called for the tap
device associated with the emulated NIC (vifX.Y-emu) network device as well
as the PV device (vifX.Y), but the event names differ for the two device
types (for hysterical raisins). So they are not "invalid" as such.

> For clarity, this is the script I was looking at: http://xenbits.xen.org/
> gitweb/?p=xen.git;a=blob_plain;f=tools/hotplug/Linux/vif-route;hb=HEAD
> 
> If ${command} is 'online' or 'offline' the variable ${ipcmd} receives a 
> value, but in case of 'add' or 'remove' it is empty and causes the ip 
> route command to fail which prevents the starting of any VMs that use 
> script=vif-route.

I think you fix has probably resulted in the emulated path not working,
which you maybe wouldn't notice if you were using the PV path.

TBH I'm not sure how the two devices are supposed to interact in a routed
environment, routing the same IP to two devices seems counter-intuitive.
What we really want (I think) is for the emulated device to get the traffic
at first and to switch to the PV device on unplug, but I'm not sure how we
can arrange for the ordering of the routes to be such that this works out.

I was about to suggest that in addition to your fix you might also want to
consider handling add+remove in the same way as online+offline (with
"add|online)" in the case), but after rereading the preceding paragraph I'm
far from convinced that would be the right thing to do, I think it might
happen to sometimes work depending on the ordering of the events (emu vs
PV) and not work if they happen in the wrong order.

Anyway, long story short I think your change is clearly an improvement, if
not the whole story (which seems to be "complicated"). Please would you
submit it to the devel list as a patch as described in 
http://wiki.xen.org/wiki/Submitting_Xen_Patches .

Ian.

> For now I've changed the line 38 to the following and it seems to be 
> working as intended:
> if [ "${ip}" ] && [ "${ipcmd}" ] ; then
> 
> My setup:
>     OS: debian jessie
>     Xen version: 4.4.1
> 
> Relevant hvm configuration:
>     vif = [ 'script=vif-route,ip=192.168.1.2/32,gatewaydev=br0' ]
> 
> 
> All the best,
> -Martti
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxx
> http://lists.xen.org/xen-users

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.