Bug 1408599 - Cannot allocate a prestarted vm from a pool as user with permissions via API
Summary: Cannot allocate a prestarted vm from a pool as user with permissions via API
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.1.0-rc
: 4.1.0.2
Assignee: Shahar Havivi
QA Contact: sefi litmanovich
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-25 17:10 UTC by sefi litmanovich
Modified: 2017-02-01 14:36 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-01 14:36:51 UTC
oVirt Team: Virt
Embargoed:
rule-engine: ovirt-4.1+
rule-engine: blocker+
rule-engine: planning_ack+
rule-engine: devel_ack+
mavital: testing_ack+


Attachments (Terms of Use)
engine log (3.01 MB, application/x-gzip)
2016-12-25 17:10 UTC, sefi litmanovich
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 69913 0 master MERGED core: acquireLock doesn't check for null lock list 2020-08-07 13:49:01 UTC
oVirt gerrit 69962 0 ovirt-engine-4.1 MERGED core: acquireLock doesn't check for null lock list 2020-08-07 13:49:01 UTC

Description sefi litmanovich 2016-12-25 17:10:05 UTC
Created attachment 1235269 [details]
engine log

Description of problem:
When trying to take a prestarted vm from a pool via API as a user that got userRole permission on the pool, the action fails with:
Detail: [General command validation failure.]

engine.log shows a very long trace for this error:
2016-12-22 08:45:14,742+02 ERROR [org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand] (default task-4) [vmpools_syncAction_b45dcdea-fa27-4e0] Error during ValidateFailure.: java.lang.NullPointerException

We hit this issue on automation and I was able to re produce the bug on my 4.1  env manually.

The same error doesn't occur when login with the user to user portal and starting a session on the vm from there.

Version-Release number of selected component (if applicable):
ovirt-engine-4.1.0-0.2.master.20161218144454.gitbaa2853.el7.centos.noarch

How reproducible:
always

Steps to Reproduce:
1. Create a vm pool - size 1, set pre started vms in the pool to 1.
2. Add userRole permission for the pool to some user in your system, can be admin as well.
3. Wait for the prestarted vm to start.
4. Connect to API with user you gave permissions on the pool to and try to allocate a vm from the pool

POST https://{engine_url}/ovirt-engine/api/vmpools/{vmpool_id}/allocatevm

<action>
    <async>false</async>
    <grace_period>
        <expiry>10</expiry>
    </grace_period>
</action>

Actual results:
Fails with:
Detail: [General command validation failure.]

Expected results:
User starts a session on the vm and vm inherits the userRole permission for that user from the pool.

Additional info:
Attaching engine.log from automation run - look for:
'vmpools_syncAction_b45dcdea-fa27-4e0'

Comment 1 Red Hat Bugzilla Rules Engine 2017-01-03 08:45:53 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 2 sefi litmanovich 2017-01-26 11:58:50 UTC
Verified with rhevm-4.1.0.2-0.2.el7.noarch according to the steps in description.


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