Bug 1103442 - virt-convert fails to parse ovf file from virtualbox
Summary: virt-convert fails to parse ovf file from virtualbox
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: virt-manager
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Cole Robinson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-31 15:23 UTC by Jeff Peeler
Modified: 2014-06-05 13:04 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-06-05 13:04:50 UTC
Embargoed:


Attachments (Terms of Use)
ovf file (12.96 KB, text/plain)
2014-05-31 15:23 UTC, Jeff Peeler
no flags Details

Description Jeff Peeler 2014-05-31 15:23:51 UTC
Created attachment 901090 [details]
ovf file

Description of problem:
The man page seems to indicate what I'm attempting is valid. I've attached the ovf file and here's the debug output:

[Sat, 31 May 2014 10:51:45 virt-convert 13264] DEBUG (cli:187) Launched with command line: /usr/share/virt-manager/virt-convert -d SDN-VM.ovf --print-xml
[Sat, 31 May 2014 10:51:45 virt-convert 13264] DEBUG (cli:195) Requesting libvirt URI default
[Sat, 31 May 2014 10:51:50 virt-convert 13264] DEBUG (cli:199) Received libvirt URI qemu:///session
[Sat, 31 May 2014 10:51:50 virt-convert 13264] DEBUG (formats:193) converter __init__ with input=SDN-VM.ovf parser=None
[Sat, 31 May 2014 10:51:50 virt-convert 13264] DEBUG (formats:201) converter not input_file=SDN-VM.ovf parser=<class 'virtconv.ovf.ovf_parser'>
[Sat, 31 May 2014 10:51:50 virt-convert 13264] DEBUG (cli:234)   File "/usr/share/virt-manager/virt-convert", line 131, in <module>
    fail(main_e)
  File "/usr/share/virt-manager/virtinst/cli.py", line 234, in fail
    logging.debug("".join(traceback.format_stack()))

[Sat, 31 May 2014 10:51:50 virt-convert 13264] ERROR (cli:235) [Errno 2] No such file or directory: ''
[Sat, 31 May 2014 10:51:50 virt-convert 13264] DEBUG (cli:237) 
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-convert", line 125, in <module>
    sys.exit(main())
  File "/usr/share/virt-manager/virt-convert", line 102, in main
    input_name=options.input_format, print_cb=print_stdout)
  File "/usr/share/virt-manager/virtconv/formats.py", line 205, in __init__
    os.chdir(self._top_dir)
OSError: [Errno 2] No such file or directory: ''

Version-Release number of selected component (if applicable):
virt-install-1.0.1-3.fc20.noarch

How reproducible:
always

Steps to Reproduce:
1.virt-convert -d SDN-VM.ovf --print-xml

Actual results:
Parsing is halted.

Expected results:
Libvirt XML generated.

Additional info:
If the chdir is commented out, it gets a little further:

