RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1945835 - virt-p2v cannot detect nvme disks
Summary: virt-p2v cannot detect nvme disks
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: virt-p2v
Version: 9.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Laszlo Ersek
QA Contact: tingting zheng
URL:
Whiteboard:
Depends On: 2038105
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-02 08:09 UTC by nijin ashok
Modified: 2022-12-08 06:38 UTC (History)
10 users (show)

Fixed In Version: virt-p2v-1.42.2-1.1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-12-07 13:02:58 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
virt-p2v screen listing the NVMe disks (65.57 KB, image/png)
2022-03-24 13:50 UTC, Laszlo Ersek
no flags Details
virt-p2v screen showing conversion completion (99.74 KB, image/png)
2022-03-24 13:50 UTC, Laszlo Ersek
no flags Details
conversion log & other artifacts from the RHEL9 conversion server (347.85 KB, application/x-xz)
2022-03-24 13:53 UTC, Laszlo Ersek
no flags Details
conversion output domain XML (1.94 KB, application/xml)
2022-03-24 13:54 UTC, Laszlo Ersek
no flags Details
conversion artifacts with updated test case (495.51 KB, application/x-xz)
2022-03-25 17:05 UTC, Laszlo Ersek
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 6811511 0 None None None 2022-03-14 04:27:20 UTC

Description nijin ashok 2021-04-02 08:09:11 UTC
Description of problem:

The virt-p2v is not able to detect nvme disks and hence not able to convert the physical server attached to the nvme disk. When booted with virt-p2v-1.36.10-1.el7, it does show nvme disk in lsblk output. However, the p2v UI doesn't show the nvme disk under the disk selection window.

In virt-p2v-1.40.2, the disk is not visible in both UI and in lsblk output (probably because of bug 1670074).

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

virt-p2v-1.40.2

How reproducible:

Reproducible in the customer environment

Steps to Reproduce:

1. Boot a physical server with nvme disk using p2v ISO and check for the nvme disk in the "disk selection" window.

Actual results:

virt-p2v cannot detect nvme disks

Expected results:

virt-p2v should be able to convert physical server with nvme disk attached.

Additional info:

Comment 2 John Ferlan 2021-04-16 15:26:09 UTC
Jarda - sending your way as it seems this component used to be picked up by Pino... I suspect another for the backlog, but will let you decide...

Comment 4 John Ferlan 2021-12-20 13:34:29 UTC
Klaus - seems this was lost in Jarda's backlog. It's a virt-tools related component - I'll let you and Rich decide how to proceed.

