LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] Heartbeat 2.0.8 issues, OCF_RESKEY_lvs_support undocumen

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] Heartbeat 2.0.8 issues, OCF_RESKEY_lvs_support undocumented, IPAddr broken
From: "Tomas Hoger" <tomas.hoger@xxxxxxxxx>
Date: Fri, 6 Jul 2007 10:47:52 +0200
On 7/6/07, Michael Stiller <ms@xxxxxxxxxx> wrote:
> - There is an option OCF_RESKEY_lvs_support
> in .../ocf/resource.d/heartbeat/IPaddr which is not really documented
> but needed for this kind of setup. Where is the place to configure this
> variable?

You can add it as attribute to load balanced IP address resource to
your cib.xml file either manually or using GUI client.  Something
like:

<nvpair id="lb_ip_lvs_support" name="lvs_support" value="true"/>


> - mentioned IPaddr is broken:
>
> lvs_restore_loopback()
>
>         netmask_text=`echo "$NICINFO" | cut -f2`
>         broadcast=`echo "$NICINFO" | cut -f3`
>
> cut without -d ' ' does not work here. Use awk w/print or fix the cut
> options. If i remember correctly, even the field numbers are wrong
> here.

There are few more issues in that script in LVS-related part.  Some
quoting issues.  I've created IPaddr_lvs to address those issues which
seems to work for me.  My patch, if you find it useful:

--- /usr/lib/ocf/resource.d/heartbeat/IPaddr    2007-01-21
20:32:47.000000000 +0100
+++ IPaddr_lvs  2007-06-12 11:38:01.000000000 +0200
@@ -79,8 +79,10 @@
 <longdesc lang="en">
 This script manages IP alias IP addresses
 It can add an IP alias, or remove one.
+
+Based on heartbeat's IPaddr, but it fixes LVS support.
 </longdesc>
-<shortdesc lang="en">Manages virtual IPv4 addresses</shortdesc>
+<shortdesc lang="en">Manages virtual IPv4 addresses (with LVS
support)</shortdesc>

 <parameters>
 <parameter name="ip" unique="1" required="1">
@@ -228,7 +230,7 @@
          ocf_log err "Could not save conflicting loopback $ifname." \
          "it will not be restored."
        fi
-       delete_interface "$ifname $ipaddr"
+       delete_interface "$ifname" "$ipaddr"

        # Forcibly remove the route (if it exists) to the loopback.
        delete_route "$ipaddr"
@@ -249,16 +251,16 @@
     ifname=`cat "$VLDIR/$ipaddr"`
     ocf_log info "Restoring loopback IP Address $ipaddr on $ifname."

-    NICINFO=`$FINDIF $ipaddr/32/$ifname`
+    NICINFO=`$FINDIF $ipaddr/32/${ifname%:*}`
     if [ $? -eq 0 ]; then
-       netmask_text=`echo "$NICINFO" | cut -f2`
-       broadcast=`echo "$NICINFO" | cut -f3`
+       netmask_text=`echo "$NICINFO" | $AWK '{ print $3 }'`
+       broadcast=`echo "$NICINFO" | $AWK '{ print $5 }'`
     else
        echo "ERROR: $IFCMD failed (rc=$rc)"
        exit $OCF_ERR_GENERIC
     fi

-    add_interface "$ipaddr" "$ifname" "$ifname" $netmask_text $broadcast
+    add_interface "$ipaddr" "${ifname%:*}" "$ifname" $netmask_text $broadcast
     rm -f "$VLDIR/$ipaddr"
 }


> This part:
>
> : ${OCF_RESKEY_lvs_support=0}
> # Normalize the value of lvs_support
> if [ "${OCF_RESKEY_lvs_support}" = "true" \
>     -o "${OCF_RESKEY_lvs_support}" = "on" ]; then
>     OCF_RESKEY_lvs_support=1
> else
>     OCF_RESKEY_lvs_support=0
> fi
>
> resets OCF_RESKEY_lvs_support to 0 if you try to enable this
> (undocumented) variable with =1 instead of true / on.

Looks like you have to set lvs_support to either "true" or "on", not
"1" in your heartbeat config.


However, this report should probably be sent (or cc-ed) to hearbeat
mailing list.

Btw: Have you configured ldirectord as OCF or LSB resource?  I've had
issues with using it as OCF and had to switch type to LSB.

th.


<Prev in Thread] Current Thread [Next in Thread>