Bug 1360686

Summary: Failed to restore vm from configuration file (ovf)
Product: [oVirt] ovirt-engine Reporter: Raz Tamir <ratamir>
Component: BLL.NetworkAssignee: Yevgeny Zaspitsky <yzaspits>
Status: CLOSED CURRENTRELEASE QA Contact: Raz Tamir <ratamir>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.0.2.1CC: bugs, danken, gklein, jcall, ratamir, yzaspits
Target Milestone: ovirt-4.0.2Keywords: Automation, Regression
Target Release: ---Flags: rule-engine: ovirt-4.0.z+
rule-engine: blocker+
rule-engine: planning_ack+
rule-engine: devel_ack+
rule-engine: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-12 14:24:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1359668    
Bug Blocks:    
Attachments:
Description Flags
server log none

Description Raz Tamir 2016-07-27 10:43:10 UTC
Created attachment 1184582 [details]
server log

Description of problem:
When trying to restore a vm from ovf configuration file via REST API (v3 and v4) the response is
Status: 400
Reason: Bad Request
Detail: [Internal Engine Error]

From the server.log:
2016-07-27 01:30:08,859 ERROR [org.jboss.as.ejb3.invocation] (default task-25) WFLYEJB0034: EJB Invocation failed on component MacPoolPerDc for method public org.ovirt.engine.core.bll.network.macpool.MacPool org.ovirt.engine.core.bll.network.macpool.MacPoolPerDc.getMacPoolForDataCenter(org.ovirt.engine.core.compat.Guid,org.ovirt.engine.core.bll.context.CommandContext): javax.ejb.EJBTransactionRolledbackException: Coding error, pool for requested GUID does not exist



Version-Release number of selected component (if applicable):
ovirt-engine-4.0.2-0.1.rc.el7ev.noarch

How reproducible:
75%

Steps to Reproduce:
1. Restore vm from ovf file
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Yaniv Kaul 2016-07-27 11:47:07 UTC
A simple google search for "EJB Invocation failed on component MacPoolPerDc" points to a similar issue - https://bugzilla.redhat.com/show_bug.cgi?id=1359202 

And both remind of this week's import/export bugs - Dan?

Comment 2 Yevgeny Zaspitsky 2016-07-27 15:36:18 UTC
could you please provide the reproduction steps with url and the xml that you used?

Comment 3 Raz Tamir 2016-07-27 16:16:12 UTC
Reproduction steps:
POST to /api/vms

