Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1232192 - Virt-v2v gives an error on a blank disk: part_get_parttype: unknown signature, of the output: BYT;
Summary: Virt-v2v gives an error on a blank disk: part_get_parttype: unknown signature...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.2
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard: V2V
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-16 09:21 UTC by zhoujunqin
Modified: 2015-11-19 07:01 UTC (History)
4 users (show)

Fixed In Version: libguestfs-1.28.1-1.39.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 07:01:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
virt-v2v debug info (85.95 KB, text/plain)
2015-06-16 09:21 UTC, zhoujunqin
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2183 0 normal SHIPPED_LIVE libguestfs bug fix and enhancement update 2015-11-19 08:18:42 UTC

Description zhoujunqin 2015-06-16 09:21:49 UTC
Created attachment 1039343 [details]
virt-v2v debug info

Description of problem:
Virt-v2v failed to convert Esx guest with 2 disks configured

Version-Release number of selected component (if applicable):
libvirt-1.2.16-1.el7.x86_64
libguestfs-1.28.1-1.38.el7.x86_64
virt-v2v-1.28.1-1.38.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a health guest on Esx server, and add another hard disk for it:

# virsh -c  vpx://root.72.112/data/10.66.72.49/?no_verify=1 dumpxml test-juzhou
Enter root's password for 10.66.72.112:
...
    <disk type='file' device='disk'>
      <source file='[datastore1] test-juzhou/test-juzhou.vmdk'/>
      <target dev='sda' bus='scsi'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='disk'>
      <source file='[datastore1] test-juzhou/test-juzhou_1.vmdk'/>
      <target dev='sdb' bus='scsi'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
...

2. Use virt-v2v convert this guest to local kvm host:

# virt-v2v -ic  vpx://root.72.112/data/10.66.72.49/?no_verify=1 test-juzhou  --password-file /tmp/passwd2  
[   0.0] Opening the source -i libvirt -ic vpx://root.72.112/data/10.66.72.49/?no_verify=1 test-juzhou
[   1.0] Creating an overlay to protect the source from being modified
[   2.0] Opening the overlay
[ 201.0] Initializing the target -o libvirt -os default
[ 201.0] Inspecting the overlay
virt-v2v: error: libguestfs error: part_get_parttype: unknown signature,
                              of the output:
BYT;                                        

If reporting bugs, run virt-v2v with debugging enabled and include the
complete output:

  virt-v2v -v -x [...]


Actual results:
Convert guest failed as above.

Expected results:
Can convert guest to local kvm successfully.

Additional info:
I will attach virt-v2v debug info.

Comment 2 Richard W.M. Jones 2015-06-16 10:11:35 UTC
The bug is that virt-v2v chokes on a blank disk.  Here's an
easier way to reproduce it that doesn't require root or VMware:

$ virt-builder centos-6
$ rm -f blank.img
$ truncate -s 1G blank.img

Put the following XML into a file called 'test.xml':

<domain type='kvm'>
  <name>test</name>
  <memory>1048576</memory>
  <vcpu>2</vcpu>
  <os>
    <type>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <devices>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='centos-6.img'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='blank.img'/>
      <target dev='hdb' bus='ide'/>
    </disk>
    <interface type='network'>
      <mac address='52:54:00:01:02:03'/>
      <source network='default'/>
      <model type='rtl8139'/>
    </interface>
  </devices>
</domain>

Then run virt-v2v:

$ virt-v2v -i libvirtxml test.xml -o null
[   0.0] Opening the source -i libvirtxml test.xml
[   0.0] Creating an overlay to protect the source from being modified
[   0.6] Opening the overlay
[  11.7] Initializing the target -o null
[  11.7] Inspecting the overlay
virt-v2v: error: libguestfs error: part_get_parttype: unknown signature, 
                              of the output: 
BYT;                                        

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

Comment 3 Richard W.M. Jones 2015-06-16 10:56:02 UTC
The reason the error message is oddly corrupted, is because of
a further and unrelated bug in parted.  I filed that separately
(bug 1232241).

Comment 6 zhoujunqin 2015-06-26 07:20:05 UTC
I can reproduce this issue with old package in a simple way:

virt-v2v-1.28.1-1.38.el7.x86_64
libguestfs-1.28.1-1.38.el7.x86_64
libvirt-1.2.16-1.el7.x86_64

Steps to reproduce:

1. On you local host, there is a health guest.
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     rhel6.7-snap5-clone1           shut off

2. Create a empty disk and add it to this guest.
# truncate -s 1G  /tmp/blank.img
# virsh dumpxml rhel6.7-snap5-clone1
...
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/rhel6.7-snap5-clone1.img'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/tmp/blank.img'/>
      <target dev='vdb' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </disk>
...

3. Save guest xml file then undefine guest.
# virsh dumpxml rhel6.7-snap5-clone1 >rhel6.7-snap5-clone1.xml
# virsh undefine rhel6.7-snap5-clone1 

4. Run virt-v2v cmd:
# virt-v2v -i libvirtxml rhel6.7-snap5-clone1.xml -o null
[   0.0] Opening the source -i libvirtxml rhel6.7-snap5-clone1.xml
[   0.0] Creating an overlay to protect the source from being modified
[   1.0] Opening the overlay
[ 163.0] Initializing the target -o null
[ 163.0] Inspecting the overlay
virt-v2v: error: libguestfs error: part_get_parttype: unknown signature, 
                              of the output: 
BYT;                                        

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]


Then try to verify this bug with new build:
virt-v2v-1.28.1-1.40.el7.x86_64
libguestfs-1.28.1-1.40.el7.x86_64
libvirt-1.2.16-1.el7.x86_64

Steps as above:
1. 
# virt-v2v -i libvirtxml rhel6.7-snap5-clone1.xml -o null
[   0.0] Opening the source -i libvirtxml rhel6.7-snap5-clone1.xml
[   0.0] Creating an overlay to protect the source from being modified
[   0.0] Opening the overlay
[ 107.0] Initializing the target -o null
[ 107.0] Inspecting the overlay
[ 118.0] Checking for sufficient free disk space in the guest
[ 118.0] Estimating space required on target for each disk
[ 118.0] Converting Red Hat Enterprise Linux Server release 6.7 Beta (Santiago) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 161.0] Mapping filesystem data to avoid copying unused and blank areas
[ 161.0] Closing the overlay
[ 161.0] Copying disk 1/2 to /var/tmp/null.tp85vi/sda (raw)
    (100.00/100%)
[ 235.0] Copying disk 2/2 to /var/tmp/null.tp85vi/sdb (raw)
    (100.00/100%)
[ 237.0] Creating output metadata
[ 237.0] Finishing off

2. Always test again with guest on Comment 0:
# virt-v2v -ic  vpx://root.72.112/data/10.66.72.49/?no_verify=1 test-juzhou  --password-file /tmp/passwd2   
[   0.0] Opening the source -i libvirt -ic vpx://root.72.112/data/10.66.72.49/?no_verify=1 test-juzhou
[   1.0] Creating an overlay to protect the source from being modified
[   2.0] Opening the overlay
[ 106.0] Initializing the target -o libvirt -os default
[ 106.0] Inspecting the overlay
[ 163.0] Checking for sufficient free disk space in the guest
[ 163.0] Estimating space required on target for each disk
[ 163.0] Converting Red Hat Enterprise Linux Server release 6.6 (Santiago) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 530.0] Mapping filesystem data to avoid copying unused and blank areas
[ 532.0] Closing the overlay
[ 532.0] Copying disk 1/2 to /var/lib/libvirt/images/test-juzhou-sda (raw)
    (100.00/100%)
[ 598.0] Copying disk 2/2 to /var/lib/libvirt/images/test-juzhou-sdb (raw)
    (100.00/100%)
[ 618.0] Creating output metadata
Pool default refreshed

Domain test-juzhou defined from /tmp/v2vlibvirt03b511.xml

[ 620.0] Finishing off

Since virt-v2v can convert guest with no error, move this bug from ON_QA  to VERIFIED.

Comment 8 errata-xmlrpc 2015-11-19 07:01:55 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-2183.html


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