Bug 466614 - [NetApp 5.4 bug] Installer fails to select iscsi package automatically during SANboot installation on multipath device.
Summary: [NetApp 5.4 bug] Installer fails to select iscsi package automatically during...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: anaconda
Version: 5.2
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: 5.4
Assignee: Hans de Goede
QA Contact: Release Test Team
URL:
Whiteboard: netapp
Depends On:
Blocks: 461680 AnacondaStorage 483784
TreeView+ depends on / blocked
 
Reported: 2008-10-11 12:03 UTC by nandkumar mane
Modified: 2009-09-02 09:53 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-02 09:53:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
NetApp isys.py patch (907 bytes, patch)
2009-03-15 11:39 UTC, nandkumar mane
no flags Details | Diff
Netapp isys patch (873 bytes, patch)
2009-03-17 09:32 UTC, nandkumar mane
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1306 0 normal SHIPPED_LIVE anaconda bug fix and enhancement update 2009-09-01 10:20:11 UTC

Description nandkumar mane 2008-10-11 12:03:45 UTC
Description of problem:
During RHEL5.2 SANboot installation on multipathed device(root on multipath), installer doesn't choose iscsi package by default. One has to manually select iscsi package during installation. I tried using installation number provided by redhat, but still it didn't help me selecting iscsi package automatically.


Version-Release number of selected component (if applicable):
anaconda-11.1.2.113-1.x86_64.rpm
anaconda-runtime-11.1.2.113-1.x86_64.rpm
mkinitrd-5.1.19.6-28

How reproducible:
very reproducible

Steps to Reproduce:
1. Start RHEL5.2 installation using "linux mpath" parameter, so that multipath support will get enabled.
2. Follow installation procedure. Using advanced storage option login to the controller through more than one path, so that you will see multipathed device on host.
3. Install on multiapthed device using default packages.
  
Actual results:
System will hang on first reboot after installation, as iscsi package was not selected and installed.

Expected results:
iSCSI and multipath packages should be included in default packages when one is using "linux mpath" option.

Additional info:

Comment 1 Hans de Goede 2008-10-11 14:38:15 UTC
First of all, thanks for reporting this issue. I'm not very familiar with how multi-path works, but I'm pretty familiar with the anaconda iscsi code.

We decide if we need to install iscsi-initiator-utils with the following 2 pieces of code:

def driveIsIscsi(device):
    if not os.path.islink("/sys/block/%s/device" %(device,)):  
        return False
    target = os.path.realpath("/sys/block/%s/device" %(device,))
    if re.search("/platform/host[0-9]*/session[0-9]*/target[0-9]*:[0-9]*:[0-9]*/[0-9]*:[0-9]*:[0-9]*:[0-9]*", target) is not None:
        return True
    return False

        for disk in diskset.disks.keys():
            if isys.driveIsIscsi(disk):
                log.info("ensuring iscsi is installed")
                self.selectPackage("iscsi-initiator-utils")
                break


The loop calls driveIsIscsi() for all disks in our diskset, which are normally called something like sda, sdb, sdc, etc. Then driveIsIscsi() checks for the device link under /sys/block/sd#/device if its a link to a file with a full-path something like
/sys/devices/platform/host5/session1/target0:0:1/0:0:0:1

This is clearly not working in your case, could you please see which files there are under /sys/block/ on your system and where all there device links point?

Comment 2 nandkumar mane 2008-10-12 14:20:54 UTC
When we install on multipath device anaconda gets driveset.disks as [sda,mapper/mpath0], where sda is a local disk and mapper/mpath0 is a multipathed device on which we are installing root. driveIsIscsi just checks for basic devices(eg. sda,sdb), it doesn't have intelligence to handle multipath device(eg. mapper/mpath0).
Just to confirm if this solution works, I did following change in yuminstall.py and it works fine.

   def selectFSPackages(self, fsset, diskset):
        for entry in fsset.entries:
            map(self.selectPackage, entry.fsystem.getNeededPackages())

        for disk in diskset.disks.keys():
            if isys.driveIsIscsi(disk):
                log.info("ensuring iscsi is installed")
                self.selectPackage("iscsi-initiator-utils")
                break

        if diskset.__class__.mpList:
            log.info("Nandkumar : My  change for mpath")
            log.info("ensuring device-mapper-multipath is installed")
            self.selectPackage("device-mapper-multipath")
---->       log.info("ensuring iscsi is installed")
---->       self.selectPackage("iscsi-initiator-utils")

But the problem with this is everytime you install on multipathed device, iscsi package will get installed, even with fcp installation. There should some check to decide on if it is fcp or iscsi mutliatphed device.

SO we have to update driveIsIscsi function to handle mpath devices. I will come up with patch soon.

