Bug 1119862

Summary: NPE when trying to allocate VM from pool
Product: [Retired] oVirt Reporter: Juan Hernández <juan.hernandez>
Component: ovirt-engine-apiAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Ilanit Stein <istein>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.5CC: gklein, iheim, mavital, rbalakri, yeylon
Target Milestone: ---Keywords: Triaged
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: virt
Fixed In Version: ovirt-3.5.0-beta2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-17 12:21:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
verification engine.log none

Description Juan Hernández 2014-07-15 17:03:22 UTC
Trying to allocate a VM from a pool produces a NPE:

Caused by: java.lang.NullPointerException
        at org.ovirt.engine.core.common.action.VmPoolUserParameters.<init>(VmPoolUserParameters.java:12)
        at org.ovirt.engine.api.restapi.resource.BackendVmPoolResource.allocatevm(BackendVmPoolResource.java:143) [restapi-jaxrs.jar:]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_55]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_55]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_55]
        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_55]
        at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:155) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:152) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:91) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525) [resteasy-jaxrs-2.3.2.Final.jar:]

Easy to reproduce with the following script:

#!/bin/sh -x

url="https://fedora.example.com/ovirt-engine/api"
user="admin@internal"
password="******"

curl \
--insecure \
--request POST \
--header "Accept: application/xml" \
--header "Content-Type: application/xml" \
--user "${user}:${password}" \
--data "
<action/>
" \
${url}/vmpools/<vmpool_id>/allocatevm

Comment 1 Ilanit Stein 2014-07-30 08:37:33 UTC
Verified on ovirt-engine-3.5.0-0.0.master.20140722232058.git8e1babc.el6.noarch.

Run the script in the description.
got these events:
014-Jul-30, 11:26
Attaching User admin to VM POOL-1 in VM Pool POOL was initiated by admin.
	
2014-Jul-30, 11:26
VM POOL-1 was restarted on Host Non interactive user

engine.log attached. no NPE.

Comment 2 Ilanit Stein 2014-07-30 08:38:17 UTC
Created attachment 922459 [details]
verification engine.log

Comment 3 Sandro Bonazzola 2014-10-17 12:21:13 UTC
oVirt 3.5 has been released and should include the fix for this issue.