[jpeeler@jbp-laptop sdn (master)]$ virt-convert -d SDN-VM.ovf --print-xml
[Fri, 30 May 2014 23:47:39 virt-convert 6921] DEBUG (cli:187) Launched with command line: /usr/share/virt-manager/virt-convert -d SDN-VM.ovf --print-xml
[Fri, 30 May 2014 23:47:39 virt-convert 6921] DEBUG (cli:195) Requesting libvirt URI default
[Fri, 30 May 2014 23:47:43 virt-convert 6921] DEBUG (cli:199) Received libvirt URI qemu:///session
[Fri, 30 May 2014 23:47:43 virt-convert 6921] DEBUG (formats:193) converter __init__ with input=SDN-VM.ovf parser=None
[Fri, 30 May 2014 23:47:43 virt-convert 6921] DEBUG (formats:201) converter not input_file=SDN-VM.ovf parser=<class 'virtconv.ovf.ovf_parser'>
[Fri, 30 May 2014 23:47:43 virt-convert 6921] DEBUG (ovf:384) Importing OVF XML:
<?xml version="1.0"?>
<Envelope ovf:version="1.0" xml:lang="en-US" xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:vbox="http://www.virtualbox.org/ovf/machine">
  <References>
    <File ovf:href="SDN-VM-disk1.vmdk" ovf:id="file1"/>
  </References>
  <DiskSection>
    <Info>List of the virtual disks used in the package</Info>
    <Disk ovf:capacity="8589934592" ovf:diskId="vmdisk1" ovf:fileRef="file1" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" vbox:uuid="01ecd852-894d-4b1f-ad29-7887a20858a0"/>
  </DiskSection>
  <NetworkSection>
    <Info>Logical networks used in the package</Info>
    <Network ovf:name="HostOnly">
      <Description>Logical network used by this appliance.</Description>
    </Network>
    <Network ovf:name="NAT">
      <Description>Logical network used by this appliance.</Description>
    </Network>
  </NetworkSection>
  <VirtualSystem ovf:id="SDN-VM">
    <Info>A virtual machine</Info>
    <OperatingSystemSection ovf:id="94">
      <Info>The kind of installed guest operating system</Info>
      <Description>Ubuntu_64</Description>
      <vbox:OSType ovf:required="false">Ubuntu_64</vbox:OSType>
    </OperatingSystemSection>
    <VirtualHardwareSection>
      <Info>Virtual hardware requirements for a virtual machine</Info>
      <System>
        <vssd:ElementName>Virtual Hardware Family</vssd:ElementName>
        <vssd:InstanceID>0</vssd:InstanceID>
        <vssd:VirtualSystemIdentifier>SDN-VM</vssd:VirtualSystemIdentifier>
        <vssd:VirtualSystemType>virtualbox-2.2</vssd:VirtualSystemType>
      </System>
      <Item>
        <rasd:Caption>1 virtual CPU</rasd:Caption>
        <rasd:Description>Number of virtual CPUs</rasd:Description>
        <rasd:ElementName>1 virtual CPU</rasd:ElementName>
        <rasd:InstanceID>1</rasd:InstanceID>
        <rasd:ResourceType>3</rasd:ResourceType>
        <rasd:VirtualQuantity>1</rasd:VirtualQuantity>
      </Item>
      <Item>
        <rasd:AllocationUnits>MegaBytes</rasd:AllocationUnits>
        <rasd:Caption>512 MB of memory</rasd:Caption>
        <rasd:Description>Memory Size</rasd:Description>
        <rasd:ElementName>512 MB of memory</rasd:ElementName>
        <rasd:InstanceID>2</rasd:InstanceID>
        <rasd:ResourceType>4</rasd:ResourceType>
        <rasd:VirtualQuantity>512</rasd:VirtualQuantity>
      </Item>
      <Item>
        <rasd:Address>0</rasd:Address>
        <rasd:Caption>ideController0</rasd:Caption>
        <rasd:Description>IDE Controller</rasd:Description>
        <rasd:ElementName>ideController0</rasd:ElementName>
        <rasd:InstanceID>3</rasd:InstanceID>
        <rasd:ResourceSubType>PIIX4</rasd:ResourceSubType>
        <rasd:ResourceType>5</rasd:ResourceType>
      </Item>
      <Item>
        <rasd:Address>1</rasd:Address>
        <rasd:Caption>ideController1</rasd:Caption>
        <rasd:Description>IDE Controller</rasd:Description>
        <rasd:ElementName>ideController1</rasd:ElementName>
        <rasd:InstanceID>4</rasd:InstanceID>
        <rasd:ResourceSubType>PIIX4</rasd:ResourceSubType>
        <rasd:ResourceType>5</rasd:ResourceType>
      </Item>
      <Item>
        <rasd:Address>0</rasd:Address>
        <rasd:Caption>sataController0</rasd:Caption>
        <rasd:Description>SATA Controller</rasd:Description>
        <rasd:ElementName>sataController0</rasd:ElementName>
        <rasd:InstanceID>5</rasd:InstanceID>
        <rasd:ResourceSubType>AHCI</rasd:ResourceSubType>
        <rasd:ResourceType>20</rasd:ResourceType>
      </Item>
      <Item>
        <rasd:Address>0</rasd:Address>
        <rasd:Caption>usb</rasd:Caption>
        <rasd:Description>USB Controller</rasd:Description>
        <rasd:ElementName>usb</rasd:ElementName>
        <rasd:InstanceID>6</rasd:InstanceID>
        <rasd:ResourceType>23</rasd:ResourceType>
      </Item>
      <Item>
        <rasd:AddressOnParent>3</rasd:AddressOnParent>
        <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
        <rasd:Caption>sound</rasd:Caption>
        <rasd:Description>Sound Card</rasd:Description>
        <rasd:ElementName>sound</rasd:ElementName>
        <rasd:InstanceID>7</rasd:InstanceID>
        <rasd:ResourceSubType>ensoniq1371</rasd:ResourceSubType>
        <rasd:ResourceType>35</rasd:ResourceType>
      </Item>
      <Item>
        <rasd:AddressOnParent>0</rasd:AddressOnParent>
        <rasd:Caption>disk1</rasd:Caption>
        <rasd:Description>Disk Image</rasd:Description>
        <rasd:ElementName>disk1</rasd:ElementName>
        <rasd:HostResource>/disk/vmdisk1</rasd:HostResource>
        <rasd:InstanceID>8</rasd:InstanceID>
        <rasd:Parent>5</rasd:Parent>
        <rasd:ResourceType>17</rasd:ResourceType>
      </Item>
      <Item>
        <rasd:AddressOnParent>0</rasd:AddressOnParent>
        <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
        <rasd:Caption>cdrom1</rasd:Caption>
        <rasd:Description>CD-ROM Drive</rasd:Description>
        <rasd:ElementName>cdrom1</rasd:ElementName>
        <rasd:InstanceID>9</rasd:InstanceID>
        <rasd:Parent>4</rasd:Parent>
        <rasd:ResourceType>15</rasd:ResourceType>
      </Item>
      <Item>
        <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
        <rasd:Caption>Ethernet adapter on 'NAT'</rasd:Caption>
        <rasd:Connection>NAT</rasd:Connection>
        <rasd:ElementName>Ethernet adapter on 'NAT'</rasd:ElementName>
        <rasd:InstanceID>10</rasd:InstanceID>
        <rasd:ResourceSubType>E1000</rasd:ResourceSubType>
        <rasd:ResourceType>10</rasd:ResourceType>
      </Item>
      <Item>
        <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
        <rasd:Caption>Ethernet adapter on 'HostOnly'</rasd:Caption>
        <rasd:Connection>HostOnly</rasd:Connection>
        <rasd:ElementName>Ethernet adapter on 'HostOnly'</rasd:ElementName>
        <rasd:InstanceID>11</rasd:InstanceID>
        <rasd:ResourceSubType>E1000</rasd:ResourceSubType>
        <rasd:ResourceType>10</rasd:ResourceType>
      </Item>
    </VirtualHardwareSection>
    <vbox:Machine ovf:required="false" version="1.12-macosx" uuid="{e34e8998-0840-4ba4-9601-748606475faa}" name="SDN-VM" OSType="Ubuntu_64" snapshotFolder="Snapshots" lastStateChange="2014-05-23T14:12:25Z">
      <ovf:Info>Complete VirtualBox machine configuration in VirtualBox format</ovf:Info>
      <ExtraData>
        <ExtraDataItem name="GUI/LastGuestSizeHint" value="720,400"/>
        <ExtraDataItem name="GUI/LastNormalWindowPosition" value="400,166,720,421"/>
      </ExtraData>
      <Hardware version="2">
        <CPU count="1" hotplug="false">
          <HardwareVirtEx enabled="true"/>
          <HardwareVirtExNestedPaging enabled="true"/>
          <HardwareVirtExVPID enabled="true"/>
          <HardwareVirtExUX enabled="true"/>
          <PAE enabled="false"/>
          <HardwareVirtExLargePages enabled="true"/>
          <HardwareVirtForce enabled="false"/>
        </CPU>
        <Memory RAMSize="512" PageFusion="false"/>
        <HID Pointing="USBTablet" Keyboard="PS2Keyboard"/>
        <HPET enabled="false"/>
        <Chipset type="PIIX3"/>
        <Boot>
          <Order position="1" device="Floppy"/>
          <Order position="2" device="DVD"/>
          <Order position="3" device="HardDisk"/>
          <Order position="4" device="None"/>
        </Boot>
        <Display VRAMSize="12" monitorCount="1" accelerate3D="false" accelerate2DVideo="false"/>
        <VideoCapture/>
        <RemoteDisplay enabled="false" authType="Null"/>
        <BIOS>
          <ACPI enabled="true"/>
          <IOAPIC enabled="true"/>
          <Logo fadeIn="true" fadeOut="true" displayTime="0"/>
          <BootMenu mode="MessageAndMenu"/>
          <TimeOffset value="0"/>
          <PXEDebug enabled="false"/>
        </BIOS>
        <USBController enabled="true" enabledEhci="false"/>
        <Network>
          <Adapter slot="0" enabled="true" MACAddress="080027526D10" cable="true" speed="0" type="82540EM">
            <DisabledModes/>
            <NAT>
              <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
              <Alias logging="false" proxy-only="false" use-same-ports="false"/>
            </NAT>
          </Adapter>
          <Adapter slot="1" enabled="true" MACAddress="080027A82BE5" cable="true" speed="0" type="82540EM">
            <DisabledModes>
              <NAT>
                <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
                <Alias logging="false" proxy-only="false" use-same-ports="false"/>
              </NAT>
              <InternalNetwork name="intnet"/>
              <NATNetwork name="NatNetwork"/>
            </DisabledModes>
            <HostOnlyInterface name="vboxnet0"/>
          </Adapter>
          <Adapter slot="2" enabled="false" MACAddress="0800276F17BC" cable="true" speed="0" type="82540EM">
            <DisabledModes>
              <NAT>
                <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
                <Alias logging="false" proxy-only="false" use-same-ports="false"/>
              </NAT>
            </DisabledModes>
          </Adapter>
          <Adapter slot="3" enabled="false" MACAddress="0800277F45EF" cable="true" speed="0" type="82540EM">
            <DisabledModes>
              <NAT>
                <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
                <Alias logging="false" proxy-only="false" use-same-ports="false"/>
              </NAT>
            </DisabledModes>
          </Adapter>
          <Adapter slot="4" enabled="false" MACAddress="080027D7F543" cable="true" speed="0" type="82540EM">
            <DisabledModes>
              <NAT>
                <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
                <Alias logging="false" proxy-only="false" use-same-ports="false"/>
              </NAT>
            </DisabledModes>
          </Adapter>
          <Adapter slot="5" enabled="false" MACAddress="0800274DB927" cable="true" speed="0" type="82540EM">
            <DisabledModes>
              <NAT>
                <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
                <Alias logging="false" proxy-only="false" use-same-ports="false"/>
              </NAT>
            </DisabledModes>
          </Adapter>
          <Adapter slot="6" enabled="false" MACAddress="080027F93A23" cable="true" speed="0" type="82540EM">
            <DisabledModes>
              <NAT>
                <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
                <Alias logging="false" proxy-only="false" use-same-ports="false"/>
              </NAT>
            </DisabledModes>
          </Adapter>
          <Adapter slot="7" enabled="false" MACAddress="0800274E7082" cable="true" speed="0" type="82540EM">
            <DisabledModes>
              <NAT>
                <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
                <Alias logging="false" proxy-only="false" use-same-ports="false"/>
              </NAT>
            </DisabledModes>
          </Adapter>
        </Network>
        <UART>
          <Port slot="0" enabled="false" IOBase="0x3f8" IRQ="4" hostMode="Disconnected"/>
          <Port slot="1" enabled="false" IOBase="0x2f8" IRQ="3" hostMode="Disconnected"/>
        </UART>
        <LPT>
          <Port slot="0" enabled="false" IOBase="0x378" IRQ="7"/>
          <Port slot="1" enabled="false" IOBase="0x378" IRQ="7"/>
        </LPT>
        <AudioAdapter controller="AC97" driver="CoreAudio" enabled="true"/>
        <RTC localOrUTC="UTC"/>
        <SharedFolders/>
        <Clipboard mode="Disabled"/>
        <DragAndDrop mode="Disabled"/>
        <IO>
          <IoCache enabled="true" size="5"/>
          <BandwidthGroups/>
        </IO>
        <HostPci>
          <Devices/>
        </HostPci>
        <EmulatedUSB>
          <CardReader enabled="false"/>
        </EmulatedUSB>
        <Guest memoryBalloonSize="0"/>
        <GuestProperties>
          <GuestProperty name="/VirtualBox/HostInfo/GUI/LanguageID" value="en_US" timestamp="1400852814542816000" flags=""/>
        </GuestProperties>
      </Hardware>
      <StorageControllers>
        <StorageController name="IDE" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true">
          <AttachedDevice passthrough="false" type="DVD" port="1" device="0"/>
        </StorageController>
        <StorageController name="SATA" type="AHCI" PortCount="1" useHostIOCache="false" Bootable="true" IDE0MasterEmulationPort="0" IDE0SlaveEmulationPort="1" IDE1MasterEmulationPort="2" IDE1SlaveEmulationPort="3">
          <AttachedDevice type="HardDisk" port="0" device="0">
            <Image uuid="{01ecd852-894d-4b1f-ad29-7887a20858a0}"/>
          </AttachedDevice>
        </StorageController>
      </StorageControllers>
    </vbox:Machine>
  </VirtualSystem>
