FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 07-12-2012, 05:23 PM
Ryan McCabe
 
Default rgmanager: Add IP "interface" parameter

This patch adds an "interface" parameter for IP resources. The
interface must already be configured and active. This parameter
should be used only when at least two active interfaces have IP
addresses on the same subnet and it's necessary to specify which
particular interface should be used.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
---
rgmanager/src/resources/ip.sh | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/rgmanager/src/resources/ip.sh b/rgmanager/src/resources/ip.sh
index 38d1ab9..3adbb12 100755
--- a/rgmanager/src/resources/ip.sh
+++ b/rgmanager/src/resources/ip.sh
@@ -132,6 +132,15 @@ meta_data()
<content type="boolean"/>
</parameter>

+ <parameter name="interface">
+ <longdesc lang="en">
+ The network interface to which the IP address should be added. The interface must already be configured and active. This parameter should be used only when at least two active interfaces have IP addresses on the same subnet and it is desired to have the IP address added to a particular interface.
+ </longdesc>
+ <shortdesc lang="en">
+ Network interface
+ </shortdesc>
+ <content type="string"/>
+ </parameter>
</parameters>

<actions>
@@ -587,6 +596,10 @@ ipv6()
fi

if [ "$1" = "add" ]; then
+ if [ -n "$OCF_RESKEY_interface" ] &&
+ [ "$OCF_RESKEY_interface" != $dev ]; then
+ continue
+ fi
ipv6_same_subnet $ifaddr_exp/$maskbits $addr_exp
if [ $? -ne 0 ]; then
continue
@@ -670,6 +683,10 @@ ipv4()
fi

if [ "$1" = "add" ]; then
+ if [ -n "$OCF_RESKEY_interface" ] &&
+ [ "$OCF_RESKEY_interface" != $dev ]; then
+ continue
+ fi
ipv4_same_subnet $ifaddr/$maskbits $addr
if [ $? -ne 0 ]; then
continue
--
1.7.10.4
 
Old 07-13-2012, 04:08 AM
"Fabio M. Di Nitto"
 
Default rgmanager: Add IP "interface" parameter

Hi Ryan,

only one comment here.. many times we have been asked to implement
"interface" parameter to allow any random IP on any specific interface
(beside the pre configured ip on that interface).

Can we change the patch to simply fix both problems at once?
Effectively, the fact that 2 interfaces have 2 ip on the same subnet is
simply a corner case.

Maybe later on we can add something like: ifconfig iface up / down.

when doing ifconfig up we need to store the output of ip addresses
automatically assigned to that interface.

on shutdown, we need to check if the ip we are removing is the last one
on that interface _before_ issuing an ifconfig down in case there are
more ip resources associated to it.

The patch looks ok, but I would probably use a different term than
"interface" as it sounds very similar to the expected feature above.

Fabio

On 07/12/2012 07:23 PM, Ryan McCabe wrote:
> This patch adds an "interface" parameter for IP resources. The
> interface must already be configured and active. This parameter
> should be used only when at least two active interfaces have IP
> addresses on the same subnet and it's necessary to specify which
> particular interface should be used.
>
> Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
> ---
> rgmanager/src/resources/ip.sh | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/rgmanager/src/resources/ip.sh b/rgmanager/src/resources/ip.sh
> index 38d1ab9..3adbb12 100755
> --- a/rgmanager/src/resources/ip.sh
> +++ b/rgmanager/src/resources/ip.sh
> @@ -132,6 +132,15 @@ meta_data()
> <content type="boolean"/>
> </parameter>
>
> + <parameter name="interface">
> + <longdesc lang="en">
> + The network interface to which the IP address should be added. The interface must already be configured and active. This parameter should be used only when at least two active interfaces have IP addresses on the same subnet and it is desired to have the IP address added to a particular interface.
> + </longdesc>
> + <shortdesc lang="en">
> + Network interface
> + </shortdesc>
> + <content type="string"/>
> + </parameter>
> </parameters>
>
> <actions>
> @@ -587,6 +596,10 @@ ipv6()
> fi
>
> if [ "$1" = "add" ]; then
> + if [ -n "$OCF_RESKEY_interface" ] &&
> + [ "$OCF_RESKEY_interface" != $dev ]; then
> + continue
> + fi
> ipv6_same_subnet $ifaddr_exp/$maskbits $addr_exp
> if [ $? -ne 0 ]; then
> continue
> @@ -670,6 +683,10 @@ ipv4()
> fi
>
> if [ "$1" = "add" ]; then
> + if [ -n "$OCF_RESKEY_interface" ] &&
> + [ "$OCF_RESKEY_interface" != $dev ]; then
> + continue
> + fi
> ipv4_same_subnet $ifaddr/$maskbits $addr
> if [ $? -ne 0 ]; then
> continue
 
Old 07-13-2012, 08:08 PM
Lon Hohberger
 
Default rgmanager: Add IP "interface" parameter

