Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Dev

[PATCH] RA Route (LF 1929): an OCF RA to manage network routes

 

 

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded


florian.haas at linbit

Jun 25, 2008, 8:06 AM

Post #1 of 12 (539 views)
Permalink
[PATCH] RA Route (LF 1929): an OCF RA to manage network routes

# HG changeset patch
# User Florian Haas <florian[at]linbit.com>
# Date 1214403554 -7200
# Node ID 28c1f9e604576bc8681ddf36e88d62488a96adbb
# Parent 1e014af9b3a7bfd138721e11ded274153c857713
An OCF RA capable of enabling and disabling network routes (using "ip route"), named "Route".
Please see http://developerbugs.linux-foundation.org/show_bug.cgi?id=1929 for rationale and example use case.

diff -r 1e014af9b3a7 -r 28c1f9e60457 resources/OCF/Makefile.am
--- a/resources/OCF/Makefile.am Tue Jun 24 14:07:40 2008 +0200
+++ b/resources/OCF/Makefile.am Wed Jun 25 16:19:14 2008 +0200
@@ -74,6 +74,7 @@ ocf_SCRIPTS = ClusterMon \
pgsql \
Pure-FTPd \
Raid1 \
+ Route \
rsyncd \
SAPDatabase \
SAPInstance \
diff -r 1e014af9b3a7 -r 28c1f9e60457 resources/OCF/Route
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/resources/OCF/Route Wed Jun 25 16:19:14 2008 +0200
@@ -0,0 +1,236 @@
+#!/bin/sh
+#
+# Route OCF RA. Enables and disables network routes.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of version 2 of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Further, this software is distributed without any warranty that it is
+# free of the rightful claim of any third person regarding infringement
+# or the like. Any license provided herein, whether implied or
+# otherwise, applies only to this software file. Patent licenses, if
+# any, provided herein do not apply to combinations of this program with
+# other software, or any other product whatsoever.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
+#
+
+#######################################################################
+# Initialization:
+
+. ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs
+
+#######################################################################
+
+meta_data() {
+ cat <<END
+<?xml version="1.0"?>
+<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
+<resource-agent name="Route" version="0.1">
+<version>1.0</version>
+
+<longdesc lang="en">
+Enables and disables network routes.
+
+Supports host and net routes, routes via a gateway address,
+and routes using specific source addresses.
+</longdesc>
+<shortdesc lang="en">Manages network routes</shortdesc>
+
+<parameters>
+
+<parameter name="destination" unique="1" required="1">
+<longdesc lang="en">
+The destination network (or host) to be configured for the route.
+Specify the netmask suffix in CIDR notation (e.g. "/24").
+If no suffix is given, a host route will be created.
+Specify "0.0.0.0/0" or "default" if you want this resource to set the system default route.
+</longdesc>
+<shortdesc lang="en">Destination network</shortdesc>
+<content type="string" default="" />
+</parameter>
+
+<parameter name="device" unique="1">
+<longdesc lang="en">
+The outgoing network device to use for this route.
+</longdesc>
+<shortdesc lang="en">Outgoing network device</shortdesc>
+<content type="string" default="" />
+</parameter>
+
+<parameter name="gateway" unique="1">
+<longdesc lang="en">
+The gateway IP address to use for this route.
+</longdesc>
+<shortdesc lang="en">Gateway IP address</shortdesc>
+<content type="string" default="" />
+</parameter>
+
+<parameter name="source" unique="1">
+<longdesc lang="en">
+The source IP address to be configured for the route.
+</longdesc>
+<shortdesc lang="en">Source IP address</shortdesc>
+<content type="string" default="" />
+</parameter>
+
+</parameters>
+
+<actions>
+<action name="start" timeout="20" />
+<action name="stop" timeout="20" />
+<action name="monitor" timeout="20" interval="10" depth="0" start-delay="0"/>
+<action name="reload" timeout="20" />
+<action name="meta-data" timeout="5" />
+<action name="verify-all" timeout="20" />
+</actions>
+</resource-agent>
+END
+}
+
+#######################################################################
+
+# Don't do anything if the necessary utilities aren't present
+for binary in ip grep; do
+ check_binary $binary
+done
+
+# don't exit on TERM, to test that lrmd makes sure that we do exit
+trap sigterm_handler TERM
+sigterm_handler() {
+ ocf_log info "They use TERM to bring us down. No such luck."
+ return
+}
+
+create_route_spec() {
+ # Creates a route specification for use by "ip route (add|del|show)"
+ local route_spec="to ${OCF_RESKEY_destination}"
+ if [ "${OCF_RESKEY_device}" ]; then
+ route_spec="${route_spec} dev ${OCF_RESKEY_device}"
+ fi
+ if [ "${OCF_RESKEY_gateway}" ]; then
+ route_spec="${route_spec} via ${OCF_RESKEY_gateway}"
+ fi
+ if [ "${OCF_RESKEY_source}" ]; then
+ route_spec="${route_spec} src ${OCF_RESKEY_source}"
+ fi
+ echo "$route_spec"
+}
+
+route_usage() {
+ cat <<END
+usage: $0 {start|stop|status|monitor|validate-all|meta-data}
+
+Expects to have a fully populated OCF RA-compliant environment set.
+END
+}
+
+route_start() {
+ route_status
+ local status=$?
+ if [ $status = $OCF_SUCCESS ]; then
+ ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : already started."
+ return $OCF_SUCCESS
+ fi
+ ip route add $(create_route_spec) && return $OCF_SUCCESS
+ return $OCF_ERR_GENERIC
+}
+
+route_stop() {
+ route_status
+ local status=$?
+ case $status in
+ $OCF_SUCCESS)
+ ip route del $(create_route_spec) && return $OCF_SUCCESS
+ ;;
+ $OCF_NOT_RUNNING)
+ ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : already stopped."
+ return $OCF_SUCCESS
+ ;;
+ esac
+ return $OCF_ERR_GENERIC
+}
+
+route_status() {
+ show_output="$(ip route show $(create_route_spec) 2>/dev/null)"
+ if [ $? -eq 0 ]; then
+ if [ "$show_output" ]; then
+ # "ip route show" returned zero, and produced output on
+ # stdout. That is what we expect.
+ return $OCF_SUCCESS
+ else
+ # "ip route show" returned zero, but produced no
+ # output on stdout. Assume the route was cleanly
+ # unconfigured.
+ return $OCF_NOT_RUNNING
+ fi
+ else
+ # "ip route show" returned an error code. Assume something
+ # went wrong.
+ return $OCF_ERR_GENERIC
+ fi
+}
+
+route_validate() {
+ # Did we get a destination?
+ if [ -z "${OCF_RESKEY_destination}" ]; then
+ ocf_log error "Missing required parameter \"destination\"."
+ return $OCF_ERR_ARGS
+ fi
+ # Did we get either a device or a gateway address?
+ if [ -z "${OCF_RESKEY_device}" -a -z "${OCF_RESKEY_gateway}" ]; then
+ ocf_log error "Must specifiy either \"device\", or \"gateway\", or both."
+ return $OCF_ERR_ARGS
+ fi
+ # If a device has been configured, is it available on this system?
+ if [ "${OCF_RESKEY_device}" ]; then
+ if ! ip link show ${OCF_RESKEY_device} >/dev/null 2>&1; then
+ ocf_log error "Network device ${OCF_RESKEY_device} appears not to be available on this system."
+ return $OCF_ERR_ARGS
+ fi
+ fi
+ # If a source address has been configured, is it available on this system?
+ if [ "${OCF_RESKEY_source}" ]; then
+ if ! ip address show | grep ${OCF_RESKEY_source} >/dev/null 2>&1; then
+ ocf_log error "Source address ${OCF_RESKEY_source} appears not to be available on this system."
+ return $OCF_ERR_ARGS
+ fi
+ fi
+ # If a gateway address has been configured, is it reachable?
+ if [ "${OCF_RESKEY_gateway}" ]; then
+ if ! ip route get ${OCF_RESKEY_gateway} >/dev/null 2>&1; then
+ ocf_log error "Gateway address ${OCF_RESKEY_gateway} is unreachable."
+ return $OCF_ERR_ARGS
+ fi
+ fi
+ return $OCF_SUCCESS
+}
+
+case $__OCF_ACTION in
+meta-data) meta_data
+ exit $OCF_SUCCESS
+ ;;
+start) route_validate && route_start;;
+stop) route_stop;;
+status|monitor) route_status;;
+reload) ocf_log err "Reloading..."
+ route_start
+ ;;
+validate-all) route_validate;;
+usage|help) route_usage
+ exit $OCF_SUCCESS
+ ;;
+*) route_usage
+ exit $OCF_ERR_UNIMPLEMENTED
+ ;;
+esac
+rc=$?
+ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : $rc"
+exit $rc
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


