Bug 1032114

Summary: ip.sh: prefer_interface parameter not honored
Product: Red Hat Enterprise Linux 6 Reporter: michal novacek <mnovacek>
Component: resource-agentsAssignee: David Vossel <dvossel>
Status: CLOSED NOTABUG QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.5CC: agk, cluster-maint, fdinitto, mnovacek
Target Milestone: rcKeywords: EasyFix
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-26 15:07:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description michal novacek 2013-11-19 15:11:44 UTC
Description of problem: 
Cannot add valid ipv6 address to specific interface defined by prefer_interface parameter.

Version-Release number of selected component (if applicable):
resource-agents-3.9.2-40.el6.x86_64

How reproducible: always

Steps to Reproduce:
$ ccs -h localhost --addresource ip address="feed::1800:ff:fe00:42/64" \
prefer_interface="eth0" sleeptime="10
$ ccs -h localhost --addservice vipv6 recovery="relocate" domain="le-domain"
$ ccs -h localhost --addsubservice vipv6 ip ref="feed::1800:ff:fe00:42/64"
$ cman_tool version -r 
$ clustat -e vipv6

Actual results: resource failed, ipv6 not added

Expected results: resource started, ipv6 added to eth0 interface

Additional info:
This is what xml help inside ip.sh says:
<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>

$ ccs -h localhost --lsservices
service: name=le-ipv6, recovery=relocate
  ip: ref=feed::1800:ff:fe00:42/64
resources: 
  ip: sleeptime=10, prefer_interface=eth0, address=feed::1800:ff:fe00:42/64
$ tail /etc/cluster/cluster.conf 
<rm>
    <resources>
        <clusterfs device="/dev/STSRHTS2638/gfsnfs0" \
            force_unmount="1" fsid="46767" fstype="gfs2" \
            mountpoint="/exports/1" name="gfs2-mount"/>
        <ip address="feed::1800:ff:fe00:42/64"\
            prefer_interface="eth0" sleeptime="10"/>
    </resources>
    <service name="le-ipv6" recovery="relocate">
        <ip ref="feed::1800:ff:fe00:42/64"/>
    </service>
</rm>
</cluster>
$ clusvcadm -e le-ipv6
Local machine trying to enable service:le-ipv6...Failure

$ tail /var/log/cluster.conf
...
Nov 19 15:48:04 virt-066 rgmanager[2403]: Starting disabled service service:le-ipv6
Nov 19 15:48:04 virt-066 rgmanager[2403]: start on ip "feed::1800:ff:fe00:42/64" returned 1 (generic error)
Nov 19 15:48:04 virt-066 rgmanager[2403]: #68: Failed to start service:le-ipv6; return value: 1
Nov 19 15:48:04 virt-066 rgmanager[2403]: Stopping service service:le-ipv6
Nov 19 15:48:04 virt-066 rgmanager[2403]: Service service:le-ipv6 is recovering
Nov 19 15:48:04 virt-066 rgmanager[2403]: #71: Relocating failed service service:le-ipv6
Nov 19 15:48:05 virt-066 rgmanager[2403]: Service service:le-ipv6 is stopped

$ ip -6 a show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 2620:52:0:2246:1800:ff:fe00:42/64 scope global deprecated dynamic 
       valid_lft 2591864sec preferred_lft 0sec
    inet6 fe80::1800:ff:fe00:42/64 scope link 
       valid_lft forever preferred_lft forever

$ export OCF_RESKEY_address='feed::1800:ff:fe00:42/64' 
$ export OCF_RESKEY_prefer_interface='eth0' 

$ /usr/share/cluster/ip.sh start 

$ echo $?
1

$ /usr/share/cluster/ip.sh status
<debug>  Checking feed::1800:ff:fe00:42/64, Level 0
[ip.sh] Checking feed::1800:ff:fe00:42/64, Level 0
<warn>   feed::1800:ff:fe00:42/64 is not configured
[ip.sh] feed::1800:ff:fe00:42/64 is not configured

$ ip a a feed::1800:ff:fe00:42/64 dev eth0

$ ip -6 a show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 2620:52:0:2246:1800:ff:fe00:42/64 scope global deprecated dynamic 
       valid_lft 2591775sec preferred_lft 0sec
    inet6 feed::1800:ff:fe00:42/64 scope site 
       valid_lft forever preferred_lft forever
    inet6 fe80::1800:ff:fe00:42/64 scope link 
       valid_lft forever preferred_lft forever

Comment 2 RHEL Program Management 2013-11-22 17:24:42 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 4 David Vossel 2014-05-12 21:39:43 UTC
Michal,

I don't believe I'd expect this test to work. For IPv4 or IPv6 addresses to be managed by the cluster, the floating IP requires that a network device to be available with an address already assigned within the floating IP addresses subnet.

For example, this works:

# ip addr add 2001:db8:1234::1/64 dev eth0

# export OCF_RESKEY_name=myip OCF_RESKEY_address="2001:db8:1234::2/64"  OCF_RESKEY_prefer_interface='eth0' OCF_RESKEY_family=inet6

#./ip.sh start
<debug>  Link for eth0: Detected
<info>   Adding IPv6 address 2001:db8:1234::2/64 to eth0
<debug>  Pinging addr 2001:db8:1234::2 from dev eth0

but when I do this, ip.sh won't detect that eth0 is a valid device for the ip.

# ip addr del 2001:db8:1234::1/64 dev eth0
# ./ip.sh start
# echo $?
1


I believe we can close this as "not a bug". Do you agree?

-- Vossel

Comment 5 michal novacek 2014-05-26 15:07:11 UTC
Yes, it makes sense that you need another address already in that range. 

Closing as "NOTABUG".