On 07/13/2012 12:08 AM, Fabio M. Di Nitto wrote:
> Hi Ryan,
>
> only one comment here.. many times we have been asked to implement
> "interface" parameter to allow any random IP on any specific interface
> (beside the pre configured ip on that interface).

We haven't done that because we might end up owning routing. However,
if we make it explicit that this is not the case, then we could in
theory do both.

-- Lon
 
Old 07-14-2012, 07:54 PM
"Fabio M. Di Nitto"
 
Default rgmanager: Add IP "interface" parameter

On 07/13/2012 10:08 PM, Lon Hohberger wrote:
> On 07/13/2012 12:08 AM, Fabio M. Di Nitto wrote:
>> Hi Ryan,
>>
>> only one comment here.. many times we have been asked to implement
>> "interface" parameter to allow any random IP on any specific interface
>> (beside the pre configured ip on that interface).
>
> We haven't done that because we might end up owning routing. However,
> if we make it explicit that this is not the case, then we could in
> theory do both.

hmm right.. forgot about that.

I would still prefer to avoid the use of interface="" option if possible
tho. Maybe something slightly less overloaded. force_interface or
force_net_device.

Fabio
 
Old 07-20-2012, 09:07 PM
Lon Hohberger
 
Default rgmanager: Add IP "interface" parameter

On 07/14/2012 03:54 PM, Fabio M. Di Nitto wrote:
> On 07/13/2012 10:08 PM, Lon Hohberger wrote:
>> On 07/13/2012 12:08 AM, Fabio M. Di Nitto wrote:
>>> Hi Ryan,
>>>
>>> only one comment here.. many times we have been asked to implement
>>> "interface" parameter to allow any random IP on any specific interface
>>> (beside the pre configured ip on that interface).
>>
>> We haven't done that because we might end up owning routing. However,
>> if we make it explicit that this is not the case, then we could in
>> theory do both.
>
> hmm right.. forgot about that.
>
> I would still prefer to avoid the use of interface="" option if possible
> tho. Maybe something slightly less overloaded. force_interface or
> force_net_device.
>

Sure; that's fine.

prefer_interface=""

maybe? "If more than one match, use this one, otherwise, use the one
that matches"

-- Lon
 
Old 07-21-2012, 04:47 AM
"Fabio M. Di Nitto"
 
Default rgmanager: Add IP "interface" parameter

On 07/20/2012 11:07 PM, Lon Hohberger wrote:
> On 07/14/2012 03:54 PM, Fabio M. Di Nitto wrote:
>> On 07/13/2012 10:08 PM, Lon Hohberger wrote:
>>> On 07/13/2012 12:08 AM, Fabio M. Di Nitto wrote:
>>>> Hi Ryan,
>>>>
>>>> only one comment here.. many times we have been asked to implement
>>>> "interface" parameter to allow any random IP on any specific interface
>>>> (beside the pre configured ip on that interface).
>>>
>>> We haven't done that because we might end up owning routing. However,
>>> if we make it explicit that this is not the case, then we could in
>>> theory do both.
>>
>> hmm right.. forgot about that.
>>
>> I would still prefer to avoid the use of interface="" option if possible
>> tho. Maybe something slightly less overloaded. force_interface or
>> force_net_device.
>>
>
> Sure; that's fine.
>
> prefer_interface=""
>
> maybe? "If more than one match, use this one, otherwise, use the one
> that matches"

Yes that sounds a lot better than force_*

Thanks
Fabio
 
Old 07-21-2012, 04:48 AM
"Fabio M. Di NItto"
 
Default rgmanager: Add IP "interface" parameter

On 07/20/2012 11:07 PM, Lon Hohberger wrote:
> On 07/14/2012 03:54 PM, Fabio M. Di Nitto wrote:
>> On 07/13/2012 10:08 PM, Lon Hohberger wrote:
>>> On 07/13/2012 12:08 AM, Fabio M. Di Nitto wrote:
>>>> Hi Ryan,
>>>>
>>>> only one comment here.. many times we have been asked to implement
>>>> "interface" parameter to allow any random IP on any specific interface
>>>> (beside the pre configured ip on that interface).
>>>
>>> We haven't done that because we might end up owning routing. However,
>>> if we make it explicit that this is not the case, then we could in
>>> theory do both.
>>
>> hmm right.. forgot about that.
>>
>> I would still prefer to avoid the use of interface="" option if possible
>> tho. Maybe something slightly less overloaded. force_interface or
>> force_net_device.
>>
>
> Sure; that's fine.
>
> prefer_interface=""
>
> maybe? "If more than one match, use this one, otherwise, use the one
> that matches"

Yes that sounds a lot better than force_*

Thanks
Fabio
 
Old 07-24-2012, 05:37 PM
Ryan McCabe
 
Default rgmanager: Add IP "interface" parameter