florian.haas at linbit

Jun 25, 2008, 8:22 AM

Post #2 of 12 (520 views)
Permalink
Re: [PATCH] RA Route (LF 1929): an OCF RA to manage network routes [In reply to]

Hello,

Sorry for posting the patch both to Bugzilla and to the list, wasn't
sure which was more appropriate so I did both. :-)

Review and feedback much appreciated.

Cheers,
Florian

Florian Haas wrote:
> # HG changeset patch
> # User Florian Haas <florian[at]linbit.com>
> # Date 1214403554 -7200
> # Node ID 28c1f9e604576bc8681ddf36e88d62488a96adbb
> # Parent 1e014af9b3a7bfd138721e11ded274153c857713
> [...]

--
: Florian G. Haas
: LINBIT Information Technologies GmbH
: Vivenotgasse 48, A-1120 Vienna, Austria

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


dejanmm at fastmail

Jun 25, 2008, 8:38 AM

Post #3 of 12 (521 views)
Permalink
Re: [PATCH] RA Route (LF 1929): an OCF RA to manage network routes [In reply to]

Hi Florian,

I'll review the RA and include it in the repository.

Many thanks.

Cheers,

Dejan

On Wed, Jun 25, 2008 at 05:06:14PM +0200, Florian Haas wrote:
> # HG changeset patch
> # User Florian Haas <florian[at]linbit.com>
> # Date 1214403554 -7200
> # Node ID 28c1f9e604576bc8681ddf36e88d62488a96adbb
> # Parent 1e014af9b3a7bfd138721e11ded274153c857713
> An OCF RA capable of enabling and disabling network routes (using "ip route"), named "Route".
> Please see http://developerbugs.linux-foundation.org/show_bug.cgi?id=1929 for rationale and example use case.
>
> diff -r 1e014af9b3a7 -r 28c1f9e60457 resources/OCF/Makefile.am
> --- a/resources/OCF/Makefile.am Tue Jun 24 14:07:40 2008 +0200
> +++ b/resources/OCF/Makefile.am Wed Jun 25 16:19:14 2008 +0200
> @@ -74,6 +74,7 @@ ocf_SCRIPTS = ClusterMon \
> pgsql \
> Pure-FTPd \
> Raid1 \
> + Route \
> rsyncd \
> SAPDatabase \
> SAPInstance \
> diff -r 1e014af9b3a7 -r 28c1f9e60457 resources/OCF/Route
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/resources/OCF/Route Wed Jun 25 16:19:14 2008 +0200
> @@ -0,0 +1,236 @@
> +#!/bin/sh
> +#
> +# Route OCF RA. Enables and disables network routes.
> +#
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of version 2 of the GNU General Public License as
> +# published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it would be useful, but
> +# WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> +#
> +# Further, this software is distributed without any warranty that it is
> +# free of the rightful claim of any third person regarding infringement
> +# or the like. Any license provided herein, whether implied or
> +# otherwise, applies only to this software file. Patent licenses, if
> +# any, provided herein do not apply to combinations of this program with
> +# other software, or any other product whatsoever.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write the Free Software Foundation,
> +# Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
> +#
> +
> +#######################################################################
> +# Initialization:
> +
> +. ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs
> +
> +#######################################################################
> +
> +meta_data() {
> + cat <<END
> +<?xml version="1.0"?>
> +<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
> +<resource-agent name="Route" version="0.1">
> +<version>1.0</version>
> +
> +<longdesc lang="en">
> +Enables and disables network routes.
> +
> +Supports host and net routes, routes via a gateway address,
> +and routes using specific source addresses.
> +</longdesc>
> +<shortdesc lang="en">Manages network routes</shortdesc>
> +
> +<parameters>
> +
> +<parameter name="destination" unique="1" required="1">
> +<longdesc lang="en">
> +The destination network (or host) to be configured for the route.
> +Specify the netmask suffix in CIDR notation (e.g. "/24").
> +If no suffix is given, a host route will be created.
> +Specify "0.0.0.0/0" or "default" if you want this resource to set the system default route.
> +</longdesc>
> +<shortdesc lang="en">Destination network</shortdesc>
> +<content type="string" default="" />
> +</parameter>
> +
> +<parameter name="device" unique="1">
> +<longdesc lang="en">
> +The outgoing network device to use for this route.
> +</longdesc>
> +<shortdesc lang="en">Outgoing network device</shortdesc>
> +<content type="string" default="" />
> +</parameter>
> +
> +<parameter name="gateway" unique="1">
> +<longdesc lang="en">
> +The gateway IP address to use for this route.
> +</longdesc>
> +<shortdesc lang="en">Gateway IP address</shortdesc>
> +<content type="string" default="" />
> +</parameter>
> +
> +<parameter name="source" unique="1">
> +<longdesc lang="en">
> +The source IP address to be configured for the route.
> +</longdesc>
> +<shortdesc lang="en">Source IP address</shortdesc>
> +<content type="string" default="" />
> +</parameter>
> +
> +</parameters>
> +
> +<actions>
> +<action name="start" timeout="20" />
> +<action name="stop" timeout="20" />
> +<action name="monitor" timeout="20" interval="10" depth="0" start-delay="0"/>
> +<action name="reload" timeout="20" />
> +<action name="meta-data" timeout="5" />
> +<action name="verify-all" timeout="20" />
> +</actions>
> +</resource-agent>
> +END
> +}
> +
> +#######################################################################
> +
> +# Don't do anything if the necessary utilities aren't present
> +for binary in ip grep; do
> + check_binary $binary
> +done
> +
> +# don't exit on TERM, to test that lrmd makes sure that we do exit
> +trap sigterm_handler TERM
> +sigterm_handler() {
> + ocf_log info "They use TERM to bring us down. No such luck."
> + return
> +}
> +
> +create_route_spec() {
> + # Creates a route specification for use by "ip route (add|del|show)"
> + local route_spec="to ${OCF_RESKEY_destination}"
> + if [ "${OCF_RESKEY_device}" ]; then
> + route_spec="${route_spec} dev ${OCF_RESKEY_device}"
> + fi
> + if [ "${OCF_RESKEY_gateway}" ]; then
> + route_spec="${route_spec} via ${OCF_RESKEY_gateway}"
> + fi
> + if [ "${OCF_RESKEY_source}" ]; then
> + route_spec="${route_spec} src ${OCF_RESKEY_source}"
> + fi
> + echo "$route_spec"
> +}
> +
> +route_usage() {
> + cat <<END
> +usage: $0 {start|stop|status|monitor|validate-all|meta-data}
> +
> +Expects to have a fully populated OCF RA-compliant environment set.
> +END
> +}
> +
> +route_start() {
> + route_status
> + local status=$?
> + if [ $status = $OCF_SUCCESS ]; then
> + ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : already started."
> + return $OCF_SUCCESS
> + fi
> + ip route add $(create_route_spec) && return $OCF_SUCCESS
> + return $OCF_ERR_GENERIC
> +}
> +
> +route_stop() {
> + route_status
> + local status=$?
> + case $status in
> + $OCF_SUCCESS)
> + ip route del $(create_route_spec) && return $OCF_SUCCESS
> + ;;
> + $OCF_NOT_RUNNING)
> + ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : already stopped."
> + return $OCF_SUCCESS
> + ;;
> + esac
> + return $OCF_ERR_GENERIC
> +}
> +
> +route_status() {
> + show_output="$(ip route show $(create_route_spec) 2>/dev/null)"
> + if [ $? -eq 0 ]; then
> + if [ "$show_output" ]; then
> + # "ip route show" returned zero, and produced output on
> + # stdout. That is what we expect.
> + return $OCF_SUCCESS
> + else
> + # "ip route show" returned zero, but produced no
> + # output on stdout. Assume the route was cleanly
> + # unconfigured.
> + return $OCF_NOT_RUNNING
> + fi
> + else
> + # "ip route show" returned an error code. Assume something
> + # went wrong.
> + return $OCF_ERR_GENERIC
> + fi
> +}
> +
> +route_validate() {
> + # Did we get a destination?
> + if [ -z "${OCF_RESKEY_destination}" ]; then
> + ocf_log error "Missing required parameter \"destination\"."
> + return $OCF_ERR_ARGS
> + fi
> + # Did we get either a device or a gateway address?
> + if [ -z "${OCF_RESKEY_device}" -a -z "${OCF_RESKEY_gateway}" ]; then
> + ocf_log error "Must specifiy either \"device\", or \"gateway\", or both."
> + return $OCF_ERR_ARGS
> + fi
> + # If a device has been configured, is it available on this system?
> + if [ "${OCF_RESKEY_device}" ]; then
> + if ! ip link show ${OCF_RESKEY_device} >/dev/null 2>&1; then
> + ocf_log error "Network device ${OCF_RESKEY_device} appears not to be available on this system."
> + return $OCF_ERR_ARGS
> + fi
> + fi
> + # If a source address has been configured, is it available on this system?
> + if [ "${OCF_RESKEY_source}" ]; then
> + if ! ip address show | grep ${OCF_RESKEY_source} >/dev/null 2>&1; then
> + ocf_log error "Source address ${OCF_RESKEY_source} appears not to be available on this system."
> + return $OCF_ERR_ARGS
> + fi
> + fi
> + # If a gateway address has been configured, is it reachable?
> + if [ "${OCF_RESKEY_gateway}" ]; then
> + if ! ip route get ${OCF_RESKEY_gateway} >/dev/null 2>&1; then
> + ocf_log error "Gateway address ${OCF_RESKEY_gateway} is unreachable."
> + return $OCF_ERR_ARGS
> + fi
> + fi
> + return $OCF_SUCCESS
> +}
> +
> +case $__OCF_ACTION in
> +meta-data) meta_data
> + exit $OCF_SUCCESS
> + ;;
> +start) route_validate && route_start;;
> +stop) route_stop;;
> +status|monitor) route_status;;
> +reload) ocf_log err "Reloading..."
> + route_start
> + ;;
> +validate-all) route_validate;;
> +usage|help) route_usage
> + exit $OCF_SUCCESS
> + ;;
> +*) route_usage
> + exit $OCF_ERR_UNIMPLEMENTED
> + ;;
> +esac
> +rc=$?
> +ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : $rc"
> +exit $rc
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


