Bug 962864 - [RFE] Create a "User" page for linking IDs to names more easily
[RFE] Create a "User" page for linking IDs to names more easily
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-django-horizon (Show other bugs)
7.0 (Kilo)
All All
high Severity low
: z1
: 11.0 (Ocata)
Assigned To: Radomir Dopieralski
Ola Pavlenko
: FutureFeature, OtherQA, Triaged, ZStream
Depends On:
Blocks: 1426485
  Show dependency treegraph
Reported: 2013-05-14 11:38 EDT by Dan Yocum
Modified: 2017-07-19 13:04 EDT (History)
24 users (show)

See Also:
Fixed In Version: python-django-horizon-11.0.0-0.20170131043553.aa444a6.el7ost
Doc Type: Enhancement
Doc Text:
This update adds a new user details page to the dashboard. As a result you can click on the user ID in the Action Log to be taken directly to the user details page.
Story Points: ---
Clone Of:
Last Closed: 2017-07-19 13:04:11 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Launchpad 1380595 None None None Never
Launchpad 1524734 None None None Never
OpenStack gerrit 396649 None None None 2016-11-11 09:27 EST

  None (edit)
Description Dan Yocum 2013-05-14 11:38:56 EDT
Description of problem:

In the admin tab, on the instances page, I would really like to see a column containing the name of the user who launched the VM.  

Also, I don't care what ssh key is being used - nix that column.
Comment 2 Julie Pichon 2013-05-14 13:08:54 EDT
Agreed it would be useful. It's currently quite costly to retrieve the name of the user since we only get an id back from the instance list (cf. https://github.com/openstack/horizon/blob/stable/folsom/horizon/dashboards/syspanel/instances/tables.py#L60)
Comment 3 Dan Yocum 2013-05-14 15:01:14 EDT
Hm.  I see your point.

Can you request a database view that you can query against?
Comment 4 Matthias Runge 2013-05-15 05:49:37 EDT
Horizon runs without database access at all. I'm not sure, if it is implemented in keystone to look up an ID.
Comment 5 Julie Pichon 2013-05-15 06:02:54 EDT
I believe it's possible to do this but it doesn't scale well, which is why it was removed upstream. We're dependent on the existing client APIs to return that information in a more practical way.
Comment 6 Dan Yocum 2013-05-15 10:39:19 EDT
I get that it's an expensive operation using the available api.  I also humbly request that it would be good to add new views and apis to make these features available to OpenStack admins.
Comment 10 Julie Pichon 2014-05-28 12:05:43 EDT
I think this really is the kind of things the customisation module should be used for. You can find more information about it in the upstream docs at http://docs.openstack.org/developer/horizon/topics/customizing.html#modifying-existing-dashboards-and-panels .

In this case you would extend the table(s) you want to change in the overrides file, and then make sure the new classes are being used instead of the default Horizon ones:

    from django.utils.translation import ugettext_lazy as _

    from horizon import tables

    from openstack_dashboard.dashboards.admin.instances import tables as admin_tables
    from openstack_dashboard.dashboards.admin.instances import views

    # Extend the existing class
    class MyAdminInstancesTable(admin_tables.AdminInstancesTable):
        user = tables.Column("user_id", verbose_name=_("User"))

        class Meta(admin_tables.AdminInstancesTable.Meta):
            # Decide what columns to display, in which order, and/or
            # "remove" a column from the table (like e.g. image_name here)
            columns = ('tenant', 'user', 'ip', 'host', 'name',
                       'status', 'task', 'state', 'created')

   # Tell Horizon to use this new class instead for the Admin view
   views.AdminIndexView.table_class = MyAdminInstancesTable

The customisation module path in the local settings needs to be an importable Python module.

