cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Fabio M. Di Nitto <fdinitto@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] rgmanager: Add IP "interface" parameter
Date: Fri, 13 Jul 2012 06:08:22 +0200	[thread overview]
Message-ID: <4FFF9F36.2040007@redhat.com> (raw)
In-Reply-To: <20120712172325.GA117794@redhat.com>

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



  reply	other threads:[~2012-07-13  4:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-12 17:23 [Cluster-devel] [PATCH] rgmanager: Add IP "interface" parameter Ryan McCabe
2012-07-13  4:08 ` Fabio M. Di Nitto [this message]
2012-07-13 20:08   ` Lon Hohberger
2012-07-14 19:54     ` Fabio M. Di Nitto
2012-07-20 21:07       ` Lon Hohberger
2012-07-21  4:47         ` Fabio M. Di Nitto
2012-07-24 17:37           ` Ryan McCabe
2012-07-24 21:52             ` Lon Hohberger
2012-07-21  4:48         ` Fabio M. Di NItto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FFF9F36.2040007@redhat.com \
    --to=fdinitto@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).