dk at in-telegence

Jun 26, 2008, 12:58 AM

Post #4 of 12 (510 views)
Permalink
Re: [PATCH] RA Route (LF 1929): an OCF RA to manage network routes [In reply to]

> I'll review the RA and include it in the repository.

I had a look, too as I would have needed something like this soon anyway.

My thoughts are attached in form of a patch file.

Regards
Dominik
Attachments: Route.patch (2.60 KB)


florian.haas at linbit

Jun 26, 2008, 1:09 AM

Post #5 of 12 (512 views)
Permalink
Re: [PATCH] RA Route (LF 1929): an OCF RA to manage network routes [In reply to]

Dominik Klein wrote:
>> I'll review the RA and include it in the repository.
>
> I had a look, too as I would have needed something like this soon anyway.
>
> My thoughts are attached in form of a patch file.

Good points. Applied to changeset. Thanks.

Cheers,
Florian

--
: Florian G. Haas
: LINBIT Information Technologies GmbH
: Vivenotgasse 48, A-1120 Vienna, Austria

Enterprise consultancy and support for DRBD is available from LINBIT. If
you are interested, Please go to http://www.linbit.com/en/contact and
leave your contact details.

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


dejanmm at fastmail

Jun 26, 2008, 7:04 AM

Post #6 of 12 (508 views)
Permalink
Re: [PATCH] RA Route (LF 1929): an OCF RA to manage network routes [In reply to]

