Bug 1161625 - [RFE] Expose creator of vm via api and/or gui
Summary: [RFE] Expose creator of vm via api and/or gui
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: ---
Hardware: All
OS: All
medium
medium
Target Milestone: ovirt-4.1.0-alpha
: 4.1.0.2
Assignee: Marek Libra
QA Contact: Israel Pinto
URL:
Whiteboard:
: 1161629 (view as bug list)
Depends On:
Blocks: 1427755
TreeView+ depends on / blocked
 
Reported: 2014-11-07 14:03 UTC by Sven Kieske
Modified: 2017-03-28 03:39 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
With this update, virtual machines can now be searched for by the user who created them. Using the REST API, the search query is ".../api/vms?search=created_by_user_id%3D[USER_ID]". The required User ID can be retrieved by using ".../api/users". In addition, the Administration Portal shows the creator's name in the virtual machine general sub-tab. However, it is possible for the user to have been removed from the system since the virtual machine was created.
Clone Of:
Environment:
Last Closed: 2017-02-01 14:53:06 UTC
oVirt Team: Virt
Embargoed:
mgoldboi: ovirt-4.1?
ipinto: testing_plan_complete+
ylavi: planning_ack?
rule-engine: devel_ack+
rule-engine: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 58360 0 master MERGED core: Query VMs list on CREATED_BY_USER_ID 2020-04-19 19:37:06 UTC

Description Sven Kieske 2014-11-07 14:03:47 UTC
Description of problem:
you can't query the api which user created a vm.

you can do this via "events", however events are just stored
for the last 30 days.

as per http://lists.ovirt.org/pipermail/users/2014-November/029014.html
this information is already stored in the database and should therefore
be easily exposed via api.

Version-Release number of selected component (if applicable):
3.5

How reproducible:
always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:
query vm to see who created it

Additional info:
filed RFE according to mailing list request

please consider backporting to 3.5.z if possible

Comment 1 Juan Hernández 2014-11-07 15:33:39 UTC
Yaniv, is this information available in some existing report?

Comment 2 Sven Kieske 2014-11-07 16:05:09 UTC
As per the ML-Thread, this is already stored in the DB:

We have it on database, but I don't see it exposed on API:

engine=# select vm_static.vm_name, users.name, users.domain from vm_static, users where vm_static.created_by_user_id = users.user_id;
-[ RECORD 1 ]-----
vm_name | vm01
name    | admin
domain  | internal
-[ RECORD 2 ]-----
vm_name | test
name    | admin
domain  | internal
... 

Does this provide the needed info?

Comment 3 Juan Hernández 2014-11-07 16:07:01 UTC
No Sven, I was asking Yaniv Dary if there is an existing ovirt-reports report that contains this information, as may useful as a workaround. Anyhow it is good to have the query in the bug, thanks.

Comment 4 Juan Hernández 2014-11-07 16:13:38 UTC
*** Bug 1161629 has been marked as a duplicate of this bug. ***

Comment 5 Yaniv Lavi 2014-11-08 23:31:46 UTC
(In reply to Juan Hernández from comment #1)
> Yaniv, is this information available in some existing report?

Yes, via ad hoc and inventory I believe.

Comment 6 Omer Frenkel 2014-11-09 09:07:12 UTC
need to remember that the user id might be invalid after some time.. (creating user can be deleted..)

Comment 7 Yaniv Lavi 2014-11-09 09:26:53 UTC
(In reply to Omer Frenkel from comment #6)
> need to remember that the user id might be invalid after some time..
> (creating user can be deleted..)

I the reports it's kept forever, so this might be the best solution.

Comment 8 Michal Skrivanek 2014-11-10 07:19:51 UTC
so...the reporting solves this in a better way....

Comment 9 Sven Kieske 2014-11-10 07:36:56 UTC
Don't know what info you need.
Do you need the information if the provided information via reports does solve
this?

I would say no for the following reasons:

Reports do not offer any (REST) api (I know of).
I do not even have reports installed.
It would at best be very clumsy to automate such a data retrieval process,
as I understand it, reports generates pdfs and you could parse them for the information this BZ requests but it would still be a dirty hack.

This BZ was about providing information witch is already stored in the DB
via the already implemented apis, in order to process and query this information
in a dynamic and automated fashion. I don't know if reports can provide this
but I would rather use the existing rest api than install yet-another-software.

I hope this was the information you requested.

Comment 10 Michal Skrivanek 2014-11-10 07:45:48 UTC
just need to bear in mind the limitation when the user is removed/renamed

Comment 11 Michal Skrivanek 2014-12-01 12:50:44 UTC
this is unlikely to be picked up for maintenance branch, so moving target release to 3.6

Comment 12 Michal Skrivanek 2015-06-05 11:44:21 UTC
This bug did not make it in time for 3.6 release, moving into the next one

Comment 13 Red Hat Bugzilla Rules Engine 2015-10-19 10:55:56 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 14 Sandro Bonazzola 2016-12-12 13:57:55 UTC
The fix for this issue should be included in oVirt 4.1.0 beta 1 released on December 1st. If not included please move back to modified.

Comment 15 Israel Pinto 2016-12-14 11:46:45 UTC
Verify with
Engine: 4.1.0-.2.master.20161213122836.git2cd5587.el7.centos
Host:
OS Description:Red Hat Enterprise Linux Server 7.3 (Maipo)
Kernel Version:3.10.0 - 514.el7.x86_64
KVM Version:2.6.0 - 27.1.el7
LIBVIRT Version:libvirt-2.0.0-10.el7
VDSM Version: vdsm-4.18.999-1138.git6c51957.el7.centos


Polarion run:
https://polarion.engineering.redhat.com/polarion/#/project/RHEVM3/testrun?id=VIRT%20Search%20Functionality&tab=records&result=passed


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