</Envelope>

[Fri, 30 May 2014 23:47:43 virt-convert 6921] DEBUG (ovf:252) OS parsed as: id=None version=None vmware=None
[Fri, 30 May 2014 23:47:43 virt-convert 6921] DEBUG (diskbackend:144) Attempting to build pool=sdn target=/home/jpeeler/Downloads/sdn
[Fri, 30 May 2014 23:47:43 virt-convert 6921] DEBUG (storage:462) Creating storage pool 'sdn' with xml:
<pool type="dir">
  <name>sdn</name>
  <uuid>b40da929-c983-42e4-8f63-51f61dea9364</uuid>
  <target>
    <path>/home/jpeeler/Downloads/sdn</path>
  </target>
</pool>

Running /usr/bin/qemu-img convert -O raw SDN-VM-disk1.vmdk /home/jpeeler/VirtualMachines/SDN-VM-disk1.raw
[Fri, 30 May 2014 23:47:43 virt-convert 6921] DEBUG (diskbackend:144) Attempting to build pool=VirtualMachines target=/home/jpeeler/VirtualMachines
[Fri, 30 May 2014 23:47:43 virt-convert 6921] DEBUG (storage:462) Creating storage pool 'VirtualMachines' with xml:
<pool type="dir">
  <name>VirtualMachines</name>
  <uuid>2e06ac33-5e45-4ab5-abe4-da706806d062</uuid>
  <target>
    <path>/home/jpeeler/VirtualMachines</path>
  </target>
