Horizon crashes when a non-admin user try to resize a locked instance

Bug #1433847 reported by Kahou Lei
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
In Progress
Medium
wei.ying

Bug Description

Steps to reproduce:

1. Login as admin
2. Boot an instance.
3. Lock an instance.
4. Resize that instance.
5. While that instance is in "Confirm" state, logout and login as a non-admin user.
6. Go to the instance panel and notice that the instance has "Confirm Resize" action enabled.
7. Click the action and Horizon crash.

The problem is due to nova client doesn't have the lock state report to the GUI and that's why we cannot filter out the action.

Tags: nova
Kahou Lei (kahou82)
description: updated
tags: added: nova
Changed in horizon:
importance: Undecided → Medium
Revision history for this message
wei.ying (wei.yy) wrote :

The non-admin does not allow operation the locked instance, including the following actions:
StartInstance: https://github.com/openstack/nova/blob/master/nova/compute/api.py#L2178
ConfirmResize: https://github.com/openstack/nova/blob/master/nova/compute/api.py#L3015
RevertResize: https://github.com/openstack/nova/blob/master/nova/compute/api.py#L2985
AttachInterface: https://github.com/openstack/nova/blob/master/nova/compute/api.py#L3714
DetachInterface: https://github.com/openstack/nova/blob/master/nova/compute/api.py#L3725
AttachVolume: https://github.com/openstack/nova/blob/master/nova/compute/api.py#L3580
DetachVolume: https://github.com/openstack/nova/blob/master/nova/compute/api.py#L3648
UpdateMetadata: https://github.com/openstack/nova/blob/master/nova/compute/api.py#L3749
TogglePause: https://github.com/openstack/nova/blob/master/nova/compute/api.py#L3233
ToggleSuspend: https://github.com/openstack/nova/blob/master/nova/compute/api.py#L3264
ToggleShelve: https://github.com/openstack/nova/blob/master/nova/compute/api.py#L3166
ResizeLink: https://github.com/openstack/nova/blob/master/nova/compute/api.py#L3061
SoftRebootInstance: https://github.com/openstack/nova/blob/master/nova/compute/api.py#L2817
RebootInstance: https://github.com/openstack/nova/blob/master/nova/compute/api.py#L2817
StopInstance: https://github.com/openstack/nova/blob/master/nova/compute/api.py#L2170
RebuildInstance: https://github.com/openstack/nova/blob/master/nova/compute/api.py#L2858
DeleteInstance: https://github.com/openstack/nova/blob/master/nova/compute/api.py#L2115

Changed in horizon:
assignee: nobody → wei.ying (wei.yy)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/512019

Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (master)

Change abandoned by Ivan Kolodyazhny (<email address hidden>) on branch: master
Review: https://review.openstack.org/512019
Reason: This review is > 4 months without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Revision history for this message
Sarojini Annem (sarojini) wrote :

Add new attribute 'locked' in server detail response which will provide instance lock information. When user query about instance(List detail or Show) locked information will return in response.We could have provide lock information by exposing 'lock-by' directly, which will help to know complete instance lock information(Locked by whom, timestamp, Lock information etc.,)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by "wei.ying <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/horizon/+/512019
Reason: No plan to continue processing this patch.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.