Comment 3 Andrius Benokraitis 2009-03-06 20:31:40 UTC
Hans - do you require any other info from NetApp on this issue?

Comment 4 Hans de Goede 2009-03-08 09:08:17 UTC
(In reply to comment #3)
> Hans - do you require any other info from NetApp on this issue?  

Yes, the last comment from nandkumar mane was:

(In reply to comment #2)

<snip>

> 
> SO we have to update driveIsIscsi function to handle mpath devices. I will come
> up with patch soon.  

I'm still waiting for said patch. Given that I do not have access to the relevant
hardware creating a fix for this myself is very hard to do.

Comment 5 nandkumar mane 2009-03-08 16:48:49 UTC
oops. Missed on this because of some other priorities. 
Anyways this is not specific to NetApp or any other controller. The problem here is that selectFSPackages doesn't include iscsi package if we are installing on multipathed device. Multipathed device can be on fc or iscsi or any other device. 
We need to modify code so that iscsi device will be installed only when multipathed device has underneath iscsi devices(and not when underneath devices are fc devices).

The sample code change I gave in comment #2 selects iscsi package without caring if underneath device is iscsi or fc. Need to improovise that.

Comment 6 Andrius Benokraitis 2009-03-09 17:39:41 UTC
NETAPP: If you have an exact patch to propose we'll review it -- I found out from the anaconda team that this issue will only get attention if all other prioritized items have been addressed.

Else, this will have to get deferred to 5.5. Let me know.

Comment 7 nandkumar mane 2009-03-10 12:01:55 UTC
Ok. I will be posting patch in a day or two.

Comment 8 nandkumar mane 2009-03-15 11:39:23 UTC
Created attachment 335253 [details]
NetApp isys.py patch

patch converts mpath device to dm device  and select iscsi package if root is on multipathed device.(SANboot).

Comment 9 Hans de Goede 2009-03-16 09:55:15 UTC
(In reply to comment #8)
> Created an attachment (id=335253) [details]
> NetApp isys.py patch
> 
> patch converts mpath device to dm device  and select iscsi package if root is
> on multipathed device.(SANboot).  

Thanks for the patch. It seems sane, I've asked a fellow anaconda team member to
also take a look at it. I will get back to you when I hear from him.

Comment 11 Peter Jones 2009-03-16 15:47:36 UTC
+def ConvertdmTOsd(minor):
+    slaves = []
+    slavepath = "/sys/block/dm-%d/slaves" % (minor,)
+    if os.path.isdir(slavepath):
+        slaves = os.listdir(slavepath)
+        return slaves
+    else:
+        return None

I'd rather see this named "convertDmToSd()", and have it always return a list (either empty or not).

Comment 13 RHEL Program Management 2009-03-16 18:38:33 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 14 nandkumar mane 2009-03-17 09:32:27 UTC
Created attachment 335494 [details]
Netapp isys patch

Thanks for the feedback. I have done changes in the patch as per anaconda naming convention. Now converDmToSd always returns list. List can be empty or not. Its been handled in calling function.

Comment 15 Hans de Goede 2009-03-17 10:43:13 UTC
Thank you!

Comment 17 Hans de Goede 2009-05-06 09:59:32 UTC
This is fixed in this commit:
http://git.fedorahosted.org/git/?p=anaconda.git;a=commitdiff;h=96ca66b6635dd613fd9a7c4b254572c0569c23e8

Which will be part of the upcoming anaconda-11.1.2.173-1 build.

Comment 20 Mark Goodwin 2009-05-15 00:25:25 UTC
IT #290972 is related, but this BZ for anaconda is not the whole fix, as per mchristie's comments in BZ #500273.

Comment 21 Chris Ward 2009-06-14 23:15:51 UTC
~~ Attention Partners RHEL 5.4 Partner Alpha Released! ~~

RHEL 5.4 Partner Alpha has been released on partners.redhat.com. There should
be a fix present that addresses this particular request. Please test and report back your results here, at your earliest convenience. Our Public Beta release is just around the corner!

If you encounter any issues, please set the bug back to the ASSIGNED state and
describe the issues you encountered. If you have verified the request functions as expected, please set your Partner ID in the Partner field above to indicate successful test results. Do not flip the bug status to VERIFIED. Further questions can be directed to your Red Hat Partner Manager. Thanks!

Comment 22 Tanvi 2009-06-24 09:21:56 UTC
I have tested it in RHEL5.4 Partner Alpha, the issue is fixed. iscsi package is getting installed by default in SANBoot scenario. Thank you.

Comment 24 errata-xmlrpc 2009-09-02 09:53:06 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1306.html


Note You need to log in before you can comment on or make changes to this bug.