On Fri, Jun 14, 2013 at 03:29:49PM -0300, [email protected] wrote:
> Hi,
> 
> I'm using Ubuntu 12.04 + Heartbeat 3.0.5-3ubuntu2 to provide high 
> availability for some IP addresses.
> I want to configure an IPv6 address on my haresources. I did this:
> 
> File /etc/heartbeat/haresources:
> 
> server.domain.com \
>    192.168.2.62/32/eth1 \
>    192.168.2.64/32/eth1 \
>    192.168.2.72/32/eth1 \
>    IPv6addr::2001:db8:38a5:8::2006/48/eth1 \
>    MailTo::[email protected]
> 
> The IPv4 addresses work fine, but I'm not getting success with the IPv6 
> address.
> My logs shows this message:
> ResourceManager[22129]: info: Running /etc/ha.d/resource.d/IPv6addr 
> 2001:db8:38a5:8 2006/48/eth1 start
> ResourceManager[22129]: CRIT: Giving up resources due to failure of 
> IPv6addr::2001:db8:38a5:8::2006/48/eth1
> ResourceManager[22129]: info: Running /etc/ha.d/resource.d/IPv6addr 
> 2001:db8:38a5:8 2006/48/eth1 stop
> ResourceManager[22129]: info: Retrying failed stop operation 
> [IPv6addr::2001:db8:38a5:8::2006/48/eth1]
> 
> Apparently there is a conflict between the characters '::' inside
> the IPv6 address and the separator '::' used in the haresources. But
> I would not like have to expand the IPv6 address.
> 
> Does anyone know a way to avoid this conflict?

You can't have it all ;-)

I see several options.
 - use 2001:db8:38a5:8:0:0:0:2006/48/eth1
 - abandon haresource
 - hack the "ResourceManager" script of heartbeat,
   allow for "escaping", or special case IPv6addr or similar...
   it's plain shell after all
 - hack the resource.d/IPv6addr *wrapper* script only,
   to mangle the input parameters.

The last two options would look something like below.
You need only *one* of these, though using both would not hurt.
Untested, and likely whitespace mangled ;-)

--- ResourceManager
+++ ResourceManager
@@ -167,6 +167,11 @@ resource2script() {
 # multiple arguments are separated by :: delimiters
 resource2arg() {
   case `canonname $1` in
+    IPv6addr::*)
+           # special case, there is only one argument,
+           # and it contains ::
+           echo $1 | sed 's%[^:]*::%%'
+           ;;
     *::*)      echo $1 | sed 's%[^:]*::%%' | sed 's%::% %g'
                ;;
   esac

--- IPv6addr
+++ IPv6addr
@@ -17,6 +17,8 @@ usage() {
     exit 1
 }

+[ $# = 3 ] && set -- "$1::$2" "$3"
+
 if [ $# != 2 ]; then
     usage
 fi


Cheers,

-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to