Bug 679073

Summary: kickstart processing should fail gracefully if trying to partition a device with no media in it.
Product: Red Hat Enterprise Linux 6 Reporter: Red Hat Case Diagnostics <case-diagnostics>
Component: anacondaAssignee: Ales Kozumplik <akozumpl>
Status: CLOSED ERRATA QA Contact: Martin Banas <mbanas>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: akozumpl, atodorov, jbastian, jzeleny, mbanas
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: anaconda_trace_hash:3b2267af1941118ac76281bcd99eeac49d4cc83323cd53050e77dceb7b463c1d
Fixed In Version: anaconda-13.21.119-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 10:30:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 705163    
Attachments:
Description Flags
File: backtrace
none
kickstart none

Description Red Hat Case Diagnostics 2011-02-21 13:57:10 UTC
The following was filed automatically by anaconda:
anaconda 13.21.82 exception report
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/text.py", line 657, in run
    anaconda.dispatch.gotoNext()
  File "/usr/bin/anaconda", line 1115, in <module>
    anaconda.intf.run(anaconda)
KeyError: '/dev/sda'

Comment 1 Red Hat Case Diagnostics 2011-02-21 13:57:35 UTC
Created attachment 479921 [details]
File: backtrace

Comment 4 Ales Kozumplik 2011-02-22 12:37:12 UTC
Reporter,

can you please attach the used kickstart file?

Thank you.

Comment 5 Muhammad Riyas vk 2011-02-23 05:53:56 UTC
Created attachment 480338 [details]
kickstart

Comment 6 Ales Kozumplik 2011-02-23 07:42:54 UTC
Muhammad,

The reason why the kickstart file from comment 5 doesn't work is that on the given computer /dev/sda is a "Virtual Floppy Device" according to the logs, with no media in it, so if you want to workaround this problem you need to change your kickstart so it doesn't try to partition /dev/sda.

I will keep this bug opened since Anaconda should be able to tell you about the KS problem in a clearer way than the traceback in comment 0. I'm proposing this for the 6.2 release as it's not a blocker.

Ales

Comment 7 David Cantrell 2011-02-23 19:18:34 UTC
*** Bug 677915 has been marked as a duplicate of this bug. ***

Comment 8 Jeff Bastian 2011-02-27 21:34:09 UTC
Anaconda also needs to fail gracefully for the error "new lv is too large to fit in free space" as shown in duplicate bug 677915

If a kickstart file creates a RAID partition using '--size=1 --grow' and then later builds an LVM logical volume on that with a larger size, Anaconda crashes and displays a Python traceback.

part raid.12 --asprimary --size=1 --grow --ondrive=vda
part raid.22 --asprimary --size=1 --grow --ondrive=vdb
raid pv.01 --fstype ext4 --device md1 --level=RAID1 raid.12 raid.22
volgroup vgdesktop pv.01
logvol / --vgname=vgdesktop --size=8192 --name=root

If you change the above to '--size=8196 --grow' on the RAID partitions (4 MiB larger than the final logvol), the installation works.

Comment 9 Ales Kozumplik 2011-02-28 07:04:46 UTC
I am not convinced that is a duplicate, will talk to David, we might need to reopen 677915.

Comment 12 Jeff Bastian 2011-03-02 16:39:20 UTC
Just a note: bug 677915 has been re-opened.

Comment 13 RHEL Program Management 2011-05-13 23:07:39 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 Ales Kozumplik 2011-06-20 12:43:42 UTC
I can reproduce this in a kvm machine with a virt cdrom and this line in the kickstart:

part / --fstype=ext4 --grow --asprimary --size=100 --ondisk=sr0

Comment 15 Ales Kozumplik 2011-06-22 06:42:26 UTC
Fixed on the rhel6 branch by 6a3e345092864f938c44ddb1d8430bf8fcd8c039.

Comment 17 Martin Banas 2011-10-19 11:13:56 UTC
Verified on:
RHEL6.2-Snapshot-2.0:
anaconda-13.21.144-1.el6
kernel-2.6.32-207.el6

Error message was: Cannot install to read-only media sr0.

Moving to VERIFIED.

Comment 18 errata-xmlrpc 2011-12-06 10:30:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1565.html