Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1161625 - [RFE] Expose creator of vm via api and/or gui
[RFE] Expose creator of vm via api and/or gui
Status: CLOSED CURRENTRELEASE
Product: ovirt-engine
Classification: oVirt
Component: RestAPI (Show other bugs)
---
All All
medium Severity medium (vote)
: ovirt-4.1.0-alpha
: 4.1.0.2
Assigned To: Marek Libra
Israel Pinto
: FutureFeature
: 1161629 (view as bug list)
Depends On:
Blocks: 1427755
  Show dependency treegraph
 
Reported: 2014-11-07 09:03 EST by Sven Kieske
Modified: 2017-03-27 23:39 EDT (History)
14 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-02-01 09:53:06 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Virt
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
mgoldboi: ovirt‑4.1?
ipinto: testing_plan_complete+
ylavi: planning_ack?
rule-engine: devel_ack+
rule-engine: testing_ack+


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 58360 master MERGED core: Query VMs list on CREATED_BY_USER_ID 2016-06-16 04:40 EDT

  None (edit)
Description Sven Kieske 2014-11-07 09:03:47 EST
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 10:33:39 EST
Yaniv, is this information available in some existing report?
Comment 2 Sven Kieske 2014-11-07 11:05:09 EST
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 11:07:01 EST
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 11:13:38 EST
*** Bug 1161629 has been marked as a duplicate of this bug. ***
Comment 5 Yaniv Lavi 2014-11-08 18:31:46 EST
(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 04:07:12 EST
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 04:26:53 EST
(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 02:19:51 EST
so...the reporting solves this in a better way....
Comment 9 Sven Kieske 2014-11-10 02:36:56 EST
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 02:45:48 EST
just need to bear in mind the limitation when the user is removed/renamed
Comment 11 Michal Skrivanek 2014-12-01 07:50:44 EST
this is unlikely to be picked up for maintenance branch, so moving target release to 3.6
Comment 12 Michal Skrivanek 2015-06-05 07:44:21 EDT
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 06:55:56 EDT
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 08:57:55 EST
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 06:46:45 EST
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.