Hi,

On Thu, Jun 26, 2008 at 10:09:23AM +0200, Florian Haas wrote:
> Dominik Klein wrote:
> >> I'll review the RA and include it in the repository.
> >
> > I had a look, too as I would have needed something like this soon anyway.
> >
> > My thoughts are attached in form of a patch file.
>
> Good points. Applied to changeset. Thanks.

Another patch. Please verify and apply after Dominik's.

Cheers,

Dejan

> Cheers,
> Florian
>
> --
> : Florian G. Haas
> : LINBIT Information Technologies GmbH
> : Vivenotgasse 48, A-1120 Vienna, Austria
>
> Enterprise consultancy and support for DRBD is available from LINBIT. If
> you are interested, Please go to http://www.linbit.com/en/contact and
> leave your contact details.
>
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


florian.haas at linbit

Jun 26, 2008, 7:13 AM

Post #7 of 12 (503 views)
Permalink
Re: [PATCH] RA Route (LF 1929): an OCF RA to manage network routes [In reply to]

Dejan,

did you mean to include an attachment?

Florian

--
: Florian G. Haas Tel +43-1-8178292-60 :
: LINBIT Information Technologies GmbH Fax +43-1-8178292-82 :
: Vivenotgasse 48, A-1120 Vienna, Austria http://www.linbit.com :

