diff mbox

[ovs-dev] debian: Fix bringup seq for OVSPort type of vlan.

Message ID 1446159630-9281-1-git-send-email-saurabh@cplanenetworks.com
State Rejected
Headers show

Commit Message

Saurabh Mohan Oct. 29, 2015, 11 p.m. UTC
Problem:
When the OVSPort is a vlan interface there is a sequencing issue when we try
to bring up the OVSBridge.
Consider the following configuration in /etc/network/interfaces

allow-ovs br-foo
iface br-foo inet static
    address 1.1.1.1
    netmask 255.255.255.0
    ovs_type OVSBridge
    ovs_ports eth1.2052

# Interface eth1.2052
allow-br-foo eth1.2052
iface eth1.2052 inet manual
    ovs_type OVSPort
    ovs_bridge br-foo
    bridge_name br-foo

If we run 'service openvswitch start' then we'd get the following errors.
2015-10-08T00:05:45.279Z|00019|bridge|WARN|could not open network device eth1.2052 (No such device)

Reason:
Due to the current sequence the script /etc/network/if-pre-up.d/openvswitch
with IF_OVS_TYPE=OVSPort is run prior to the script
/etc/network.if-pre-up.d/vlan which brings up the vlan interface eth1.2052.

saurabh@ubuntu-test:~$ run-parts --test /etc/network/if-pre-up.d/
/etc/network/if-pre-up.d//bridge
/etc/network/if-pre-up.d//ethtool
/etc/network/if-pre-up.d//openvswitch
/etc/network/if-pre-up.d//vlan
/etc/network/if-pre-up.d//wireless-tools
/etc/network/if-pre-up.d//wpasupplicant

Fix:
The fix is to order the openvswitch script to run after the other interface
scripts in /etc/network/if-pre-up.d/

Signed-off-by: Saurabh Mohan <saurabh@cplanenetworks.com>
---
 debian/openvswitch-switch.links | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Gurucharan Shetty Oct. 29, 2015, 11:42 p.m. UTC | #1
On Thu, Oct 29, 2015 at 4:00 PM, Saurabh Mohan
<saurabh@cplanenetworks.com> wrote:
> Problem:
> When the OVSPort is a vlan interface there is a sequencing issue when we try
> to bring up the OVSBridge.
> Consider the following configuration in /etc/network/interfaces
>
> allow-ovs br-foo
> iface br-foo inet static
>     address 1.1.1.1
>     netmask 255.255.255.0
>     ovs_type OVSBridge
>     ovs_ports eth1.2052
>
> # Interface eth1.2052
> allow-br-foo eth1.2052
> iface eth1.2052 inet manual
>     ovs_type OVSPort
>     ovs_bridge br-foo
>     bridge_name br-foo
>
> If we run 'service openvswitch start' then we'd get the following errors.
> 2015-10-08T00:05:45.279Z|00019|bridge|WARN|could not open network device eth1.2052 (No such device)
>
> Reason:
> Due to the current sequence the script /etc/network/if-pre-up.d/openvswitch
> with IF_OVS_TYPE=OVSPort is run prior to the script
> /etc/network.if-pre-up.d/vlan which brings up the vlan interface eth1.2052.
>
> saurabh@ubuntu-test:~$ run-parts --test /etc/network/if-pre-up.d/
> /etc/network/if-pre-up.d//bridge
> /etc/network/if-pre-up.d//ethtool
> /etc/network/if-pre-up.d//openvswitch
> /etc/network/if-pre-up.d//vlan
> /etc/network/if-pre-up.d//wireless-tools
> /etc/network/if-pre-up.d//wpasupplicant
>
> Fix:
> The fix is to order the openvswitch script to run after the other interface
> scripts in /etc/network/if-pre-up.d/
>
> Signed-off-by: Saurabh Mohan <saurabh@cplanenetworks.com>

How about changing the name of ' /etc/network/if-pre-up.d//vlan' to
/etc/network/if-pre-up.d//a09_vlan ? :)


I understand the problem, but I am not very keen with the solution.
Someone else may come and say that they want to start after
openvswitch and hence change the name from z09_ to something else. One
option for you is to use openvswitch vlan device instead. Or some
other way to do this.

