Bug 675322 - RHEL 6 anaconda generates invalid anaconda-ks.cfg when using multipath devices
Summary: RHEL 6 anaconda generates invalid anaconda-ks.cfg when using multipath devices
Keywords:
Status: CLOSED DUPLICATE of bug 696876
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: anaconda
Version: 6.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Ales Kozumplik
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks: GSS_6_2_PROPOSED 697582 705163
TreeView+ depends on / blocked
 
Reported: 2011-02-04 21:46 UTC by John Ruemker
Modified: 2018-11-26 19:29 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-06-07 13:58:47 UTC
Target Upstream Version:


Attachments (Terms of Use)
Kickstart files and console outputs (7.32 KB, application/x-compressed-tar)
2011-03-17 13:05 UTC, IBM Bug Proxy
no flags Details
Kickstart files and console outputs - RHEL6.1 Alpha (5.77 KB, application/x-compressed-tar)
2011-03-17 13:05 UTC, IBM Bug Proxy
no flags Details
Error message (1.40 KB, application/octet-stream)
2011-04-06 16:41 UTC, IBM Bug Proxy
no flags Details

Description John Ruemker 2011-02-04 21:46:27 UTC
Description of problem: The anaconda-ks.cfg produced by RHEL 6 anaconda contains invalid lines in the partitioning section when multipath devices are used.  Attempting to use this kickstart (by uncommenting the partitioning section) results in a failed installation.  The offending lines in the kickstart are:

  #clearpart --linux --drives=mpatha
  #ignoredisk --only-use=sdd,sde,sdc,sdb,mpatha

  #part  --onpart=mpathap1 --noformat
  #part /boot --fstype=ext4 --size=500


When uncommented, anaconda will throw an error:

-------
The following error was found while parsing the kickstart configuration file:

The following problem occurred on line 19 of the kickstart file:

Specified nonexistent disk mpatha in clearpart command
---------------------------------------

If you remove the mpatha reference from clearpart ('clearpart --all' or 'clearpart --drives=sdd,sde,sdc,sdb'), it now throws:

-------
The following error was found while parsing the kickstart configuration file:

The following problem occurred on line 20 of the kickstart file:

Specified nonexistent disk mpatha in ignoredisk command
---------------------------------------

If you remove mpatha from the ignoredisk line, it now throws: 

-------
The following error was found while parsing the kickstart configuration file:

The following problem occurred on line 22 of the kickstart file:

Mount point required for partition
---------------------------------------

The first part line (part  --onpart=mpathap1 --noformat) is missing a mountpoint, and seems to be redundant to the 2nd line (part /boot --fstype=ext4 --size=500).  However that 2nd line doesn't specify that it should be --ondisk=mpatha, so there's no guarantee it will work if you use it without modification.   


Version-Release number of selected component (if applicable): anaconda-13.21.82-1.el6


How reproducible: Always


Steps to Reproduce:
1. Choose to use Specialized Storage Devices
2. In the "Multipath Devices" tab, select your device
3. Installation type: Replace Existing Linux System(s)
4. Defaults for everything else
5. After installation, take /root/anaconda-ks.cfg and uncomment the partitioning lines
6. Boot into installer with ks=<your modified anaconda-ks.cfg>
  

Actual results: Installation fails with above messages


Expected results: The kickstart generated by the previous install should result in a complete, identical installation

Comment 1 Chris Lumens 2011-03-17 12:58:50 UTC
*** Bug 688443 has been marked as a duplicate of this bug. ***

Comment 2 IBM Bug Proxy 2011-03-17 13:05:26 UTC
Created attachment 486001 [details]
Kickstart files and console outputs

Comment 3 IBM Bug Proxy 2011-03-17 13:05:30 UTC
Created attachment 486002 [details]
Kickstart files and console outputs - RHEL6.1 Alpha

Comment 4 IBM Bug Proxy 2011-04-06 16:41:19 UTC
Created attachment 490338 [details]
Error message


------- Comment on attachment From anibalca@linux.vnet.ibm.com 2011-04-06 12:36 EDT-------


We added this line:

echo -e "defaults {\n  user_friendly_names yes\n}" > /etc/multipath.conf

to the %pre section of the kickstart file and then we got the same analog error message that we got when using sda (see attached file).

Comment 6 IBM Bug Proxy 2011-04-20 05:01:05 UTC
------- Comment From vahegde1@linux.vnet.ibm.com 2011-04-20 00:56 EDT-------
Hi Ales / Red Hat ,

Any update on this issue ? Will it be fixed in 6.1 cycle ?

Thanks
Vasant