This e-mail is solely for use by the intended recipient(s). Information
contained in this e-mail and its attachments may be confidential,
privileged or copyrighted. If you are not the intended recipient you are
hereby formally notified that any use, copying, disclosure or
distribution of the contents of this e-mail, in whole or in part, is
prohibited. Also please notify immediately the sender by return e-mail
and delete this e-mail from your system. Thank you for your co-operation.
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


dejanmm at fastmail

Jun 26, 2008, 7:16 AM

Post #8 of 12 (504 views)
Permalink
Re: [PATCH] RA Route (LF 1929): an OCF RA to manage network routes [In reply to]

Hi,

On Thu, Jun 26, 2008 at 04:13:32PM +0200, Florian Haas wrote:
> Dejan,
>
> did you mean to include an attachment?

Err... I guess so. Sorry, happens all the time to me. Here goes.

Cheers,

Dejan

>
> Florian
>
> --
> : Florian G. Haas Tel +43-1-8178292-60 :
> : LINBIT Information Technologies GmbH Fax +43-1-8178292-82 :
> : Vivenotgasse 48, A-1120 Vienna, Austria http://www.linbit.com :
>
> This e-mail is solely for use by the intended recipient(s). Information
> contained in this e-mail and its attachments may be confidential,
> privileged or copyrighted. If you are not the intended recipient you are
> hereby formally notified that any use, copying, disclosure or
> distribution of the contents of this e-mail, in whole or in part, is
> prohibited. Also please notify immediately the sender by return e-mail
> and delete this e-mail from your system. Thank you for your co-operation.
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
Attachments: Route.patch-2.gz (1.58 KB)


