Bug 717002

Summary: ValueError: Cannot remove non-leaf device 'md1'
Product: Red Hat Enterprise Linux 6 Reporter: Orion Poplawski <orion>
Component: anacondaAssignee: David Lehman <dlehman>
Status: CLOSED NOTABUG QA Contact: Release Test Team <release-test-team>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.1CC: mganisin
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-13 21:09:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 756082    
Attachments:
Description Flags
anaconda tb xml
none
anaconda tb xml none

Description Orion Poplawski 2011-06-27 17:38:53 UTC
Created attachment 510127 [details]
anaconda tb xml

Description of problem:

If I install a machine with the following partitioning:

clearpart --drives=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:0:0,/dev/disk/by-path/pci-0000:00:1f.1-scsi-1:0:0:0
part raid.1 --size=200 --ondisk=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:0:0
part raid.2 --size=200 --ondisk=/dev/disk/by-path/pci-0000:00:1f.1-scsi-1:0:0:0
part raid.3 --size=17000 --grow --ondisk=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:0:0
part raid.4 --size=17000 --grow --ondisk=/dev/disk/by-path/pci-0000:00:1f.1-scsi-1:0:0:0
raid /boot --level=RAID1 --device=md0 raid.1 raid.2
raid pv.1 --level=RAID1 --device=md1 raid.3 raid.4
volgroup vg_root pv.1
logvol / --vgname=vg_root --size=2000 --name=root
logvol swap --fstype=swap --vgname=vg_root --size=2048 --name=swap
logvol /usr --vgname=vg_root --size=4000 --name=usr
logvol /var --vgname=vg_root --size=4000 --name=var
logvol /var/spool/mail --vgname=vg_root --size=3000 --name=mail
logvol /tftpboot --vgname=vg_root --size=1000 --name=tftpboot

When I attempt a re-install on this machine with the same partitioning, I get:

Traceback (most recent call first):
  File "/usr/lib/anaconda/storage/devicetree.py", line 745, in _removeDevice
    raise ValueError("Cannot remove non-leaf device '%s'" % dev.name)
  File "/usr/lib/anaconda/storage/devicetree.py", line 795, in registerAction
    self._removeDevice(d)
  File "/usr/lib/anaconda/storage/__init__.py", line 785, in createDevice
    self.devicetree.registerAction(ActionCreateDevice(device))
  File "/usr/lib/anaconda/kickstart.py", line 935, in execute
    storage.createDevice(request)
  File "/usr/lib/anaconda/kickstart.py", line 1149, in execute
    obj.execute(self.anaconda)
  File "/usr/bin/anaconda", line 1102, in &lt;module&gt;
    ksdata.execute()

Changing to:

clearpart --all --initlabel

allows the install to proceed, but I can't use this in production.

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

How reproducible:
Every time

Comment 2 David Cantrell 2011-07-19 13:57:40 UTC
Is this still happening on RHEL 6.1?

Comment 3 Orion Poplawski 2011-07-22 16:43:46 UTC
Created attachment 514737 [details]
anaconda tb xml

Still happens with 13.21.117

Comment 4 Orion Poplawski 2011-10-17 22:09:18 UTC
Any hope of this getting fixed by 6.2?

Comment 5 David Cantrell 2011-10-18 14:49:37 UTC
This one is slated for 6.3 planning.  We're too late for 6.2 work at this point.  Please try to reproduce the problem with 6.2 when it's available to you and update the bug with new findings or close it out if the problem has been resolved.

Comment 8 David Lehman 2012-01-31 14:20:45 UTC
Orion, are you aware that clearpart without either the --all or --linux option is the same as clearpart --none?

See https://fedoraproject.org/wiki/Anaconda/Kickstart#clearpart

Comment 9 David Lehman 2012-02-13 19:11:21 UTC
You are not clearing any partitions and your existing disk setup includes three md arrays, named md0, md1, and md2. You are specifying that your new md arrays be named md0 and md1, which is not possible since those names are already in use. You have several options, depending on what you are hoping to accomplish:

1. remove the --device= from your new arrays' "raid" commands in ks.cfg
2. specify a type in your clearpart command, eg: clearpart --linux
3. specify that your raid  partitions and arrays are preexisting by
   adding --onpart= for partitions and --useexisting for raid.

I don't see a bug in here anywhere. Please advise.

Comment 10 Orion Poplawski 2012-02-13 20:27:39 UTC
(In reply to comment #8)
> Orion, are you aware that clearpart without either the --all or --linux option
> is the same as clearpart --none?
> 
> See https://fedoraproject.org/wiki/Anaconda/Kickstart#clearpart

Nope, or at least I missed that here.  Sorry about that.  Adding --linux did the trick.  Thanks.

Comment 11 David Lehman 2012-02-13 21:09:37 UTC
Glad things are working for you now.