> ---
>  debian/openvswitch-switch.links | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/debian/openvswitch-switch.links b/debian/openvswitch-switch.links
> index cf58073..5c7b1f1 100644
> --- a/debian/openvswitch-switch.links
> +++ b/debian/openvswitch-switch.links
> @@ -1,2 +1,2 @@
>  usr/share/openvswitch/scripts/ifupdown.sh etc/network/if-post-down.d/openvswitch
> -usr/share/openvswitch/scripts/ifupdown.sh etc/network/if-pre-up.d/openvswitch
> +usr/share/openvswitch/scripts/ifupdown.sh etc/network/if-pre-up.d/z09_openvswitch
> --
> 1.9.1
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
Saurabh Mohan Oct. 30, 2015, 12:03 a.m. UTC | #2
On 10/29/2015 04:42 PM, Gurucharan Shetty wrote:
> On Thu, Oct 29, 2015 at 4:00 PM, Saurabh Mohan
> <saurabh@cplanenetworks.com> wrote:
>> Problem:
>> When the OVSPort is a vlan interface there is a sequencing issue when we try
>> to bring up the OVSBridge.
>> Consider the following configuration in /etc/network/interfaces
>>
>> allow-ovs br-foo
>> iface br-foo inet static
>>      address 1.1.1.1
>>      netmask 255.255.255.0
>>      ovs_type OVSBridge
>>      ovs_ports eth1.2052
>>
>> # Interface eth1.2052
>> allow-br-foo eth1.2052
>> iface eth1.2052 inet manual
>>      ovs_type OVSPort
>>      ovs_bridge br-foo
>>      bridge_name br-foo
>>
>> If we run 'service openvswitch start' then we'd get the following errors.
>> 2015-10-08T00:05:45.279Z|00019|bridge|WARN|could not open network device eth1.2052 (No such device)
>>
>> Reason:
>> Due to the current sequence the script /etc/network/if-pre-up.d/openvswitch
>> with IF_OVS_TYPE=OVSPort is run prior to the script
>> /etc/network.if-pre-up.d/vlan which brings up the vlan interface eth1.2052.
>>
>> saurabh@ubuntu-test:~$ run-parts --test /etc/network/if-pre-up.d/
>> /etc/network/if-pre-up.d//bridge
>> /etc/network/if-pre-up.d//ethtool
>> /etc/network/if-pre-up.d//openvswitch
>> /etc/network/if-pre-up.d//vlan
>> /etc/network/if-pre-up.d//wireless-tools
>> /etc/network/if-pre-up.d//wpasupplicant
>>
>> Fix:
>> The fix is to order the openvswitch script to run after the other interface
>> scripts in /etc/network/if-pre-up.d/
>>
>> Signed-off-by: Saurabh Mohan <saurabh@cplanenetworks.com>
>
> How about changing the name of ' /etc/network/if-pre-up.d//vlan' to
> /etc/network/if-pre-up.d//a09_vlan ? :)
>
>
> I understand the problem, but I am not very keen with the solution.
> Someone else may come and say that they want to start after
> openvswitch and hence change the name from z09_ to something else. One
> option for you is to use openvswitch vlan device instead.

I picked this prefix to kind of put a stake in the ground for naming 
under /etc/network/if-pre-up.d/; If u could suggest another convention 
that would be preferable then we could use that instead.

If another component wanted to run after openvswitch then they could
name their script z10_xyz and won't have to change openvswitch's name.

I do however understand your concern with the proposed fix.
We are trying to stay agnostic to the underlay interface (eth, vlan, 
bond...) and let the kernel handle it. Otherwise the controller would
have to be aware of the way each server connects to the underlay and 
that may not be uniform.

> Or some
> other way to do this.

any suggestions?

>
>> ---
>>   debian/openvswitch-switch.links | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/debian/openvswitch-switch.links b/debian/openvswitch-switch.links
>> index cf58073..5c7b1f1 100644
>> --- a/debian/openvswitch-switch.links
>> +++ b/debian/openvswitch-switch.links
>> @@ -1,2 +1,2 @@
>>   usr/share/openvswitch/scripts/ifupdown.sh etc/network/if-post-down.d/openvswitch
>> -usr/share/openvswitch/scripts/ifupdown.sh etc/network/if-pre-up.d/openvswitch
>> +usr/share/openvswitch/scripts/ifupdown.sh etc/network/if-pre-up.d/z09_openvswitch
>> --
>> 1.9.1
>>
>> _______________________________________________
>> dev mailing list
>> dev@openvswitch.org
>> http://openvswitch.org/mailman/listinfo/dev
Gurucharan Shetty Oct. 30, 2015, 12:19 a.m. UTC | #3
> I do however understand your concern with the proposed fix.
> We are trying to stay agnostic to the underlay interface (eth, vlan,
> bond...) and let the kernel handle it. Otherwise the controller would
> have to be aware of the way each server connects to the underlay and that
> may not be uniform.

I think I did not understand what you mean above. Why is using the
Open vSwitch VLAN device instead of Linux VLAN device a problem again?

