Bug 1103442
| Summary: | virt-convert fails to parse ovf file from virtualbox | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Community] Virtualization Tools | Reporter: | Jeff Peeler <jpeeler> | ||||
| Component: | virt-manager | Assignee: | Cole Robinson <crobinso> | ||||
| Status: | CLOSED UPSTREAM | QA Contact: | |||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | unspecified | CC: | acathrow, berrange, crobinso, gscrivan, jpeeler | ||||
| Target Milestone: | --- | Keywords: | Reopened | ||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2014-06-05 13:04:50 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: | |||||||
| Attachments: |
|
||||||
|
Description
Jeff Peeler
2014-05-31 15:23:51 UTC
Thanks for the report. Indeed there are a few issues here. Upstream should be fixed now if you'd like to confirm: git clone git://git.fedorahosted.org/virt-manager.git cd virt-manager ./virt-convert ... However --print-xml still may need to create some libvirt storage pools, since it needs to probe the source storage to determine what the resulting XML will look like. However, it won't actually convert the disk images or create the VM Please reopen if issues persist Sorry for the delay, but it's not quite working yet:
$ ./virt-convert -d ~/Downloads/SDN-VM.ovf --print-xml
[Tue, 03 Jun 2014 15:56:22 virt-convert 18134] DEBUG (cli:187) Launched with command line: ./virt-convert -d /home/jpeeler/Downloads/SDN-VM.ovf --print-xml
[Tue, 03 Jun 2014 15:56:22 virt-convert 18134] DEBUG (cli:195) Requesting libvirt URI default
[Tue, 03 Jun 2014 15:56:28 virt-convert 18134] DEBUG (cli:199) Received libvirt URI qemu:///session
[Tue, 03 Jun 2014 15:56:28 virt-convert 18134] DEBUG (formats:195) converter __init__ with input=/home/jpeeler/Downloads/SDN-VM.ovf parser=None
[Tue, 03 Jun 2014 15:56:28 virt-convert 18134] DEBUG (formats:203) converter not input_file=/home/jpeeler/Downloads/SDN-VM.ovf parser=<class 'virtconv.ovf.ovf_parser'>
[Tue, 03 Jun 2014 15:56:28 virt-convert 18134] DEBUG (ovf:384) Importing OVF XML:
<snipped XML output>
[Tue, 03 Jun 2014 15:56:28 virt-convert 18134] DEBUG (ovf:252) OS parsed as: id=None version=None vmware=None
[Tue, 03 Jun 2014 15:56:28 virt-convert 18134] DEBUG (diskbackend:144) Attempting to build pool=Downloads target=/home/jpeeler/Downloads
[Tue, 03 Jun 2014 15:56:28 virt-convert 18134] DEBUG (storage:464) Creating storage pool 'Downloads' with xml:
<pool type="dir">
<name>Downloads</name>
<uuid>286aef21-d814-49f1-8f05-4c9829f48f0b</uuid>
<target>
<path>/home/jpeeler/Downloads</path>
</target>
</pool>
[Tue, 03 Jun 2014 15:56:29 virt-convert 18134] DEBUG (cli:234) File "./virt-convert", line 134, in <module>
fail(main_e)
File "/home/jpeeler/src/virt-manager/virtinst/cli.py", line 234, in fail
logging.debug("".join(traceback.format_stack()))
[Tue, 03 Jun 2014 15:56:29 virt-convert 18134] ERROR (cli:235) 'virStoragePool' object has no attribute 'start'
[Tue, 03 Jun 2014 15:56:29 virt-convert 18134] DEBUG (cli:237)
Traceback (most recent call last):
File "./virt-convert", line 128, in <module>
sys.exit(main())
File "./virt-convert", line 108, in main
destdir=options.destination, dry=options.dry)
File "/home/jpeeler/src/virt-manager/virtconv/formats.py", line 301, in convert_disks
disk.path = newpath
File "/home/jpeeler/src/virt-manager/virtinst/devicedisk.py", line 527, in _set_path
self._change_backend(val, None)
File "/home/jpeeler/src/virt-manager/virtinst/devicedisk.py", line 716, in _change_backend
path, vol_object, None, None, None)
File "/home/jpeeler/src/virt-manager/virtinst/devicedisk.py", line 117, in _distill_storage
(vol_object, pool, path_is_pool) = diskbackend.manage_path(conn, path)
File "/home/jpeeler/src/virt-manager/virtinst/diskbackend.py", line 135, in manage_path
vol, pool, path_is_pool = check_if_path_managed(conn, path)
File "/home/jpeeler/src/virt-manager/virtinst/diskbackend.py", line 91, in check_if_path_managed
pool.start()
AttributeError: 'virStoragePool' object has no attribute 'start'
Thanks for testing. I pushed a commit fixing that, the API is actually pool.create(0). Can you try again? Assumes that ~/VirtualMachines exists. If I create the directory, it does finally generate the XML properly. However, I would assume that with --print-xml that nothing other than parsing the ovf file is done. Looking much better though now.
[Tue, 03 Jun 2014 16:34:56 virt-convert 19256] DEBUG (ovf:252) OS parsed as: id=None version=None vmware=None
[Tue, 03 Jun 2014 16:34:56 virt-convert 19256] DEBUG (cli:234) File "./virt-convert", line 134, in <module>
fail(main_e)
File "/home/jpeeler/src/virt-manager/virtinst/cli.py", line 234, in fail
logging.debug("".join(traceback.format_stack()))
[Tue, 03 Jun 2014 16:34:56 virt-convert 19256] ERROR (cli:235) cannot open path '/home/jpeeler/VirtualMachines': No such file or directory
[Tue, 03 Jun 2014 16:34:56 virt-convert 19256] DEBUG (cli:237)
Traceback (most recent call last):
File "./virt-convert", line 128, in <module>
sys.exit(main())
File "./virt-convert", line 108, in main
destdir=options.destination, dry=options.dry)
File "/home/jpeeler/src/virt-manager/virtconv/formats.py", line 301, in convert_disks
disk.path = newpath
File "/home/jpeeler/src/virt-manager/virtinst/devicedisk.py", line 527, in _set_path
self._change_backend(val, None)
File "/home/jpeeler/src/virt-manager/virtinst/devicedisk.py", line 716, in _change_backend
path, vol_object, None, None, None)
File "/home/jpeeler/src/virt-manager/virtinst/devicedisk.py", line 117, in _distill_storage
(vol_object, pool, path_is_pool) = diskbackend.manage_path(conn, path)
File "/home/jpeeler/src/virt-manager/virtinst/diskbackend.py", line 135, in manage_path
vol, pool, path_is_pool = check_if_path_managed(conn, path)
File "/home/jpeeler/src/virt-manager/virtinst/diskbackend.py", line 91, in check_if_path_managed
pool.create(0)
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 2521, in create
if ret == -1: raise libvirtError ('virStoragePoolCreate() failed', pool=self)
libvirtError: cannot open path '/home/jpeeler/VirtualMachines': No such file or directory
Yeah that last error is annoying but kind of hard to handle. The default virt-convert behavior wants to translate your disk images into a native format like qcow2 and move them to the preferred hypervisor location. To ensure we can do that, it asks libvirt to introspect the destination directory (VirtualMachines in this case). We could find a way to have --print-xml _not_ do that but it would likely make parts of the code really ugly since the assumption that we can probe an actual libvirt storage object is deeply engrained. You can do virt-convert --print-xml --disk-format none --destination `pwd` and it shouldn't complain. But regardless I don't think this is worth fixing for now, so just closing as UPSTREAM since the other issues are fixed. |