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 1141723 - virt-v2v: error: disk sda has no defined format shows when converting xen hvm guest
Summary: virt-v2v: error: disk sda has no defined format shows when converting xen hvm...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.1
Hardware: Unspecified
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: 2014-09-15 10:22 UTC by tingting zheng
Modified: 2015-03-05 13:44 UTC (History)
7 users (show)

Fixed In Version: libguestfs-1.27.47-1.1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 13:44:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Detailed log file (51.72 KB, text/plain)
2014-09-15 10:22 UTC, tingting zheng
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0303 0 normal SHIPPED_LIVE libguestfs bug fix and enhancement update 2015-03-05 17:34:44 UTC

Description tingting zheng 2014-09-15 10:22:58 UTC
Created attachment 937546 [details]
Detailed log file

Description
virt-v2v: error: disk sda has no defined format shows when converting xen hvm guest.

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 guest.

2.Use virt-v2v to convert guest from xen.
# virt-v2v -ic xen+ssh://10.66.106.64 -os default rhel6.6-i386-hvm
[   0.0] Opening the source -i libvirt -ic xen+ssh://10.66.106.64 rhel6.6-i386-hvm
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
virt-v2v: error: disk sda (json: { "file.driver" : "ssh", "file.path" :
"/var/lib/xen/images/rhel6.6-i386-hvm.img", "file.host" : "10.66.106.64",
"file.host_key_check" : "no" }) has no defined format, you have to either
define the original format in the source metadata, or use the '-of' option
to force the output format

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

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


# virsh dumpxml rhel6.6-i386-hvm
    <disk type='file' device='disk'>
      <driver name='file'/>
      <source file='/var/lib/xen/images/rhel6.6-i386-hvm.img'/>
      <target dev='hda' bus='ide'/>
    </disk>

 # qemu-img info rhel6.6-i386-hvm.img
   image: rhel6.6-i386-hvm.img
   file format: raw
   virtual size: 7.8G (8388608000 bytes)
   disk size: 7.8G

Actual results:
As described.

Expected results:
The default format of xen guest image is raw,virt-v2v can convert xen hvm guest successfully.

Additional info:
For xen pv guest,there is also no disk format defined in guest xml,bug xen pv guest can be converted successfully.
# virsh dumpxml xen-pv-rhel4.8-i386
    <disk type='file' device='disk'>
      <driver name='tap' type='aio'/>
      <source file='/var/lib/xen/images/xen/xen-pv/xen-pv-rhel4.8-i386.img'/>
      <target dev='xvda' bus='xen'/>
    </disk>

Comment 2 Richard W.M. Jones 2014-09-15 10:36:25 UTC
The error message is correct: the input  XML doesn't define the
disk format, and so we have to guess.

I have changed the error message to hopefully make it clearer.
In libguestfs >= 1.27.47 it will say instead:

  virt-v2v: error: disk sda (...) has no defined format.

  The input metadata did not define the disk format (eg. raw/qcow2/etc)
  of this disk, and so virt-v2v will try to autodetect the format when
  reading it.

  However because the input format was not defined, we do not know what
  output format you want to use.  You have two choices: either define
  the original format in the source metadata, or use the '-of' option
  to force the output format

https://github.com/libguestfs/libguestfs/commit/77b371b18b6a7ad37105a595931514f542a04396

(In reply to tingting zheng from comment #0)
> Additional info:
> For xen pv guest,there is also no disk format defined in guest xml,bug xen
> pv guest can be converted successfully.
> # virsh dumpxml xen-pv-rhel4.8-i386
>     <disk type='file' device='disk'>
>       <driver name='tap' type='aio'/>
>       <source file='/var/lib/xen/images/xen/xen-pv/xen-pv-rhel4.8-i386.img'/>
>       <target dev='xvda' bus='xen'/>
>     </disk>

Not true!  It's not very obvious, but "aio" == "raw" for bizarre
historical reasons.

I previously added a commit to virt-v2v which maps aio to raw:

https://github.com/libguestfs/libguestfs/commit/0c295c8e23a90d3a3f5efcfa0452ecde7317e122

Comment 4 tingting zheng 2014-09-17 05:08:06 UTC
Tested with:
libguestfs-1.27.47-1.1.el7.x86_64
virt-v2v-1.27.47-1.1.el7.x86_64

# virt-v2v -ic xen+ssh://10.66.106.64 -os default rhel6.6-i386-hvm
[   0.0] Opening the source -i libvirt -ic xen+ssh://10.66.106.64 rhel6.6-i386-hvm
[  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
virt-v2v: error: disk sda (json: { "file.driver" : "ssh", "file.path" : 
"/var/lib/xen/images/rhel6.6-i386-hvm.img", "file.host" : "10.66.106.64", 
"file.host_key_check" : "no" }) has no defined format.

The input metadata did not define the disk format (eg. raw/qcow2/etc) of 
this disk, and so virt-v2v will try to autodetect the format when reading 
it.

However because the input format was not defined, we do not know what 
output format you want to use.  You have two choices: either define the 
original format in the source metadata, or use the '-of' option to force 
the output format

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

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

The error info mentioned in comment 2 has showed,so move the bug to VERIFIED.

Comment 6 errata-xmlrpc 2015-03-05 13:44:50 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


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