florian.haas at linbit

Jun 26, 2008, 7:33 AM

Post #9 of 12 (502 views)
Permalink
Re: [PATCH] RA Route (LF 1929): an OCF RA to manage network routes [In reply to]

OK, agree with most comments/changes. Thanks.

About this one:
> # why is this msg error severity and yet the RA doesn't exit with
> # an error code?
> reload) ocf_log err "Reloading..."
> route_start

I'll fix that. It was cut & pasted from the Dummy RA. Btw the Xen RA
logs migration success with "ocf_log err" too; if that's unintended, you
might want to fix that... :-)

Cheers,
Florian

--
: Florian G. Haas
: LINBIT Information Technologies GmbH
: Vivenotgasse 48, A-1120 Vienna, Austria

Enterprise consultancy and support for DRBD is available from LINBIT. If
you are interested, Please go to http://www.linbit.com/en/contact and
leave your contact details.

When replying, there is no need to CC my personal address. I monitor the
list on a daily basis. Thank you.
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


dejanmm at fastmail

Jun 26, 2008, 12:50 PM

Post #10 of 12 (495 views)
Permalink
Re: [PATCH] RA Route (LF 1929): an OCF RA to manage network routes [In reply to]

Hi,

On Thu, Jun 26, 2008 at 04:33:46PM +0200, Florian Haas wrote:
> OK, agree with most comments/changes. Thanks.
>
> About this one:
> > # why is this msg error severity and yet the RA doesn't exit with
> > # an error code?
> > reload) ocf_log err "Reloading..."
> > route_start
>
> I'll fix that. It was cut & pasted from the Dummy RA. Btw the Xen RA
> logs migration success with "ocf_log err" too; if that's unintended, you
> might want to fix that... :-)