</pool>

[Fri, 30 May 2014 23:47:43 virt-convert 6921] DEBUG (cli:234)   File "/usr/share/virt-manager/virt-convert", line 131, in <module>
    fail(main_e)
  File "/usr/share/virt-manager/virtinst/cli.py", line 234, in fail
    logging.debug("".join(traceback.format_stack()))

[Fri, 30 May 2014 23:47:43 virt-convert 6921] ERROR (cli:235) Could not define storage pool: operation failed: Storage source conflict with pool: 'default'
[Fri, 30 May 2014 23:47:43 virt-convert 6921] DEBUG (cli:237) 
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-convert", line 125, in <module>
    sys.exit(main())
  File "/usr/share/virt-manager/virt-convert", line 105, in main
    destdir=options.destination, dry=options.dry)
  File "/usr/share/virt-manager/virtconv/formats.py", line 299, in convert_disks
    disk.path = newpath
  File "/usr/share/virt-manager/virtinst/devicedisk.py", line 523, in _set_path
    self._change_backend(val, None)
  File "/usr/share/virt-manager/virtinst/devicedisk.py", line 711, in _change_backend
    path, vol_object, None, None, None)
  File "/usr/share/virt-manager/virtinst/devicedisk.py", line 117, in _distill_storage
    (vol_object, pool, path_is_pool) = diskbackend.manage_path(conn, path)
  File "/usr/share/virt-manager/virtinst/diskbackend.py", line 150, in manage_path
    pool = poolxml.install(build=False, create=True, autostart=True)
  File "/usr/share/virt-manager/virtinst/storage.py", line 470, in install
    raise RuntimeError(_("Could not define storage pool: %s" % str(e)))
RuntimeError: Could not define storage pool: operation failed: Storage source conflict with pool: 'default'


I had assumed that with the --print-xml option it would simply convert to XML, but it seems to insist on attempting converting the disk image. It would be nice if that functionality was separated out.

Comment 1 Cole Robinson 2014-05-31 20:34:11 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

Comment 2 Jeff Peeler 2014-06-03 20:00:08 UTC
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'

Comment 3 Cole Robinson 2014-06-03 20:27:11 UTC
Thanks for testing. I pushed a commit fixing that, the API is actually pool.create(0). Can you try again?

Comment 4 Jeff Peeler 2014-06-03 20:40:53 UTC
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

Comment 5 Cole Robinson 2014-06-05 13:04:50 UTC
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.


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