Bug 962864 - [RFE] Create a "User" page for linking IDs to names more easily
Summary: [RFE] Create a "User" page for linking IDs to names more easily
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-django-horizon
Version: 7.0 (Kilo)
Hardware: All
OS: All
high
low
Target Milestone: z1
: 11.0 (Ocata)
Assignee: Radomir Dopieralski
QA Contact: Ola Pavlenko
URL:
Whiteboard:
Depends On:
Blocks: 1426485
TreeView+ depends on / blocked
 
Reported: 2013-05-14 15:38 UTC by Dan Yocum
Modified: 2019-04-16 14:02 UTC (History)
24 users (show)

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.
Clone Of:
Environment:
Last Closed: 2017-07-19 17:04:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1380595 0 None None None Never
Launchpad 1524734 0 None None None Never
OpenStack gerrit 396649 0 None None None 2016-11-11 14:27:15 UTC
Red Hat Product Errata RHBA-2017:1781 0 normal SHIPPED_LIVE python-django-horizon bug fix advisory 2017-07-19 21:01:10 UTC

Description Dan Yocum 2013-05-14 15:38:56 UTC
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 17:08:54 UTC
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 19:01:14 UTC
Hm.  I see your point.

Can you request a database view that you can query against?

Comment 4 Matthias Runge 2013-05-15 09:49:37 UTC
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 10:02:54 UTC
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 14:39:19 UTC
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 16:05:43 UTC
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 12:43:38 UTC
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 09:01:57 UTC
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 07:38:12 UTC
Users page feature was merged into kilo.

New features are not applicable for backports.

Comment 23 Arthur Berezin 2015-03-18 14:59:59 UTC
Fixed in Upstream Kilo, removing rhos-future flag.

Comment 24 Ido Ovadia 2015-07-28 12:54:17 UTC
Failed QA
========= 
python-django-horizon-2015.1.0-10.el7ost.noarch
openstack-dashboard-theme-2015.1.0-10.el7ost.noarch
openstack-dashboard-2015.1.0-10.el7ost.noarch

Tested with RHOS theme, there is no User column

Comment 25 Jon Schlueter 2015-07-30 17:43:08 UTC
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 07:52:04 UTC
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 11:24:56 UTC
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 07:18:53 UTC
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 08:55:45 UTC
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 13:33:47 UTC
Patch upstream missed Mitaka

Comment 31 Jason E. Rist 2016-09-21 15:13:23 UTC
Radomir can you see if there is anything we need to do for this?

Comment 32 Radomir Dopieralski 2016-09-21 15:32:44 UTC
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 15:21:51 UTC
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 15:24:20 UTC
(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 14:26:24 UTC
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 08:11:23 UTC
The change has merged upstream.

Comment 41 Radomir Dopieralski 2017-04-28 12:17:37 UTC
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 14:47:00 UTC
The User ID is a string, and not a link.  This is version 11.0.1

Comment 50 Radomir Dopieralski 2017-05-03 10:58:20 UTC
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 17:04:11 UTC
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.

https://access.redhat.com/errata/RHBA-2017:1781


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