Body:
<vm>
    <name>vm_TestCase6169_REST_GLUSTER_27012235</name>
    <initialization>
        <configuration>
            <data>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;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="4.0.0.0"&gt;&lt;References&gt;&lt;File ovf:href="c4ef8279-5498-47ea-9fa1-bec6f0f2f1c6/adc07e16-5a49-43cf-8623-2ee4694d95cb" ovf:id="adc07e16-5a49-43cf-8623-2ee4694d95cb" ovf:size="10737418240" ovf:description="Active VM" ovf:disk_storage_type="IMAGE" ovf:cinder_volume_type=""&gt;&lt;/File&gt;&lt;Nic ovf:id="f76f414d-ce3e-473a-adb5-7239fdf29e83"&gt;&lt;/Nic&gt;&lt;/References&gt;&lt;Section xsi:type="ovf:NetworkSection_Type"&gt;&lt;Info&gt;List of networks&lt;/Info&gt;&lt;Network ovf:name="Network 1"&gt;&lt;/Network&gt;&lt;/Section&gt;&lt;Section xsi:type="ovf:DiskSection_Type"&gt;&lt;Info&gt;List of Virtual Disks&lt;/Info&gt;&lt;Disk ovf:diskId="adc07e16-5a49-43cf-8623-2ee4694d95cb" ovf:size="10" ovf:actual_size="2" ovf:vm_snapshot_id="9bac11bc-75e5-4309-af1e-80320a1214c2" ovf:parentRef="" ovf:fileRef="c4ef8279-5498-47ea-9fa1-bec6f0f2f1c6/adc07e16-5a49-43cf-8623-2ee4694d95cb" ovf:format="http://www.gnome.org/~markmc/qcow-image-format.html" ovf:volume-format="COW" ovf:volume-type="Sparse" ovf:disk-interface="VirtIO" ovf:boot="true" ovf:disk-alias="vm_TestCase6169_REST_GLUSTER_27011915_Disk_0" ovf:disk-description="golden_env_mixed_virtio_0_Disk1 (39a611d)" ovf:wipe-after-delete="false"&gt;&lt;/Disk&gt;&lt;/Section&gt;&lt;Content ovf:id="out" xsi:type="ovf:VirtualSystem_Type"&gt;&lt;CreationDate&gt;2016/07/26 22:19:20&lt;/CreationDate&gt;&lt;ExportDate&gt;2016/07/26 22:22:09&lt;/ExportDate&gt;&lt;DeleteProtected&gt;false&lt;/DeleteProtected&gt;&lt;SsoMethod&gt;guest_agent&lt;/SsoMethod&gt;&lt;IsSmartcardEnabled&gt;false&lt;/IsSmartcardEnabled&gt;&lt;TimeZone&gt;Etc/GMT&lt;/TimeZone&gt;&lt;default_boot_sequence&gt;0&lt;/default_boot_sequence&gt;&lt;Generation&gt;3&lt;/Generation&gt;&lt;ClusterCompatibilityVersion&gt;4.0&lt;/ClusterCompatibilityVersion&gt;&lt;VmType&gt;0&lt;/VmType&gt;&lt;MinAllocatedMem&gt;1024&lt;/MinAllocatedMem&gt;&lt;IsStateless&gt;false&lt;/IsStateless&gt;&lt;IsRunAndPause&gt;false&lt;/IsRunAndPause&gt;&lt;AutoStartup&gt;false&lt;/AutoStartup&gt;&lt;Priority&gt;0&lt;/Priority&gt;&lt;CreatedByUserId&gt;0000002c-002c-002c-002c-0000000002c7&lt;/CreatedByUserId&gt;&lt;MigrationSupport&gt;0&lt;/MigrationSupport&gt;&lt;IsBootMenuEnabled&gt;false&lt;/IsBootMenuEnabled&gt;&lt;IsSpiceFileTransferEnabled&gt;true&lt;/IsSpiceFileTransferEnabled&gt;&lt;IsSpiceCopyPasteEnabled&gt;true&lt;/IsSpiceCopyPasteEnabled&gt;&lt;CustomEmulatedMachine&gt;&lt;/CustomEmulatedMachine&gt;&lt;CustomCpuName&gt;&lt;/CustomCpuName&gt;&lt;PredefinedProperties&gt;&lt;/PredefinedProperties&gt;&lt;UserDefinedProperties&gt;&lt;/UserDefinedProperties&gt;&lt;Name&gt;vm_TestCase6169_REST_GLUSTER_27011915&lt;/Name&gt;&lt;TemplateId&gt;00000000-0000-0000-0000-000000000000&lt;/TemplateId&gt;&lt;TemplateName&gt;Blank&lt;/TemplateName&gt;&lt;IsInitilized&gt;false&lt;/IsInitilized&gt;&lt;Origin&gt;3&lt;/Origin&gt;&lt;DefaultDisplayType&gt;1&lt;/DefaultDisplayType&gt;&lt;TrustedService&gt;false&lt;/TrustedService&gt;&lt;OriginalTemplateId&gt;dbe9ec1e-a4f6-4f07-94a2-525550b8a4bb&lt;/OriginalTemplateId&gt;&lt;OriginalTemplateName&gt;golden_mixed_virtio_template&lt;/OriginalTemplateName&gt;&lt;UseHostCpu&gt;false&lt;/UseHostCpu&gt;&lt;UseLatestVersion&gt;false&lt;/UseLatestVersion&gt;&lt;Section ovf:id="c2a06b81-36cb-4543-a62f-45438ffe3362" ovf:required="false" xsi:type="ovf:OperatingSystemSection_Type"&gt;&lt;Info&gt;Guest Operating System&lt;/Info&gt;&lt;Description&gt;rhel_6x64&lt;/Description&gt;&lt;/Section&gt;&lt;Section xsi:type="ovf:VirtualHardwareSection_Type"&gt;&lt;Info&gt;1 CPU, 1024 Memory&lt;/Info&gt;&lt;System&gt;&lt;vssd:VirtualSystemType&gt;ENGINE 4.0.0.0&lt;/vssd:VirtualSystemType&gt;&lt;/System&gt;&lt;Item&gt;&lt;rasd:Caption&gt;1 virtual cpu&lt;/rasd:Caption&gt;&lt;rasd:Description&gt;Number of virtual CPU&lt;/rasd:Description&gt;&lt;rasd:InstanceId&gt;1&lt;/rasd:InstanceId&gt;&lt;rasd:ResourceType&gt;3&lt;/rasd:ResourceType&gt;&lt;rasd:num_of_sockets&gt;1&lt;/rasd:num_of_sockets&gt;&lt;rasd:cpu_per_socket&gt;1&lt;/rasd:cpu_per_socket&gt;&lt;rasd:threads_per_cpu&gt;1&lt;/rasd:threads_per_cpu&gt;&lt;/Item&gt;&lt;Item&gt;&lt;rasd:Caption&gt;1024 MB of memory&lt;/rasd:Caption&gt;&lt;rasd:Description&gt;Memory Size&lt;/rasd:Description&gt;&lt;rasd:InstanceId&gt;2&lt;/rasd:InstanceId&gt;&lt;rasd:ResourceType&gt;4&lt;/rasd:ResourceType&gt;&lt;rasd:AllocationUnits&gt;MegaBytes&lt;/rasd:AllocationUnits&gt;&lt;rasd:VirtualQuantity&gt;1024&lt;/rasd:VirtualQuantity&gt;&lt;/Item&gt;&lt;Item&gt;&lt;rasd:Caption&gt;vm_TestCase6169_REST_GLUSTER_27011915_Disk_0&lt;/rasd:Caption&gt;&lt;rasd:InstanceId&gt;adc07e16-5a49-43cf-8623-2ee4694d95cb&lt;/rasd:InstanceId&gt;&lt;rasd:ResourceType&gt;17&lt;/rasd:ResourceType&gt;&lt;rasd:HostResource&gt;c4ef8279-5498-47ea-9fa1-bec6f0f2f1c6/adc07e16-5a49-43cf-8623-2ee4694d95cb&lt;/rasd:HostResource&gt;&lt;rasd:Parent&gt;00000000-0000-0000-0000-000000000000&lt;/rasd:Parent&gt;&lt;rasd:Template&gt;00000000-0000-0000-0000-000000000000&lt;/rasd:Template&gt;&lt;rasd:ApplicationList&gt;&lt;/rasd:ApplicationList&gt;&lt;rasd:StoragePoolId&gt;f96e76cb-4490-44a2-a8d4-cf9bf4e80dd1&lt;/rasd:StoragePoolId&gt;&lt;rasd:CreationDate&gt;2016/07/26 22:19:22&lt;/rasd:CreationDate&gt;&lt;rasd:LastModified&gt;1970/01/01 00:00:00&lt;/rasd:LastModified&gt;&lt;rasd:last_modified_date&gt;2016/07/26 22:22:08&lt;/rasd:last_modified_date&gt;&lt;Type&gt;disk&lt;/Type&gt;&lt;Device&gt;disk&lt;/Device&gt;&lt;rasd:Address&gt;&lt;/rasd:Address&gt;&lt;BootOrder&gt;1&lt;/BootOrder&gt;&lt;IsPlugged&gt;true&lt;/IsPlugged&gt;&lt;IsReadOnly&gt;false&lt;/IsReadOnly&gt;&lt;Alias&gt;&lt;/Alias&gt;&lt;/Item&gt;&lt;Item&gt;&lt;rasd:Caption&gt;Ethernet adapter on ovirtmgmt&lt;/rasd:Caption&gt;&lt;rasd:InstanceId&gt;f76f414d-ce3e-473a-adb5-7239fdf29e83&lt;/rasd:InstanceId&gt;&lt;rasd:ResourceType&gt;10&lt;/rasd:ResourceType&gt;&lt;rasd:OtherResourceType&gt;ovirtmgmt&lt;/rasd:OtherResourceType&gt;&lt;rasd:ResourceSubType&gt;3&lt;/rasd:ResourceSubType&gt;&lt;rasd:Connection&gt;ovirtmgmt&lt;/rasd:Connection&gt;&lt;rasd:Linked&gt;true&lt;/rasd:Linked&gt;&lt;rasd:Name&gt;nic1&lt;/rasd:Name&gt;&lt;rasd:MACAddress&gt;00:1a:4a:16:88:97&lt;/rasd:MACAddress&gt;&lt;rasd:speed&gt;1000&lt;/rasd:speed&gt;&lt;Type&gt;interface&lt;/Type&gt;&lt;Device&gt;bridge&lt;/Device&gt;&lt;rasd:Address&gt;&lt;/rasd:Address&gt;&lt;BootOrder&gt;0&lt;/BootOrder&gt;&lt;IsPlugged&gt;true&lt;/IsPlugged&gt;&lt;IsReadOnly&gt;false&lt;/IsReadOnly&gt;&lt;Alias&gt;&lt;/Alias&gt;&lt;/Item&gt;&lt;Item&gt;&lt;rasd:Caption&gt;USB Controller&lt;/rasd:Caption&gt;&lt;rasd:InstanceId&gt;3&lt;/rasd:InstanceId&gt;&lt;rasd:ResourceType&gt;23&lt;/rasd:ResourceType&gt;&lt;rasd:UsbPolicy&gt;DISABLED&lt;/rasd:UsbPolicy&gt;&lt;/Item&gt;&lt;Item&gt;&lt;rasd:Caption&gt;Graphical Controller&lt;/rasd:Caption&gt;&lt;rasd:InstanceId&gt;2c308936-9549-44c2-89ea-8c35d12ec58a&lt;/rasd:InstanceId&gt;&lt;rasd:ResourceType&gt;20&lt;/rasd:ResourceType&gt;&lt;rasd:VirtualQuantity&gt;1&lt;/rasd:VirtualQuantity&gt;&lt;rasd:SinglePciQxl&gt;false&lt;/rasd:SinglePciQxl&gt;&lt;Type&gt;video&lt;/Type&gt;&lt;Device&gt;qxl&lt;/Device&gt;&lt;rasd:Address&gt;&lt;/rasd:Address&gt;&lt;BootOrder&gt;0&lt;/BootOrder&gt;&lt;IsPlugged&gt;true&lt;/IsPlugged&gt;&lt;IsReadOnly&gt;false&lt;/IsReadOnly&gt;&lt;Alias&gt;&lt;/Alias&gt;&lt;SpecParams&gt;&lt;vgamem&gt;16384&lt;/vgamem&gt;&lt;heads&gt;1&lt;/heads&gt;&lt;vram&gt;8192&lt;/vram&gt;&lt;ram&gt;65536&lt;/ram&gt;&lt;/SpecParams&gt;&lt;/Item&gt;&lt;Item&gt;&lt;rasd:Caption&gt;Graphical Framebuffer&lt;/rasd:Caption&gt;&lt;rasd:InstanceId&gt;62b386b5-c00a-41ec-ac10-0caaad7e3a35&lt;/rasd:InstanceId&gt;&lt;rasd:ResourceType&gt;26&lt;/rasd:ResourceType&gt;&lt;Type&gt;graphics&lt;/Type&gt;&lt;Device&gt;spice&lt;/Device&gt;&lt;rasd:Address&gt;&lt;/rasd:Address&gt;&lt;BootOrder&gt;0&lt;/BootOrder&gt;&lt;IsPlugged&gt;true&lt;/IsPlugged&gt;&lt;IsReadOnly&gt;false&lt;/IsReadOnly&gt;&lt;Alias&gt;&lt;/Alias&gt;&lt;/Item&gt;&lt;Item&gt;&lt;rasd:Caption&gt;CDROM&lt;/rasd:Caption&gt;&lt;rasd:InstanceId&gt;6a7ee6aa-cab6-40c6-904d-7856c76b85ba&lt;/rasd:InstanceId&gt;&lt;rasd:ResourceType&gt;15&lt;/rasd:ResourceType&gt;&lt;Type&gt;disk&lt;/Type&gt;&lt;Device&gt;cdrom&lt;/Device&gt;&lt;rasd:Address&gt;&lt;/rasd:Address&gt;&lt;BootOrder&gt;0&lt;/BootOrder&gt;&lt;IsPlugged&gt;true&lt;/IsPlugged&gt;&lt;IsReadOnly&gt;true&lt;/IsReadOnly&gt;&lt;Alias&gt;&lt;/Alias&gt;&lt;SpecParams&gt;&lt;path&gt;&lt;/path&gt;&lt;/SpecParams&gt;&lt;/Item&gt;&lt;Item&gt;&lt;rasd:ResourceType&gt;0&lt;/rasd:ResourceType&gt;&lt;rasd:InstanceId&gt;5e20fb81-d8c0-4809-8ac3-cf938227959e&lt;/rasd:InstanceId&gt;&lt;Type&gt;controller&lt;/Type&gt;&lt;Device&gt;virtio-serial&lt;/Device&gt;&lt;rasd:Address&gt;&lt;/rasd:Address&gt;&lt;BootOrder&gt;0&lt;/BootOrder&gt;&lt;IsPlugged&gt;true&lt;/IsPlugged&gt;&lt;IsReadOnly&gt;false&lt;/IsReadOnly&gt;&lt;Alias&gt;&lt;/Alias&gt;&lt;/Item&gt;&lt;Item&gt;&lt;rasd:ResourceType&gt;0&lt;/rasd:ResourceType&gt;&lt;rasd:InstanceId&gt;97fc3ee0-d250-4459-a1bb-022a4c1f034c&lt;/rasd:InstanceId&gt;&lt;Type&gt;balloon&lt;/Type&gt;&lt;Device&gt;memballoon&lt;/Device&gt;&lt;rasd:Address&gt;&lt;/rasd:Address&gt;&lt;BootOrder&gt;0&lt;/BootOrder&gt;&lt;IsPlugged&gt;true&lt;/IsPlugged&gt;&lt;IsReadOnly&gt;true&lt;/IsReadOnly&gt;&lt;Alias&gt;null&lt;/Alias&gt;&lt;SpecParams&gt;&lt;model&gt;virtio&lt;/model&gt;&lt;/SpecParams&gt;&lt;/Item&gt;&lt;Item&gt;&lt;rasd:ResourceType&gt;0&lt;/rasd:ResourceType&gt;&lt;rasd:InstanceId&gt;c97feb00-292b-4d8d-916b-5e530949def1&lt;/rasd:InstanceId&gt;&lt;Type&gt;controller&lt;/Type&gt;&lt;Device&gt;virtio-scsi&lt;/Device&gt;&lt;rasd:Address&gt;&lt;/rasd:Address&gt;&lt;BootOrder&gt;0&lt;/BootOrder&gt;&lt;IsPlugged&gt;true&lt;/IsPlugged&gt;&lt;IsReadOnly&gt;false&lt;/IsReadOnly&gt;&lt;Alias&gt;&lt;/Alias&gt;&lt;/Item&gt;&lt;Item&gt;&lt;rasd:ResourceType&gt;0&lt;/rasd:ResourceType&gt;&lt;rasd:InstanceId&gt;7b4363c0-d790-4039-8ebe-b3360fd3891c&lt;/rasd:InstanceId&gt;&lt;Type&gt;sound&lt;/Type&gt;&lt;Device&gt;ich6&lt;/Device&gt;&lt;rasd:Address&gt;&lt;/rasd:Address&gt;&lt;BootOrder&gt;0&lt;/BootOrder&gt;&lt;IsPlugged&gt;true&lt;/IsPlugged&gt;&lt;IsReadOnly&gt;true&lt;/IsReadOnly&gt;&lt;Alias&gt;&lt;/Alias&gt;&lt;/Item&gt;&lt;/Section&gt;&lt;/Content&gt;&lt;/ovf:Envelope&gt;</data>
            <type>ovf</type>
        </configuration>
    </initialization>
    <cluster href="/ovirt-engine/api/clusters/3eb50a70-350e-46eb-8d79-4124bd6e7aff" id="3eb50a70-350e-46eb-8d79-4124bd6e7aff">
        <name>golden_env_mixed_1</name>
        <ballooning_enabled>false</ballooning_enabled>
        <cpu>
            <architecture>x86_64</architecture>
            <type>Intel Haswell-noTSX Family</type>
        </cpu>
        <error_handling>
            <on_error>migrate</on_error>
        </error_handling>
        <fencing_policy>
            <enabled>true</enabled>
            <skip_if_connectivity_broken>
                <enabled>false</enabled>
                <threshold>50</threshold>
            </skip_if_connectivity_broken>
            <skip_if_sd_active>
                <enabled>false</enabled>
            </skip_if_sd_active>
        </fencing_policy>
        <gluster_service>false</gluster_service>
        <ha_reservation>false</ha_reservation>
        <ksm>
            <enabled>false</enabled>
            <merge_across_nodes>true</merge_across_nodes>
        </ksm>
        <maintenance_reason_required>false</maintenance_reason_required>
        <memory_policy>
            <over_commit>
                <percent>200</percent>
            </over_commit>
            <transparent_hugepages>
                <enabled>true</enabled>
            </transparent_hugepages>
        </memory_policy>
        <migration>
            <auto_converge>inherit</auto_converge>
            <bandwidth>
                <assignment_method>auto</assignment_method>
            </bandwidth>
            <compressed>inherit</compressed>
        </migration>
        <optional_reason>false</optional_reason>
        <required_rng_sources/>
        <scheduling_policy href="/ovirt-engine/api/schedulingpolicies/b4ed2332-a7ac-4d5f-9596-99a439cb2812" id="b4ed2332-a7ac-4d5f-9596-99a439cb2812"/>
        <threads_as_cores>false</threads_as_cores>
        <trusted_service>false</trusted_service>
        <tunnel_migration>false</tunnel_migration>
        <version>
            <major>4</major>
            <minor>0</minor>
        </version>
        <virt_service>true</virt_service>
        <data_center href="/ovirt-engine/api/datacenters/f96e76cb-4490-44a2-a8d4-cf9bf4e80dd1" id="f96e76cb-4490-44a2-a8d4-cf9bf4e80dd1"/>
    </cluster>
</vm>


The 'data' of the ovf file can be found when sending GET request request to /api/vms with api http header 'all-content=true'

Comment 4 Raz Tamir 2016-07-27 16:18:19 UTC
Yevgeny,
I will assist to verify this

Comment 6 Yevgeny Zaspitsky 2016-07-31 09:36:34 UTC
The bug is supposedly fixed in 4.0.2-4, so it's available for QA - moving target milestone back to 4.0.2.

Comment 7 Raz Tamir 2016-07-31 13:16:20 UTC
Verified on ovirt-engine-4.0.2.2-0.1.el7ev.noarch.
Followed the steps from comment #3