On Sat, Jul 21, 2012 at 06:47:50AM +0200, Fabio M. Di Nitto wrote:
> On 07/20/2012 11:07 PM, Lon Hohberger wrote:
> > Sure; that's fine.
> >
> > prefer_interface=""
> >
> > maybe? "If more than one match, use this one, otherwise, use the one
> > that matches"
>
> Yes that sounds a lot better than force_*
>
> Thanks
> Fabio

Works for me.

New patch:

This patch adds a "prefer_interface" parameter for IP resources.
The interface must already be configured and active. This
parameter should be used only when at least two active interfaces
have IP addresses on the same subnet and it's necessary to specify
which particular interface should be used.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
---
rgmanager/src/resources/ip.sh | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/rgmanager/src/resources/ip.sh b/rgmanager/src/resources/ip.sh
index 38d1ab9..bbd85f3 100755
--- a/rgmanager/src/resources/ip.sh
+++ b/rgmanager/src/resources/ip.sh
@@ -132,6 +132,15 @@ meta_data()
<content type="boolean"/>
</parameter>

+ <parameter name="prefer_interface">
+ <longdesc lang="en">
+ The network interface to which the IP address should be added. The interface must already be configured and active. This parameter should be used only when at least two active interfaces have IP addresses on the same subnet and it is desired to have the IP address added to a particular interface.
+ </longdesc>
+ <shortdesc lang="en">
+ Network interface
+ </shortdesc>
+ <content type="string"/>
+ </parameter>
</parameters>

<actions>
@@ -587,6 +596,10 @@ ipv6()
fi

if [ "$1" = "add" ]; then
+ if [ -n "$OCF_RESKEY_prefer_interface" ] &&
+ [ "$OCF_RESKEY_prefer_interface" != $dev ]; then
+ continue
+ fi
ipv6_same_subnet $ifaddr_exp/$maskbits $addr_exp
if [ $? -ne 0 ]; then
continue
@@ -670,6 +683,10 @@ ipv4()
fi

if [ "$1" = "add" ]; then
+ if [ -n "$OCF_RESKEY_prefer_interface" ] &&
+ [ "$OCF_RESKEY_prefer_interface" != $dev ]; then
+ continue
+ fi
ipv4_same_subnet $ifaddr/$maskbits $addr
if [ $? -ne 0 ]; then
continue
--
1.7.10.4
 
Old 07-24-2012, 09:52 PM
Lon Hohberger
 
Default rgmanager: Add IP "interface" parameter

ACK

-- Lon


On 07/24/2012 01:37 PM, Ryan McCabe wrote:
> On Sat, Jul 21, 2012 at 06:47:50AM +0200, Fabio M. Di Nitto wrote:
>> On 07/20/2012 11:07 PM, Lon Hohberger wrote:
>>> Sure; that's fine.
>>>
>>> prefer_interface=""
>>>
>>> maybe? "If more than one match, use this one, otherwise, use the one
>>> that matches"
>>
>> Yes that sounds a lot better than force_*
>>
>> Thanks
>> Fabio
>
> Works for me.
>
> New patch:
>
> This patch adds a "prefer_interface" parameter for IP resources.
> The interface must already be configured and active. This
> parameter should be used only when at least two active interfaces
> have IP addresses on the same subnet and it's necessary to specify
> which particular interface should be used.
>
> Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
> ---
> rgmanager/src/resources/ip.sh | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/rgmanager/src/resources/ip.sh b/rgmanager/src/resources/ip.sh
> index 38d1ab9..bbd85f3 100755
> --- a/rgmanager/src/resources/ip.sh
> +++ b/rgmanager/src/resources/ip.sh
> @@ -132,6 +132,15 @@ meta_data()
> <content type="boolean"/>
> </parameter>
>
> + <parameter name="prefer_interface">
> + <longdesc lang="en">
> + The network interface to which the IP address should be added. The interface must already be configured and active. This parameter should be used only when at least two active interfaces have IP addresses on the same subnet and it is desired to have the IP address added to a particular interface.
> + </longdesc>
> + <shortdesc lang="en">
> + Network interface
> + </shortdesc>
> + <content type="string"/>
> + </parameter>
> </parameters>
>
> <actions>
> @@ -587,6 +596,10 @@ ipv6()
> fi
>
> if [ "$1" = "add" ]; then
> + if [ -n "$OCF_RESKEY_prefer_interface" ] &&
> + [ "$OCF_RESKEY_prefer_interface" != $dev ]; then
> + continue
> + fi
> ipv6_same_subnet $ifaddr_exp/$maskbits $addr_exp
> if [ $? -ne 0 ]; then
> continue
> @@ -670,6 +683,10 @@ ipv4()
> fi
>
> if [ "$1" = "add" ]; then
> + if [ -n "$OCF_RESKEY_prefer_interface" ] &&
> + [ "$OCF_RESKEY_prefer_interface" != $dev ]; then
> + continue
> + fi
> ipv4_same_subnet $ifaddr/$maskbits $addr
> if [ $? -ne 0 ]; then
> continue
>
 

Thread Tools




All times are GMT. The time now is 05:27 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org