Bug 816930

Summary: After Using virt-p2v to convert rhel5 on MD device,it will kernel panic
Product: Red Hat Enterprise Linux 6 Reporter: tingting zheng <tzheng>
Component: virt-p2vAssignee: Richard W.M. Jones <rjones>
Status: CLOSED WONTFIX QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 6.3CC: cwei, jwu, lnovich, mjenner, mzhan, rbalakri, syeghiay, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Converting a physical server running either Red Hat Enterprise Linux 4 or Red Hat Enterprise Linux 5 which has its file system root on an MD device is not supported. Converting such a guest results in a guest which fails to boot. Note that conversion of a Red Hat Enterprise Linux 6 server which has its root on an MD device is supported.
Story Points: ---
Clone Of:
: 852633 (view as bug list) Environment:
Last Closed: 2015-03-12 17:43:43 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:
Bug Depends On:    
Bug Blocks: 840699, 852633    
Attachments:
Description Flags
log file of rhel5 kernel panic on md device
none
screenshot of rhel5 kernel panic on md device
none
log file of rhel5 kernel panic on md device with LIBGUESTFS_DEBUG=1 none

Description tingting zheng 2012-04-27 10:28:56 UTC
Description of Problem:
After Using virt-p2v to convert rhel5 on MD device,it will kernel panic

Version-Release number of selected component:
virt-v2v-0.8.7-5.el6.x86_64
rubygem-virt-p2v-0.8.6-3.el6

How reproducible:
Always

Step to Reproduce:
1.Download the virt-p2v iso from brewweb.

2.Create MD device /dev/md0 with sda1 and sdb1.

3.Install rhel5 on md0.

4.Use virt-p2v to convert the host on md0 to libvirt or RHEV.

5.After conversion,boot the guest,it will kernel panic.

Actual Results:
The guest will kernel panic,details see the screenshot.

Expected Results:
The guest can be boot successfully.

Additional info:
1.Tried the test with physical machine installed rhel5 on MD device:first with a single regular kernel,second with both regular kernel and xen-kernel.
2.If I convert rhel5 with both regular kernel and xen-kernel,there will be info showed in virt-p2v-server-*.log:
Checked the log file,there is messages showed:Couldn't guess kernel version number from path for kernel /boot/xen.gz-2.6.18-303.el5 at /usr/share/perl5/vendor_perl/Sys/VirtConvert/Converter/RedHat.pm line 728, <> line 7.

Comment 1 tingting zheng 2012-04-27 10:31:22 UTC
Created attachment 580717 [details]
log file of rhel5 kernel panic on md device

Comment 3 tingting zheng 2012-04-27 10:32:43 UTC
Created attachment 580718 [details]
screenshot of rhel5 kernel panic on md device

Comment 4 Matthew Booth 2012-04-27 14:32:34 UTC
Please file a separate bug about the Xen kernel because we ought to handle that more gracefully. However, I don't think it's a high priority to fix it as presumably nobody will be actually doing P2V on a Xen server: it wouldn't work afterwards!

Comment 5 Matthew Booth 2012-04-27 14:41:09 UTC
Could you please capture trace output for the non-Xen kernel conversion:

Edit the virt-p2v-server executable.
Find the lines:
  #$ENV{'LIBGUESTFS_DEBUG'} = 1;
  #$ENV{'LIBGUESTFS_TRACE'} = 1;
Uncomment them both by removing the leading #.
Run the P2V conversion again.

Comment 6 tingting zheng 2012-04-28 02:41:09 UTC
(In reply to comment #4)
> Please file a separate bug about the Xen kernel because we ought to handle that
> more gracefully. However, I don't think it's a high priority to fix it as
> presumably nobody will be actually doing P2V on a Xen server: it wouldn't work
> afterwards!

I have filed another bug:Bug 817202 about using virt-p2v to convert physical machine installed xen.

Comment 7 tingting zheng 2012-04-28 08:06:56 UTC
Created attachment 580944 [details]
log file of rhel5 kernel panic on md device with LIBGUESTFS_DEBUG=1

As comment 5 says,enable LIBGUESTFS_TRACE and LIBGUESTFS_DEBUG,convert again,attached the log file.

Comment 8 RHEL Program Management 2012-05-03 05:04:57 UTC
Since RHEL 6.3 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 9 Matthew Booth 2012-05-03 15:38:21 UTC
I've managed to get to the bottom of this. The client doesn't boot because its initrd doesn't initialise md0. The reason for this is that mkinitrd doesn't detect it when it's run under libguestfs. Loosely, mkinitrd parses /etc/fstab and later expects device names to match the contents of /proc/mdstat. They don't because /proc/mdstat was created by the appliance, which didn't have access to the guest's mdadm.conf when it initialised md devices. mkinitrd also expects to be able to copy correctly named device entries from /dev, which also won't work because the devices aren't named as specific in the guest's mdadm.conf.

There's no simple solution to this problem, so I don't think we can get it into 6.3 at this late stage. I'll try to find a workaround, but workaround or not I think the best we can do for 6.3 is a tech note.

Comment 10 Matthew Booth 2012-05-04 16:00:59 UTC
I'd hoped that a workaround might be to replace a direct reference to the md device in fstab with a LABEL or UUID reference. Unfortunately this doesn't work, and I haven't been able to work out why. Specifically nash's nash-resolveDevice, used by mkinitrd, doesn't return a result for a LABEL or UUID on an md device.

For the moment, I think we can only document that this isn't supported.

Comment 11 Matthew Booth 2012-05-04 16:01:00 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Converting a physical server running either RHEL 4 or RHEL 5 which has its filesystem root on an MD device is not supported. Converting this guest will result in a guest which does not boot.

Note that conversion of a RHEL 6 server which has its root on an MD device is supported.

Comment 12 Martin Prpič 2012-05-07 09:01:48 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,3 +1 @@
-Converting a physical server running either RHEL 4 or RHEL 5 which has its filesystem root on an MD device is not supported. Converting this guest will result in a guest which does not boot.
+Converting a physical server running either Red Hat Enterprise Linux 4 or Red Hat Enterprise Linux 5 which has its file system root on an MD device is not supported. Converting such a guest results in a guest which fails to boot. Note that conversion of a Red Hat Enterprise Linux 6 server which has its root on an MD device is supported.-
-Note that conversion of a RHEL 6 server which has its root on an MD device is supported.

Comment 13 Laura Novich 2012-10-24 12:11:33 UTC
Added notes to the relevant chapter
As soon as it is built, will send to QA

Comment 14 RHEL Program Management 2012-12-14 07:32:45 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 16 Richard W.M. Jones 2015-03-12 17:43:43 UTC
I'm closing this bug:

 - virt-p2v has been rewritten for RHEL 7.2

 - Unofficial previews of the new version are available:
   http://oirase.annexia.org/virt-p2v/

 - If a similar bug occurs with the new version of virt-p2v,
   please open a new bug against Red Hat Enterprise Linux 7 / libguestfs