Bug 883736

Summary: [anaconda regression] kpartx failed to create the partitions based on mpath disk
Product: Red Hat Enterprise Linux 7 Reporter: Xiaowei Li <xiaoli>
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED DUPLICATE QA Contact: Release Test Team <release-test-team-automation>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.0CC: dlehman, qcai
Target Milestone: betaKeywords: TestBlocker
Target Release: 7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: test blocker
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-10 15:33:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
program.log none

Description Xiaowei Li 2012-12-05 07:51:04 UTC
Description of problem:
It's a regression issues. anaconda uses 'kpartx -a -s' to create the partitions. If the disk is multipathed and the partitions are created by 'multipath' this command will fail.

I have checked the anaconda git, found this check-in. 
http://git.fedorahosted.org/cgit/anaconda.git/commit/?id=3f0a1f9668f42dabe5ec728a76347e25cdc551d7

I tested both 'kpartx -a -s' and the previous invoke 'kpartx -a -p p'. 
If the partitions are created, the 'kpartx -a -s' will try to create mpatha1 and fail. But the previous invoke will exit gracefully.

So at least for the mpath disk, we should still use 'kpartx -a -p p -s' to create the partitions. 

[anaconda root@localhost ~]# multipath -ll
mpatha (360a98000572d574a4e6f63706772594b) dm-1 NETAPP  ,LUN             
size=30G features='3 pg_init_retries 50 retain_attached_hw_handler' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=25 status=active
| |- 0:0:1:0 sdc 8:32 active ready running

| `- 4:0:1:0 sdd 8:48 active ready running
`-+- policy='service-time 0' prio=5 status=enabled
  |- 0:0:0:0 sda 8:0  active ready running
  `- 4:0:0:0 sdb 8:16 active ready running
[anaconda root@localhost ~]# ls /dev/mapper/
control  live-rw  mpatha  mpathap1  mpathap2
[anaconda root@localhost ~]# kpartx -a -s /dev/mapper/mpatha
device-mapper: create ioctl on mpatha1 failed: Device or resource busy
create/reload failed on mpatha1
device-mapper: create ioctl on mpatha2 failed: Device or resource busy
create/reload failed on mpatha2
[anaconda root@localhost ~]# kpartx -a -s -p p /dev/mapper/mpatha
[anaconda root@localhost ~]# echo $?
0


please have a quick look. It's blocking our san boot testing.

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


How reproducible:
100%

Steps to Reproduce:
1.
2.
3.
  
Actual results:
02:16:32,477 INFO program: Running... udevadm settle --timeout=300
02:16:32,495 INFO program: Running... multipath mpatha
02:16:32,605 INFO program: create: mpatha (360a98000572d574a4e6f63706772594b) undef NETAPP  ,LUN             
02:16:32,606 INFO program: size=30G features='2 pg_init_retries 50' hwhandler='0' wp=undef
02:16:32,606 INFO program: |-+- policy='service-time 0' prio=25 status=undef
02:16:32,606 INFO program: | |- 0:0:1:0 sdc 8:32 undef ready running
02:16:32,606 INFO program: | `- 4:0:1:0 sdd 8:48 undef ready running
02:16:32,607 INFO program: `-+- policy='service-time 0' prio=5 status=undef
02:16:32,607 INFO program:   |- 0:0:0:0 sda 8:0  undef ready running
02:16:32,607 INFO program:   `- 4:0:0:0 sdb 8:16 undef ready running
02:16:32,627 INFO program: Running... udevadm settle --timeout=300
02:16:32,730 INFO program: Running... kpartx -a -s /dev/mapper/mpatha
02:16:32,745 ERR program: device-mapper: create ioctl on mpatha1 failed: Device or resource busy
02:16:32,746 ERR program: create/reload failed on mpatha1
02:16:32,747 ERR program: device-mapper: create ioctl on mpatha2 failed: Device or resource busy
02:16:32,748 ERR program: create/reload failed on mpatha2


Expected results:


Additional info:

Comment 1 Xiaowei Li 2012-12-05 08:03:10 UTC
Created attachment 658045 [details]
program.log

Comment 2 Xiaowei Li 2012-12-05 08:16:48 UTC
The workaround is to wipe out the partition table using fdisk or dd.

Comment 3 David Lehman 2012-12-05 18:06:58 UTC
This is the same as bug 880263. Good job identifying the kpartx -p change as the trigger.

Comment 4 David Cantrell 2012-12-05 19:44:43 UTC

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

Comment 5 Xiaowei Li 2012-12-10 04:30:46 UTC
(In reply to comment #4)
> 
> *** This bug has been marked as a duplicate of bug 880263 ***

I still saw this issue with the tree RHEL-7.0-20121206.n.1

Could you tell me which tree or anaconda version will include this fix?

I re-open it to track this issue from Storage-QE side since it's blocking our SAN boot testing.

Comment 6 Chris Lumens 2012-12-10 15:33:35 UTC
You need a tree constructed with lorax-18.23-1.  We don't know what tree that is, because we're not rel-eng.  Please don't undupe bugs unless you are adding information indicating the two bugs are not related.  It just makes a mess of things.

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