On 05/18/2012 03:58 PM, Keith Robertson wrote:
Juan,

I wouldn't consider it an exhaustive test by any means, but I have a
simple  .ovf file in the Image Uploader GIT repo that I do unit testing
with.  You can review the OVF XML file therein if you like.

FWIW, I would recommend you simply export an image from an "unpatched"
oVirt engine and just compare the resulting XML to a patched version.

1: git clone gerrit.ovirt.org:ovirt-image-uploader
2: cd ovirt-image-uploader/src
3: tar -xvf sample.ovf<-  This is a portable/exported "image"
    - Note: For some reason there seems to be a consensus to append/apply
the .ovf extension to .tgz file image files.  It is somewhat confusing,
IMHO.
4: Look at
master/vms/5272b689-cd9f-4532-9b5d-2413eb7b9402/5272b689-cd9f-4532-9b5d-2413eb7b9402.ovf
for an OVF XML file.

Keith, that helped a lot, thanks! After comparing with your example I updated the patch and now the result almost identical to the example. The resulting XML that I get now is attached. I appreciate if someone can take a look.

On 05/18/2012 06:43 AM, Juan Hernandez wrote:
Hello,

I recently submitted a change to fix the way we manage namespaces in
the OVF writer:

http://gerrit.ovirt.org/4540

The problem is that it doesn't work with the StAX reference
implementation included with Java 7.

With the patched OVF writer I generated the attached OVF file. I would
appreciate if someone can take a quick look at it and tell me if it is
correct. I would also appreciate if you can send me known good OVF
files generated by the engine, to compare them with the ones produced
with the patched OVF writer.

Thanks in advance,
Juan Hernandez