With regard to showing the user as username, you could do something similar to what is done for the project names ( https://github.com/openstack/horizon/blob/93d4285249/openstack_dashboard/dashboards/admin/instances/views.py#L101 ).

Keeping in mind that this doesn't scale well (cf. https://github.com/openstack/horizon/blob/93d4285249/openstack_dashboard/dashboards/admin/instances/tables.py#L123 ). I realise it is much more useful to see names rather than IDs, however we get the instances list with user ids from Nova, while the user names live in Keystone. These are 2 separate services with 2 separate databases and I'm not sure what can be done besides expensively correlating ids to names, which can be done in the customisation module if the performance hit is acceptable in your deployment.

With regard to the second request, I know of companies that would rely on the ssh key column in their workflow to derive information about an instance (e.g. these servers run with the production keys, these ones are test, these ones are personal dev accounts). I think there's no way for upstream to determine a default set of columns that will work for everyone, and rather than shuffling the columns every release, per-deployment customisations make more sense and should be used in this case.

I hope this helps. I'd like to close the bug with this workaround, and I'm happy to try and help if questions come up working with the customisation module. Thank you.
Comment 18 Julie Pichon 2014-10-13 08:43:38 EDT
The upstream Feature Freeze for 6.0 was on September 4th, so I'm switching the flags (will move to 7.0 once the target is created). Now that we've clarified the goal into feasible tasks, I created the upstream tasks to track this and don't think I need any further information at this point, thank you.
Comment 20 Julie Pichon 2015-01-02 04:01:57 EST
There is a link to the Launchpad bug ID in the External Trackers, for adding a user details page: https://bugs.launchpad.net/horizon/+bug/1380595 . Looking at it now, there is an associated patch and it looks very close to being merged, so I would expect it to land in Kilo.
Comment 22 Matthias Runge 2015-02-16 02:38:12 EST
Users page feature was merged into kilo.

New features are not applicable for backports.
Comment 23 Arthur Berezin 2015-03-18 10:59:59 EDT
Fixed in Upstream Kilo, removing rhos-future flag.
Comment 24 Ido Ovadia 2015-07-28 08:54:17 EDT
Failed QA

Tested with RHOS theme, there is no User column
Comment 25 Jon Schlueter 2015-07-30 13:43:08 EDT
From comment 20 and 21 above I was able to see that the upstream request https://bugs.launchpad.net/horizon/+bug/1380595 has been closed and is part as kilo.  From other comments I see they were looking for way to drill down to the user information associated with a instance from the Admin tab.  

Comment 10 provides an alternative using customization module (http://docs.openstack.org/developer/horizon/topics/customizing.html#modifying-existing-dashboards-and-panels) as way to get some of the details without upstream changes.

From the comments this RFE is looking to add a way to drill down to user information associated with an instance.

There is  from Admin tab -> Instances -> pick an instance -> action log

This page does show user ID for actions on the instance, but not a user name.

What is this RFE trying to address and what is expected to close out this RFE?
Comment 26 Matthias Runge 2015-08-06 03:52:04 EDT
A user page was added upstream, displaying user info. That is exactly, what the title says here: Create a "User" page for linking IDs to names more easily.
Comment 27 Matthias Runge 2015-08-12 07:24:56 EDT
It would be handy to have a list of instances run by the user <foo>

Nova exposes that function
nova list --user fac5fb85d6f64607bef7772f646f9ee6

[root@euler ~(keystone_admin)]# nova show 499026c1-f219-4027-b143-466220502d56
| Property                             | Value                                                    |
| OS-DCF:diskConfig                    | 
......                                                          |
| user_id                              | fac5fb85d6f64607bef7772f646f9ee6                         |

nova show also exposes the user_id.
Comment 28 Matthias Runge 2015-10-14 03:18:53 EDT
since upstream believes, this rfe is implemented, there was no action on this during liberty cycle.

Either, we'll close it as implemented, or there should be clearly stated, what's missing and target release needs to be moved to 9.0
Comment 29 Matthias Runge 2015-10-14 04:55:45 EDT
A proposal to solve this would be to add a link from the user id in the action log directly to the user. Adding the user name to the action log itself can't hurt.

For reasons listed above, adding the user id directly to the instances list would hurt performance.
Comment 30 Matthias Runge 2016-04-20 09:33:47 EDT
Patch upstream missed Mitaka
Comment 31 Jason E. Rist 2016-09-21 11:13:23 EDT
Radomir can you see if there is anything we need to do for this?
Comment 32 Radomir Dopieralski 2016-09-21 11:32:44 EDT
There is a patch upstream, and it received some reviews (5 +1s), but there has been no activity since 4 months, and seems that no core reviewed it. I think I can pick it up, clean it up and fish for reviews.
Comment 34 Jason E. Rist 2016-10-25 11:21:51 EDT
I tried to move it to 11 but the rules engine moved it back.  Scott - what does "A1" mean?

Also how could this have FailedQA if QA Whiteboard says "NotStarted"
Comment 35 Scott Lewis 2016-10-25 11:24:20 EDT
(In reply to Jason E. Rist from comment #34)
> I tried to move it to 11 but the rules engine moved it back.  Scott - what
> does "A1" mean?
> Also how could this have FailedQA if QA Whiteboard says "NotStarted"

If you want to move it to 11, you need to add the "Triaged" keyword. (I've added it for you).

"A1" is an old designation we used to use for our planned maintenance/z-stream releases.
Comment 36 Radomir Dopieralski 2016-11-11 09:26:24 EST
Adding a link to the user details page to the action log: https://review.openstack.org/#/c/396649/
Comment 37 Radomir Dopieralski 2016-11-14 03:11:23 EST
The change has merged upstream.
Comment 41 Radomir Dopieralski 2017-04-28 08:17:37 EDT
How to test:

* Launch an instance.
* Go to the instance's details page.
* Switch to the action log tab.
* Verify that the UUID of the user is a link leading to the user's page.
Comment 42 Honza Pokorny 2017-04-28 10:47:00 EDT
The User ID is a string, and not a link.  This is version 11.0.1
Comment 50 Radomir Dopieralski 2017-05-03 06:58:20 EDT
The patch that implemented this got partially undone by the fix for this: https://bugs.launchpad.net/horizon/+bug/1667154

The link to the user page is not present under Project→Instances→instance→Action Log, but is there under Admin→Instances→instance→Action Log. That is because regular users don't usually have the permission to view the user page anyways.
Comment 53 errata-xmlrpc 2017-07-19 13:04:11 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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