>
>> Or some
>> other way to do this.
>
>
> any suggestions?

I can't think of a something right of the top of my head. We have
similar dependency issues with NFS startup scripts and they don't have
a solution either.
Ubuntu 15.04 and later is moving towards systemd and this whole
'interfaces' integration and dependency issues needs to be re-visited.
So I am hesitant to work on a quick fix here, unless you think of
something.


>
>
>>
>>> ---
>>>   debian/openvswitch-switch.links | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/debian/openvswitch-switch.links
>>> b/debian/openvswitch-switch.links
>>> index cf58073..5c7b1f1 100644
>>> --- a/debian/openvswitch-switch.links
>>> +++ b/debian/openvswitch-switch.links
>>> @@ -1,2 +1,2 @@
>>>   usr/share/openvswitch/scripts/ifupdown.sh
>>> etc/network/if-post-down.d/openvswitch
>>> -usr/share/openvswitch/scripts/ifupdown.sh
>>> etc/network/if-pre-up.d/openvswitch
>>> +usr/share/openvswitch/scripts/ifupdown.sh
>>> etc/network/if-pre-up.d/z09_openvswitch
>>> --
>>> 1.9.1
>>>
>>> _______________________________________________
>>> dev mailing list
>>> dev@openvswitch.org
>>> http://openvswitch.org/mailman/listinfo/dev
Saurabh Mohan Nov. 2, 2015, 4:56 a.m. UTC | #4
On 10/29/2015 05:19 PM, Gurucharan Shetty wrote:
>> I do however understand your concern with the proposed fix.
>> We are trying to stay agnostic to the underlay interface (eth, vlan,
>> bond...) and let the kernel handle it. Otherwise the controller would
>> have to be aware of the way each server connects to the underlay and that
>> may not be uniform.
>
> I think I did not understand what you mean above. Why is using the
> Open vSwitch VLAN device instead of Linux VLAN device a problem again?
>
>>
>>> Or some
>>> other way to do this.
>>
>>
>> any suggestions?
>
> I can't think of a something right of the top of my head. We have
> similar dependency issues with NFS startup scripts and they don't have
> a solution either.
> Ubuntu 15.04 and later is moving towards systemd and this whole
> 'interfaces' integration and dependency issues needs to be re-visited.
> So I am hesitant to work on a quick fix here, unless you think of
> something.
>

u'r right. no point in applying this patch since it will be thrown away 
when we reach 15.04
I was able to create a workaround for this problem using the 'pre-up' 
option as follows.

allow-ovs br-foo
iface br-foo inet static
     address 1.1.1.1
     netmask 255.255.255.0
     ovs_type OVSBridge
     ovs_ports eth1.2052
     pre-up IFACE=eth1.2052; /etc/network/if-pre-up.d/vlan

# Interface eth1.2052
allow-br-foo eth1.2052
iface eth1.2052 inet manual
     ovs_type OVSPort
     ovs_bridge br-foo
     bridge_name br-foo

thanks.

>
>>
>>
>>>
>>>> ---
>>>>    debian/openvswitch-switch.links | 2 +-
>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/debian/openvswitch-switch.links
>>>> b/debian/openvswitch-switch.links
>>>> index cf58073..5c7b1f1 100644
>>>> --- a/debian/openvswitch-switch.links
>>>> +++ b/debian/openvswitch-switch.links
>>>> @@ -1,2 +1,2 @@
>>>>    usr/share/openvswitch/scripts/ifupdown.sh
>>>> etc/network/if-post-down.d/openvswitch
>>>> -usr/share/openvswitch/scripts/ifupdown.sh
>>>> etc/network/if-pre-up.d/openvswitch
>>>> +usr/share/openvswitch/scripts/ifupdown.sh
>>>> etc/network/if-pre-up.d/z09_openvswitch
>>>> --
>>>> 1.9.1
>>>>
>>>> _______________________________________________
>>>> dev mailing list
>>>> dev@openvswitch.org
>>>> http://openvswitch.org/mailman/listinfo/dev
diff mbox

Patch

diff --git a/debian/openvswitch-switch.links b/debian/openvswitch-switch.links
index cf58073..5c7b1f1 100644
--- a/debian/openvswitch-switch.links
+++ b/debian/openvswitch-switch.links
@@ -1,2 +1,2 @@ 
 usr/share/openvswitch/scripts/ifupdown.sh etc/network/if-post-down.d/openvswitch
-usr/share/openvswitch/scripts/ifupdown.sh etc/network/if-pre-up.d/openvswitch
+usr/share/openvswitch/scripts/ifupdown.sh etc/network/if-pre-up.d/z09_openvswitch