--
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta 3ºD, 28016 Madrid, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.
<?xml version="1.0" encoding="UTF-8"?>
<ovf:Envelope 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"; ovf:version="3.1.0.0">
  <References>
    <File ovf:href="f70aa813-f4c4-4ca4-880f-44320c9a8837/deea29d5-3b33-49b4-b06e-ab9154249b93" ovf:id="deea29d5-3b33-49b4-b06e-ab9154249b93" ovf:size="1073741824" ovf:description="Active VM"/>
    <Nic ovf:id="e67c4457-a9fa-4c4b-8e60-0abd4cb4f358"/>
  </References>
  <Section xsi:type="ovf:NetworkSection_Type">
    <Info>List of networks</Info>
    <Network ovf:name="Network 1"/>
  </Section>
  <Section xsi:type="ovf:DiskSection_Type">
    <Info>List of Virtual Disks</Info>
    <Disk ovf:diskId="deea29d5-3b33-49b4-b06e-ab9154249b93" ovf:size="1" ovf:actual_size="0" ovf:vm_snapshot_id="1c907dc1-428f-437e-9792-33b63ed3f597" ovf:parentRef="" ovf:fileRef="f70aa813-f4c4-4ca4-880f-44320c9a8837/deea29d5-3b33-49b4-b06e-ab9154249b93" ovf:format="http://www.vmware.com/specifications/vmdk.html#sparse"; ovf:volume-format="RAW" ovf:volume-type="Sparse" ovf:disk-interface="VirtIO" ovf:boot="true" ovf:disk-alias="mydesktop_disk1" ovf:wipe-after-delete="false"/>
  </Section>
  <Content ovf:id="out" xsi:type="ovf:VirtualSystem_Type">
    <Name>mydesktop</Name>
    <TemplateId>00000000-0000-0000-0000-000000000000</TemplateId>
    <TemplateName>Blank</TemplateName>
    <Description>My Desktop</Description>
    <Domain/>
    <CreationDate>2012/05/18 16:31:24</CreationDate>
    <ExportDate>2012/05/18 16:31:52</ExportDate>
    <IsInitilized>false</IsInitilized>
    <IsAutoSuspend>false</IsAutoSuspend>
    <TimeZone/>
    <IsStateless>false</IsStateless>
    <Origin>3</Origin>
    <default_boot_sequence>0</default_boot_sequence>
    <VmType>0</VmType>
    <DefaultDisplayType>1</DefaultDisplayType>
    <MinAllocatedMem>1024</MinAllocatedMem>
    <Section ovf:id="3196105f-48c7-4e36-ab7d-aa5a1c1d8e8b" ovf:required="false" xsi:type="ovf:OperatingSystemSection_Type">
      <Info>Guest Operating System</Info>
      <Description>OtherLinux</Description>
    </Section>
    <Section xsi:type="ovf:VirtualHardwareSection_Type">
      <Info>1 CPU, 1024 Memeory</Info>
      <System>
        <vssd:VirtualSystemType>ENGINE 3.1.0.0</vssd:VirtualSystemType>
      </System>
      <Item>
        <rasd:Caption>1 virtual cpu</rasd:Caption>
        <rasd:Description>Number of virtual CPU</rasd:Description>
        <rasd:InstanceId>1</rasd:InstanceId>
        <rasd:ResourceType>3</rasd:ResourceType>
        <rasd:num_of_sockets>1</rasd:num_of_sockets>
        <rasd:cpu_per_socket>1</rasd:cpu_per_socket>
      </Item>
      <Item>
        <rasd:Caption>1024 MB of memory</rasd:Caption>
        <rasd:Description>Memory Size</rasd:Description>
        <rasd:InstanceId>2</rasd:InstanceId>
        <rasd:ResourceType>4</rasd:ResourceType>
        <rasd:AllocationUnits>MegaBytes</rasd:AllocationUnits>
        <rasd:VirtualQuantity>1024</rasd:VirtualQuantity>
      </Item>
      <Item>
        <rasd:Caption>Drive 1</rasd:Caption>
        <rasd:InstanceId>deea29d5-3b33-49b4-b06e-ab9154249b93</rasd:InstanceId>
        <rasd:ResourceType>17</rasd:ResourceType>
        <rasd:HostResource>f70aa813-f4c4-4ca4-880f-44320c9a8837/deea29d5-3b33-49b4-b06e-ab9154249b93</rasd:HostResource>
        <rasd:Parent>00000000-0000-0000-0000-000000000000</rasd:Parent>
        <rasd:Template>00000000-0000-0000-0000-000000000000</rasd:Template>
        <rasd:ApplicationList/>
        <rasd:StorageId>cbaee4d5-8d39-4ab8-816b-991214eec56c</rasd:StorageId>
        <rasd:StoragePoolId>d626478b-5124-410a-a3ae-97e14ca1ae24</rasd:StoragePoolId>
        <rasd:CreationDate>2012/05/18 16:21:49</rasd:CreationDate>
        <rasd:LastModified>2012/05/18 16:21:49</rasd:LastModified>
        <rasd:last_modified_date>2012/05/18 16:31:52</rasd:last_modified_date>
      </Item>
      <Item>
        <rasd:Caption>Ethernet adapter on ovirtmgmt</rasd:Caption>
        <rasd:InstanceId>e67c4457-a9fa-4c4b-8e60-0abd4cb4f358</rasd:InstanceId>
        <rasd:ResourceType>10</rasd:ResourceType>
        <rasd:ResourceSubType>3</rasd:ResourceSubType>
        <rasd:Connection>ovirtmgmt</rasd:Connection>
        <rasd:Name>nic1</rasd:Name>
        <rasd:MACAddress>00:1a:4a:a8:c8:01</rasd:MACAddress>
        <rasd:speed>1000</rasd:speed>
      </Item>
      <Item>
        <rasd:Caption>USB Controller</rasd:Caption>
        <rasd:InstanceId>3</rasd:InstanceId>
        <rasd:ResourceType>23</rasd:ResourceType>
        <rasd:UsbPolicy>Enabled</rasd:UsbPolicy>
      </Item>
    </Section>
  </Content>
</ovf:Envelope>
_______________________________________________
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel

Reply via email to