Comment 5 Klaus Heinrich Kiwi 2021-12-20 13:46:18 UTC
(In reply to John Ferlan from comment #4)
> Klaus - seems this was lost in Jarda's backlog. It's a virt-tools related
> component - I'll let you and Rich decide how to proceed.

Thanks. Will park it in the Backlog until Rich is back and we can discuss, as this seems relatively important.

Comment 6 Klaus Heinrich Kiwi 2022-03-14 18:03:17 UTC
Let's bring this back. Assigning for Laszlo as he has been working on updating our P2V lately.

Since our current P2V iso is RHEL 7 based, I believe NVMe wasn't really a 'thing' back then, so hopefully this will all 'just work' once we have a newer P2V version, hopefully based on RHEL9?

Still, Laszlo, you might make this tentatively dependent on the RHEL9 P2V RFE.

Thanks,

 -Klaus

Comment 17 Laszlo Ersek 2022-03-21 15:16:51 UTC
Preparatory patch:

[p2v PATCH] build: remove gnulib
Message-Id: <20220321151618.22282-1-lersek>
https://listman.redhat.com/archives/libguestfs/2022-March/028444.html

Comment 18 Laszlo Ersek 2022-03-22 06:15:03 UTC
(In reply to Laszlo Ersek from comment #17)
> Preparatory patch:
> 
> [p2v PATCH] build: remove gnulib
> Message-Id: <20220321151618.22282-1-lersek>
> https://listman.redhat.com/archives/libguestfs/2022-March/028444.html

Commit 16c50a347801.

Comment 19 Richard W.M. Jones 2022-03-22 07:53:22 UTC
Moving to POST because there's a fix posted or upstream.

Note for readers: we don't yet have a way to deliver this fix to
customers, but we're working on that separately (bug 2038105).

Comment 20 Laszlo Ersek 2022-03-22 16:23:56 UTC
Apologies, I wasn't informative enough in my comment 18 -- there I had left this BZ in ASSIGNED status on purpose. Commit 16c50a347801 is a prep patch (gnulib removal); the actual work for recognizing NVMe block devices is still to be done, per comment 7 and comment 12.

My intent was to post two separate patches for this BZ (rather than a series), given that the gnulib removal could have required several iterations and a separate discussion, from the NVMe pattern addition. So I'm moving this back to ASSIGNED now; there's more upstream work for me to do here. Again I'm sorry for being unclear in comment 18!

Comment 21 Laszlo Ersek 2022-03-23 14:11:37 UTC
Some findings related to testing:

- libvirt does not support emulated NVMe devices, only assigned (= passthrough) ones, so the only option to test the nvme pattern is to run QEMU directly.

- in the QEMU tree, "docs/system/devices/nvme.rst" is helpful, regarding the command line params

- because my physical host is Fedora 35, the "virt-p2v.img" target attempts to build a fedora-35 based bootable image, with virt-builder. Unfortunately, the image is unbootable. The grub menu comes up, but once it loads the kernel / initrd, the guest is dead -- no logs (not even on serial), nothing

- attempting to check "virt-p2v.img" with guestfish, I even get:

><fs> list-filesystems 
/dev/sda1: unknown
/dev/sda2: xfs
/dev/sda3: xfs

which is inexplicable.

- inspired by commit 5ead90798eac ("tests: bump Fedora image to 32", 2020-07-03), which changed the "physical machine" image to F32, I modified Makefile.am to build a fedora-32 based bootable image as well:

@@ -296,7 +296,7 @@ virt-p2v.img: \
            p2v.service \
            virt-p2v \
            virt-p2v-make-disk
-       $(top_builddir)/run virt-p2v-make-disk -o $@
+       $(top_builddir)/run virt-p2v-make-disk -o $@ -v fedora-32
 
 # Tests.
 
Unfortunately, with this in place, the image is not even built, as it hangs in:

> [  17.7] Updating packages
> ...
> dnf --verbose -y --best upgrade

Same issue with "fedora-34".

(In a separate F34 VM, "dnf update" works OK.)

So ATM p2v is untestable to me.

Comment 22 Richard W.M. Jones 2022-03-23 17:20:41 UTC
(In reply to Laszlo Ersek from comment #21)
> - because my physical host is Fedora 35, the "virt-p2v.img" target attempts
> to build a fedora-35 based bootable image, with virt-builder. Unfortunately,
> the image is unbootable. The grub menu comes up, but once it loads the
> kernel / initrd, the guest is dead -- no logs (not even on serial), nothing

Mine actually tried to build a fedora-36 image because of my
half-Rawhide install!  Anyway I added a similar patch to you to
force it to use fedora-35 instead.  (Note I don't think fedora-32
will work because the Fedora mirrors won't still have the packages
needed to do the update).

The build does *appear* to hang at the dnf command, but actually
it's not hanging, it's just not telling you what it's doing.  The
reason is that the libguestfs protocol doesn't transmit the
messages from dnf until the command completes, which sucks but
there's not much we can do about it.  (The only continuous messages
you see from the libguestfs appliance are console messages, since
those are sent over a separate channel.  Since dnf doesn't print
any messages to the console, this doesn't apply).

Anyway, leaving it alone for about 10 minutes does complete the
fedora-35 image.

However it doesn't boot correctly.  It seems as if it's trying to
boot the guest instead of virt-p2v.  This used to work fine so I
wonder if something changed in qemu/firmware/command line?  I'll
keep plugging away to see if I can make it work.

This is my patch, but if you're on Fedora 35 already you shouldn't need this.
Although I suppose it can be useful to have a different version of the
guest vs virt-p2v, just so it's easy to tell which one is booting.

diff --git a/Makefile.am b/Makefile.am
index a5742b0..08357e1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -296,7 +296,7 @@ virt-p2v.img: \
            p2v.service \
            virt-p2v \
            virt-p2v-make-disk
-       $(top_builddir)/run virt-p2v-make-disk -o $@
+       $(top_builddir)/run virt-p2v-make-disk -o $@ -v fedora-35

Comment 23 Richard W.M. Jones 2022-03-23 17:22:36 UTC
Oh wait, the physical machine was F32 and virt-p2v was F35, so
it was trying to boot p2v.  Doesn't explain yet why it doesn't
boot ...

Comment 24 Richard W.M. Jones 2022-03-23 17:50:06 UTC
So several things are going on.  virt-builder (or more likely, dracut)
appears to have a bug where if you update the kernel in the image then
it will have a broken command line.  To observe this:

$ virt-builder fedora-35 --update 
$ qemu-system-x86_64 -machine accel=kvm:tcg -cpu host -m 2048 -drive file=fedora-35.img,format=raw,if=virtio

Interrupt grub, and go and look at the kernel command line of the
top (5.16) kernel and you'll see it's got stuff from the libguestfs
appliance, including a root= parameter that is definitely wrong.

The older kernel (part of the base image) is fine though, so you could
still boot by selecting that entry.

Anyhow back to virt-p2v - if you interrupt grub there and select the
older, working kernel then it boots up to the point where it tries to
mount the root filesystem off USB.  I added "ignore_loglevel
rd.plymouth=0 plymouth.enable=0" to try to print a bit more information about
what it's doing, but then things got really strange and I started to see actual
disk errors.  I wonder if the qemu USB mass storage emulation has bitrotted
because no one uses it?  It's a bit random, sometimes there are no
errors.

I'm working on the assumption that qemu USB boot has stopped working, or
dracut is missing some drivers.

Comment 25 Richard W.M. Jones 2022-03-23 18:30:09 UTC
https://listman.redhat.com/archives/libguestfs/2022-March/028468.html
https://listman.redhat.com/archives/libguestfs/2022-March/028469.html
https://listman.redhat.com/archives/libguestfs/2022-March/028470.html

With these patches, "make run-virt-p2v-in-a-vm" works fine and I was
able to run virt-p2v and complete a conversion successfully.

(Note these patches are required by but unrelated to fixing the current bug,
hence status should stay as ASSIGNED.)

Comment 26 Laszlo Ersek 2022-03-24 13:48:54 UTC
So the one-liner fix seems to work.

I modified the "run-virt-p2v-in-a-vm" makefile target in a separate patch, to test a "physical" machine with a system disk (as before) plus two NVMe disks (well, two namespaces of one NVMe device) that both map the blank disk image ("blank-part.img").

I've also set up a dedicated RHEL9 nightly VM for the "conversion server" role.

I'm going to attach some screenshots from the client side (where p2v ran), the conversion log (compressed) from the server side (the RHEL9 VM), and the output XML (also from the server side, from /var/tmp). The md5sums of the nvme-origianted disks on the destination match the blank image's md5sum on the source.

Comment 27 Laszlo Ersek 2022-03-24 13:50:04 UTC
Created attachment 1868129 [details]
virt-p2v screen listing the NVMe disks

Comment 28 Laszlo Ersek 2022-03-24 13:50:55 UTC
Created attachment 1868130 [details]
virt-p2v screen showing conversion completion

Comment 29 Laszlo Ersek 2022-03-24 13:53:04 UTC
Created attachment 1868131 [details]
conversion log & other artifacts from the RHEL9 conversion server

Comment 30 Laszlo Ersek 2022-03-24 13:54:19 UTC
Created attachment 1868132 [details]
conversion output domain XML

Comment 31 Laszlo Ersek 2022-03-24 13:59:22 UTC
Rich, assuming I have an "-o local" conversion output (p2v.xml and all
three disk images), how do I most easily import those on an existent
libvirtd host? I figure I should test booting the converted domain, and
see how the nvme disks (now exposed as virtio-block disks, vd*) look
"from the inside". Thanks!

Comment 32 Richard W.M. Jones 2022-03-24 17:09:01 UTC
(In reply to Laszlo Ersek from comment #31)
> Rich, assuming I have an "-o local" conversion output (p2v.xml and all
> three disk images), how do I most easily import those on an existent
> libvirtd host? I figure I should test booting the converted domain, and
> see how the nvme disks (now exposed as virtio-block disks, vd*) look
> "from the inside". Thanks!

-o local, like the one I did via p2v yesterday:

-rw-r--r--. 1 rjones rjones   6442450944 Mar 23 18:25  p2v-sda
-rw-r--r--. 1 rjones rjones         1650 Mar 23 18:25  p2v.xml

creates a disk image and libvirt XML.  You can just import that straight
into libvirt using "virsh create p2v.xml".  Running that either as non-root
or root will work, but note they will import the VM into separate
namespaces, and I think non-root may have some limitations (no network?)

Also note you can add --console to immediately start a virsh console
session with the new domain.  (Use virt-viewer to see the GUI)

Comment 33 Laszlo Ersek 2022-03-25 10:22:14 UTC
Thanks, I've read up on "virsh create" now -- I've never used it before. (Not surprisingly, as I've had no use for either transient domains, or one-off configurations of persistent domains.)

Comment 34 Richard W.M. Jones 2022-03-25 12:50:25 UTC
I should have mentioned that virsh define + virsh start is another way to do this.
I cannot remember the difference though - does one create a permanent guest and
the other create a transient guest?  Or maybe they're the same, but with more
steps.

Also virsh undefine removes the guest definition (permanently).

Comment 35 Laszlo Ersek 2022-03-25 17:05:37 UTC
Created attachment 1868348 [details]
conversion artifacts with updated test case

I've udpated the test case: not only does it add two NVMe namespaces (under an NVMe device), but it also exposes the "physical machine" disk image as another (separate) NVMe device. See the artifacts (logs, screenshots etc) attached.

Additionally, after the conversion, I imported the output domain into libvirtd, and booted it successfully. The blank disks have md5sums identical to the original blank disk.

Upstream patch set:

[p2v PATCH 0/2] recognize NVMe devices
Message-Id: <20220325170514.14431-1-lersek>
https://listman.redhat.com/archives/libguestfs/2022-March/028485.html

Comment 36 Laszlo Ersek 2022-03-28 14:41:47 UTC
(In reply to Laszlo Ersek from comment #35)

> Upstream patch set:
> 
> [p2v PATCH 0/2] recognize NVMe devices
> Message-Id: <20220325170514.14431-1-lersek>
> https://listman.redhat.com/archives/libguestfs/2022-March/028485.html

Commit range 307a346cebc8..c1a4bd83a8bb.

Moving to POST (refer to comment 19).

Comment 37 Laszlo Ersek 2022-08-05 14:32:37 UTC
Rich rebased virt-p2v for bug 1990052; with the same effort, we inherit the upstream fix for this issue too.

Comment 46 tingting zheng 2022-12-07 13:02:58 UTC
Tested with:
livecd-p2v-202211091434.iso
virt-v2v-2.0.7-6/7.el9.x86_64

Use virt-p2v to convert RHEL8/RHEL9/Win 2022 os installed in physical host with nvme disk, the nvme disk can be detected by virt-p2v and the conversion can be finished successfully.

Based on the comments, I close the bug.


Note You need to log in before you can comment on or make changes to this bug.