:) Obviously a case of cut&paste. Should be fixed. Thanks for
spotting that one.

Cheers,

Dejan

>
> Cheers,
> Florian
>
> --
> : Florian G. Haas
> : LINBIT Information Technologies GmbH
> : Vivenotgasse 48, A-1120 Vienna, Austria
>
> Enterprise consultancy and support for DRBD is available from LINBIT. If
> you are interested, Please go to http://www.linbit.com/en/contact and
> leave your contact details.
>
> When replying, there is no need to CC my personal address. I monitor the
> list on a daily basis. Thank you.
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


florian.haas at linbit

Jun 27, 2008, 10:49 AM

Post #11 of 12 (469 views)
Permalink
Re: [PATCH] RA Route (LF 1929): an OCF RA to manage network routes [In reply to]

Dejan,

was this intentional?

> +# all of these need to pass the validate check
> +route_validate
> +case $__OCF_ACTION in
> +start) route_start;;
> stop) route_stop;;
> [...]

It calls route_validate(), but doesn't do anything if it returns nonzero.

Shouldn't this be like "route_validate || exit $?"?

Florian


--
: Florian G. Haas
: LINBIT Information Technologies GmbH
: Vivenotgasse 48, A-1120 Vienna, Austria

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


florian.haas at linbit

Jun 30, 2008, 4:55 AM

Post #12 of 12 (412 views)
Permalink
Re: [PATCH] RA Route (LF 1929): an OCF RA to manage network routes [In reply to]

Florian Haas wrote:
> Dejan,
>
> was this intentional?
>
>> +# all of these need to pass the validate check
>> +route_validate
>> +case $__OCF_ACTION in
>> +start) route_start;;
>> stop) route_stop;;
>> [...]
>
> It calls route_validate(), but doesn't do anything if it returns nonzero.
>
> Shouldn't this be like "route_validate || exit $?"?

Hmmm. On second thought, I don't really like that. It causes a
misconfigured resource (i.e. one that does not pass the validate check)
to show up as unmanaged immediately after adding, which I find
misleading. OK if I revert this to the earlier behavior?

Cheers,
Florian

--
: Florian G. Haas
: LINBIT Information Technologies GmbH
: Vivenotgasse 48, A-1120 Vienna, Austria
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.