Bug 1142004

Summary: virt-v2v prints warning:WARNING:/files/boot/grub/device.map references unknown device "xvda"
Product: Red Hat Enterprise Linux 7 Reporter: tingting zheng <tzheng>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: codong, dyuan, juzhou, mbooth, mzhan, ptoscano, rjones, tzheng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: V2V
Fixed In Version: libguestfs-1.27.48-1.1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 13:44:56 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:

Description tingting zheng 2014-09-16 01:46:48 UTC
Description
virt-v2v prints waring:WARNING:/files/boot/grub/device.map references unknown device "xvda"

Version:
libguestfs-1.27.43-1.1.el7.x86_64
virt-v2v-1.27.43-1.1.el7.x86_64
libvirt-1.2.8-2.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a xen hvm or pv guest.
Before conversion,check /boot/grub/device.map:
# cat /boot/grub/device.map
# this device map was generated by anaconda
(hd0)     /dev/xvda

2.Use virt-v2v to convert guest from xen,error shows:
virt-v2v: warning: /files/boot/grub/device.map/hd0 references unknown
device "xvda".  You may have to fix this entry manually after conversion.

# virt-v2v -ic xen+ssh://10.66.106.64 -os default xen-hvm-rhel6.4-x86_64 -of qcow2
[   0.0] Opening the source -i libvirt -ic xen+ssh://10.66.106.64 xen-hvm-rhel6.4-x86_64
libvirt: Remote Driver error : unknown procedure: 212
[  16.0] Creating an overlay to protect the source from being modified
[  30.0] Opening the overlay
[  52.0] Initializing the target -o libvirt -os default
[  52.0] Inspecting the overlay
[  58.0] Checking for sufficient free disk space in the guest
[  58.0] Converting Red Hat Enterprise Linux Server release 6.4 (Santiago) to run on KVM
virt-v2v: warning: /files/boot/grub/device.map/hd0 references unknown
device "xvda".  You may have to fix this entry manually after conversion.
[ 128.0] Mapping filesystem data to avoid copying unused and blank areas
[ 129.0] Closing the overlay
[ 129.0] Copying disk 1/1 to /var/lib/libvirt/images/xen-hvm-rhel6.4-x86_64-sda (qcow2)
    (100.00/100%)
[ 202.0] Creating output metadata
Pool default refreshed

Domain xen-hvm-rhel6.4-x86_64 defined from /tmp/v2vlibvirt884738.xml

[ 202.0] Finishing off

3.After conversion,check /boot/grub/device.map:
# cat /boot/grub/device.map
# this device map was generated by anaconda
(hd0)     /dev/xvda

Actual results:
As described.

Expected results:
Step 2:No such warning info shows.
Step 3:it should be /dev/vda instead of xvda.

Additional info:

Comment 2 Richard W.M. Jones 2014-09-16 07:41:14 UTC
There's a more recent version in errata tool, which should
also suppress this warning message:

libvirt: Remote Driver error : unknown procedure: 212

About this bug, can you get the libvirt XML for the guest, ie:

  virsh -c xen+ssh://10.66.106.64 dumpxml xen-hvm-rhel6.4-x86_64

Comment 3 tingting zheng 2014-09-16 07:46:01 UTC
(In reply to Richard W.M. Jones from comment #2)
> There's a more recent version in errata tool, which should
> also suppress this warning message:
> 
> libvirt: Remote Driver error : unknown procedure: 212
> 
> About this bug, can you get the libvirt XML for the guest, ie:
> 
>   virsh -c xen+ssh://10.66.106.64 dumpxml xen-hvm-rhel6.4-x86_64

# virsh -c xen+ssh://10.66.106.64 dumpxml xen-hvm-rhel6.4-x86_64
<domain type='xen'>
  <name>xen-hvm-rhel6.4-x86_64</name>
  <uuid>50b079fa-7928-9104-db8e-4aa6de8c27c3</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='xenfv'>hvm</type>
    <loader>/usr/lib/xen/boot/hvmloader</loader>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
    <disk type='file' device='disk'>
      <driver name='file'/>
      <source file='/var/lib/xen/images/xen/xen-hvm/xen-hvm-rhel6.4-x86_64.img'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <interface type='bridge'>
      <mac address='00:16:3e:84:5c:4c'/>
      <source bridge='xenbr0'/>
      <script path='vif-bridge'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/>
  </devices>
</domain>

Comment 4 Richard W.M. Jones 2014-09-16 15:28:58 UTC
Upstream fix:
https://github.com/libguestfs/libguestfs/commit/01b25d7fc6ea1dee80d104118436980b7d504af0

Will be in 1.27.47.

Comment 6 tingting zheng 2014-09-17 08:51:00 UTC
I tried to convert xen hvm and pv guests,no such warning shows.
However,I found that after conversion,check the file /boot/grub/device.map,
it shows as something like:

1.Converted xen-hvm-rhel6.4-x86_64 guest,the disk part in xml:
    <disk type='volume' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source pool='default' volume='xen-hvm-rhel6.4-x86_64-sda'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>

# cat /boot/grub/device.map
# this device map was generated by anaconda
(hd0)     /dev/sda

2.Converted xen-hvm-rhel4.8-i386 guest,the disk part in xml:
    <disk type='volume' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source pool='default' volume='xen-hvm-rhel4.8-i386-sda'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>

# cat /boot/grub/device.map
# this device map was generated by anaconda
(hd0)     /dev/hda

3.Converted rhel6.6-pv-x64-test guest,the disk part in xml:
    <disk type='volume' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source pool='default' volume='rhel6.6-pv-x64-test-sda'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>

# cat /boot/grub/device.map
# this device map was generated by anaconda
(hd0)     /dev/sda

For the above 3 guests,why the content in device.map is different,I think it should all be /dev/vda.

Comment 7 Richard W.M. Jones 2014-09-17 13:07:04 UTC
Fixed in:
https://github.com/libguestfs/libguestfs/commit/7739a6d3570efa2fee32b7210de40c73eca5b988

The fix will appear in virt-v2v >= 1.27.48.

Comment 8 tingting zheng 2014-09-18 05:59:45 UTC
Tested with:
# rpm -qa libguestfs virt-v2v
libguestfs-1.27.48-1.1.el7.x86_64
virt-v2v-1.27.48-1.1.el7.x86_64

Converted some xen hvm and pv guests,no warning info shows and after conversion,checked the below file:
# cat /boot/grub/device.map
# this device map was generated by anaconda
(hd0)     /dev/vda

Refer to the above comments,move the bug to VERIFIED.

Comment 10 errata-xmlrpc 2015-03-05 13:44:56 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.

https://rhn.redhat.com/errata/RHBA-2015-0303.html