Comment 7 Ales Kozumplik 2011-04-20 06:05:53 UTC
(In reply to comment #6)
> ------- Comment From vahegde1@linux.vnet.ibm.com 2011-04-20 00:56 EDT-------
> Hi Ales / Red Hat ,
> 
> Any update on this issue ? Will it be fixed in 6.1 cycle ?
> 
> Thanks
> Vasant

Hello,

this is scheduled for the 6.2 cycle.

Ales

Comment 8 IBM Bug Proxy 2011-05-04 15:20:32 UTC
------- Comment From rdc@linux.vnet.ibm.com 2011-05-04 11:15 EDT-------
Raising to ship issue since the bug prevents kickstart installations from being done on machines with multipath disks

Comment 11 John Ruemker 2011-05-23 20:27:35 UTC
Another customer reported problems with using multipath devices in kickstart with RHEL6, and so I had reason to dig deeper into this issue.  The problem, as noted in my original comments, is that clearpart/ignoredisk do not accept mpath* names.  This has larger implications than just the generated anaconda-ks.cfg not working, however.

Since ignoredisk and clearpart are the basis for what gets added to storage.exclusiveDisks, and thus what can be used in a 'part' command, there is no way (that I can come up with) to use kickstart and have any control over which multipath device is used for certain partitions.  If you specify mpath names in clearpart/ignoredisk, you will get an error (Specified nonexistent disk...).  If you only specify the underlying disks in ignoredisk/clearpart and attempt to use 'part --ondisk=mpathX ...' where mpathX is comprised of the devices you specified in ignoredisk/clearpart, you will get a traceback.  

Traceback (most recent call first):
  File "/usr/lib/anaconda/storage/partitioning.py", line 995, in allocatePartitions
    disklabel = disklabels[_disk.path]
  File "/usr/lib/anaconda/storage/partitioning.py", line 868, in doPartitioning
    allocatePartitions(storage, disks, partitions, free)
  File "/usr/lib/anaconda/storage/partitioning.py", line 227, in doAutoPartition
    exclusiveDisks=anaconda.id.storage.clearPartDisks)
  File "/usr/lib/anaconda/dispatch.py", line 208, in moveStep
    rc = stepFunc(self.anaconda)
  File "/usr/lib/anaconda/dispatch.py", line 126, in gotoNext
    self.moveStep()
  File "/usr/lib/anaconda/dispatch.py", line 231, in currentStep
    self.gotoNext()
  File "/usr/lib/anaconda/text.py", line 593, in run
    (step, instance) = anaconda.dispatch.currentStep()
  File "/usr/bin/anaconda", line 1115, in &lt;module&gt;
    anaconda.intf.run(anaconda)
KeyError: '/dev/mapper/mpatha'

You'll also get a traceback if you don't specify --ondisk, as anaconda will auto-select mpathX as the device to partition, ending up at the same result. 

This traceback is due to disklabels[] in allocatePartitions being empty, as a result of mpatha not being in exclusiveDisks:

    anaconda = storage.anaconda
    disks = storage.partitioned
    if exclusiveDisks:
        disks = [d for d in disks if d.name in exclusiveDisks]

    for disk in disks:
        disk.setup()
    [...]
    allocatePartitions(storage, disks, partitions, free)

So this lead to me investigating the underlying reasons for clearpart/ignoredisk not accepting mpath names.  ClearPart.parse() and IgnoreDisk.parse() are responsible for checking the listed devices to see if they exist, and these are set in motion by:

  File "/usr/bin/anaconda", line 818, in <module>
    ksdata = kickstart.parseKickstart(anaconda, opts.ksfile)

Its only after this call that we actually set up the device tree, which involves finding mpath devices:

  File "/us/bin/anaconda", line 1098, in <module>
    storage.storageInitialize(anaconda)

So, the reason we can't include mpath names in ignoredisk/clearpart is because anaconda is not yet aware of them at the time that we run *.parse.  Since changing the ordering of these calls around doesn't seem feasible, my idea for solving this was to simply add mpathX names to exclusiveDisks as we find them during storageInitialize.  That way you would specify your underlying disks ignoredisk/clearpart, and then just specify your mpath device in part commands.   Unfortunately my attempt at implementing this was unsuccessful.  However I wanted to share the above details of my analysis here in case it helps with finding a solution.

Thanks, and let me know if I can help in any way.

-John

Comment 12 Ales Kozumplik 2011-06-07 13:50:39 UTC
John,

there is a fix ready for bug 696876 which is this same issue from the other side, that is "anaconda does not recognize 'clearpart --linux --drives=mpatha' and similar".

I suggest we either 

1) close this as a dup
2) keep it open just for QA to verify they can install using the generated kickstart.

What do you think?

Comment 13 John Ruemker 2011-06-07 13:58:09 UTC
I'm fine with this being closed as a dupe.  

Thanks!

Comment 14 John Ruemker 2011-06-07 13:58:47 UTC

*** This bug has been marked as a duplicate of bug 696876 ***


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