Bug 1351145 - Register unregistered templates (import storage domain) failed via REST
Summary: Register unregistered templates (import storage domain) failed via REST
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Network
Version: 4.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.0.2
: 4.0.2
Assignee: Yevgeny Zaspitsky
QA Contact: Raz Tamir
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-29 11:07 UTC by Raz Tamir
Modified: 2016-08-12 14:29 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-12 14:29:11 UTC
oVirt Team: Network
Embargoed:
rule-engine: ovirt-4.0.z+
rule-engine: blocker+
rule-engine: planning_ack+
rule-engine: devel_ack+
rule-engine: testing_ack+


Attachments (Terms of Use)
engine log (2.49 MB, text/plain)
2016-06-29 11:07 UTC, Raz Tamir
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1359202 0 urgent CLOSED The engine fails importing the engine VM due to 'Coding error, pool for requested GUID does not exist' 2021-02-22 00:41:40 UTC
oVirt gerrit 60344 0 ovirt-engine-4.0 MERGED engine: use clusterId if dcId isn't available in ImportValidator 2016-07-10 10:07:47 UTC

Internal Links: 1359202

Description Raz Tamir 2016-06-29 11:07:38 UTC
Created attachment 1173773 [details]
engine log

Description of problem:
When trying to register unregistered template using REST API (v3) I get the following response:
Status: 500
Reason: Internal Server Error
Detail: [General command validation failure.]

And from the engine.log:
2016-06-29 13:59:39,906 ERROR [org.ovirt.engine.core.bll.exportimport.ImportVmTemplateFromConfigurationCommand] (default task-30) [dea0471] Error during ValidateFailure.: javax.ejb.EJBException: java.lang.IllegalSt
ateException: Coding error, pool for requested GUID does not exist




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

How reproducible:
100%

Steps to Reproduce:
Have a working environment with at least 2 storage domains
1. Create a template from VM on one of the domains
2. Deactivate and detach the domain from step 1
3. Attach the domain again and send the request:
3.1 Send GET command to /api/storagedomains/{sd:id}/templates;unregistered
---> search for the link under with 'register' <actions> collections:
<actions>
    <link href="/ovirt-engine/api/storagedomains/{sd:id}/templates/{template:id}/register" rel="register"/>
</actions>

3.2 Send POST command to /ovirt-engine/api/storagedomains/{sd:id}/templates/{template:id}/register from step 3.1
body:
<action>
    <async>false</async>
    <grace_period>
        <expiry>10</expiry>
    </grace_period>
    <cluster>
        <name>CLUSTER_NAME</name>
    </cluster>
</action>

Actual results:


Expected results:


Additional info:

Comment 1 Juan Hernández 2016-06-29 12:48:48 UTC
I can't reproduce in my environment (latest master), but it looks BLL related, and not specific to V3 of the API. The relevant line from the log is this one:

Caused by: java.lang.IllegalStateException: Coding error, pool for requested GUID does not exist
	at org.ovirt.engine.core.bll.network.macpool.MacPoolPerDc.getMacPoolWithoutLocking(MacPoolPerDc.java:114)

Comment 2 Allon Mureinik 2016-06-30 12:12:54 UTC
(In reply to Juan Hernández from comment #1)
> I can't reproduce in my environment (latest master), but it looks BLL
> related, and not specific to V3 of the API. The relevant line from the log
> is this one:
> 
> Caused by: java.lang.IllegalStateException: Coding error, pool for requested
> GUID does not exist
> 	at
> org.ovirt.engine.core.bll.network.macpool.MacPoolPerDc.
> getMacPoolWithoutLocking(MacPoolPerDc.java:114)
This is a network error wrt assigning a mac pool to the imported entity.
I have a vague recollection it was already solved upstream, but moving to the networking team to verify and/or fix.

Comment 3 Raz Tamir 2016-07-24 14:04:56 UTC
Verified - ovirt-engine-4.0.2-0.1.rc.el7ev.noarch
Template was registered successfully


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