Bug 702430

Summary: Regression: list-harddrives output not always processable by part command
Product: Red Hat Enterprise Linux 6 Reporter: Stephan Mueller <smueller>
Component: anacondaAssignee: Chris Lumens <clumens>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team>
Severity: high Docs Contact:
Priority: urgent    
Version: 6.1CC: borgan, cward, cww, dgregor, iboverma, jstodola, karen.skweres, sgrubb, snagar, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: anaconda-13.21.117-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 08:40:36 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 584498, 846801, 846802    

Description Stephan Mueller 2011-05-05 12:15:38 EDT
Description of problem:

To support formatting of the hard disk with kickstart, the list-harddrives command is used to obtain the list of devices. This list is later on used with the part kickstart command.

I use the following code to determine the partitioning 
destination which is present in a kickstart script (note, the listing is 
somewhat simplified):

DISKS_AVAILABLE="$(list-harddrives | cut -d' ' -f1)"
DISKS_INST=$(echo "$DISKS_AVAILABLE" | head -1)
clearpart --all --drives=$DISKS_INST
part $PVNAME --size=1 --grow --ondisk=$DISK_INST

For normal devices, that works, but for a cciss controller, list-harddrives procduces "c0d0" but part expects "cciss/c0d0". Therefore, the code above fails.

Version-Release number of selected component (if applicable):

6.1 RC

How reproducible:

See above

Expected results:

The device list output of list-harddrives should be parsable/understandable by the kickstart part command.

Additional info:

This functionality used to work in RHEL5
Comment 2 Chris Lumens 2011-05-05 12:50:42 EDT
Untested, but I believe this would work:

diff --git a/command-stubs/list-harddrives-stub b/command-stubs/list-harddrives-stub
index 4025186..25d9eb0 100755
--- a/command-stubs/list-harddrives-stub
+++ b/command-stubs/list-harddrives-stub
@@ -27,7 +27,8 @@ def main(argv):
     lst = set()
     for dev in filter(lambda d: d.type != parted.DEVICE_DM, parted.getAllDevices()):
-        lst.add((os.path.basename(dev.path), dev.getSize()))
+        path = dev.path.lstrip("/dev/")
+        lst.add((path, dev.getSize()))
     lst = list(lst)

In the installation environment, you'd apply that to the list-harddrives script.  It gets renamed during environment composition.
Comment 4 RHEL Product and Program Management 2011-05-05 15:29:39 EDT
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 12 Jan Stodola 2011-05-10 08:44:54 EDT
The change in RC4 (anaconda-13.21.116-1.el6) breaks 'list-harddrives' on s390x:

[anaconda root@rtt6 root]# list-harddrives 
asdb 2347.734375
asdc 2347.734375
asdd 2347.734375

With RC3 (anaconda-13.21.115-1.el6), results are OK:
[anaconda root@rtt6 root]# list-harddrives 
dasdb 2347.734375
dasdc 2347.734375
dasdd 2347.734375

Whole path of the devices:

Moving back to ASSIGNED.
Comment 13 Steve Grubb 2011-05-10 11:11:47 EDT
The S390x is also going through certification.
Comment 17 Jan Stodola 2011-05-11 07:30:34 EDT
Tested on build RHEL6.1-20110510.1 (RC5.1) with anaconda-13.21.117-1.el6.

On a system with a cciss controller:
sh-4.1# list-harddrives 
cciss/c0d0 114439.21875

on a x86_64 system with ordinary sda drive:
sh-4.1# list-harddrives 
sda 152627.835938

on s390x with one DASD drive:
[anaconda root@rtt6 root]# list-harddrives 
dasdb 9390.9375

x86_64 system running in kvm with one vda drive:
-bash-4.1# list-harddrives 
vda 26624.0

Also tested with a kickstart utilizing the list-harddrives command:

%include /partitioning

INSTALL_DEVICE="$(list-harddrives | cut -d' ' -f1 | head -n 1)"
echo "bootloader --location=mbr --driveorder=$INSTALL_DEVICE --append='console=ttyS0,115200 crashkernel=auto'" > /partitioning
echo "clearpart --all" >> partitioning
echo "part /boot --fstype=ext4 --size=500 --ondisk=$INSTALL_DEVICE" >> /partitioning
echo "part pv.104002 --grow --size=1 --ondisk=$INSTALL_DEVICE" >> /partitioning
echo "volgroup vg_hpbl460cg501 --pesize=4096 pv.104002" >> /partitioning
echo "logvol /home --fstype=ext4 --name=lv_home --vgname=vg_hpbl460cg501 --grow --size=100" >> /partitioning
echo "logvol / --fstype=ext4 --name=lv_root --vgname=vg_hpbl460cg501 --grow --size=1024 --maxsize=51200" >> /partitioning
echo "logvol swap --name=lv_swap --vgname=vg_hpbl460cg501 --grow --size=1024 --maxsize=10048" >> /partitioning

Moving to VERIFIED.
Comment 18 Karen Skweres 2011-05-16 13:34:18 EDT
HP verified by Mike Miller.
Comment 19 errata-xmlrpc 2011-05-19 08:40:36 EDT
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.