Bug 1619618 - There is no way how to refresh power state of a VM from SSUI
Summary: There is no way how to refresh power state of a VM from SSUI
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - Service
Version: 5.9.4
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: GA
: 5.11.0
Assignee: Jason Frey
QA Contact: Niyaz Akhtar Ansari
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-21 10:17 UTC by Jan Zmeskal
Modified: 2019-07-29 18:35 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-11 15:25:54 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Unknown power state in SSUI (152.00 KB, image/png)
2018-08-21 10:19 UTC, Jan Zmeskal
no flags Details
Unknown power state in Admin UI (192.05 KB, image/png)
2018-08-21 10:20 UTC, Jan Zmeskal
no flags Details
VM in SSUI after relationships/power state refresh (155.09 KB, image/png)
2018-08-21 10:22 UTC, Jan Zmeskal
no flags Details

Description Jan Zmeskal 2018-08-21 10:17:28 UTC
Description of problem:
If you go to SSUI -> My Services -> <some_service>, there is Resources section. It displays VMs and (among other things) their power state. It might happen that the power state is displayed as unknown while the actual VM is in reality started. That is a problem because it means you cannot stop it from SSUI. The option Stop in Power Operations button on the service view is disabled. And there is no way how to refresh the VM's power state from within SSUI.

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

How reproducible:
? 
I am not really sure how to reliably get to the state where power state of VM in SSUI is unknown. I think it might be caused by suer going to check VM in SSUI very quickly after it's provisioned, but I am not sure about it.

Steps to Reproduce:
In Admin UI:
1. Create a Service Dialog
1.1 Go to Automation -> Automate -> Customization -> Service Dialogs -> Configuration -> Add a New Dialog
1.2 Set Dialog's name (my_dialog). Add some element, e.g. Text Box.
2. Create a Service Catalog
2.1 Go to Services -> Catalogs -> Catalogs -> Configuration -> Add a New Catalog
2.2 Set Catalog's name (my_catalog) and click Add
3. Create Catalog Item
3.1 Go to Services -> Catalogs -> Catalog Items -> Add a New Catalog Item
3.2 Choose Catalog Item Type. In my case, I was using Red Hat Virtualization.
3.3 Set Catalog Item's name (my_catalog_item)
3.4 Set Display in Catalog to True
3.5 Set Catalog to my_catalog
3.6 Set Dialog to my_dialog
3.7 Fill in the Request Info tab. I did it in a way that the new VM was provisioned as a Native Clone from template. Make sure that VM is scheduled to start after provision. In the end, click Add.
4. Go to Services -> Catalogs -> Service Catalogs -> my_catalog -> my_catalog_item and click Order. Fill in something into Text Box and click Submit.
5. Wait for your provisioning request to finish.
In Self Service UI:
6. Go to My Services -> <your new service>
7. Check Resources section

Actual results:
From time to time (but still quite rarely) it happens that your newly provisioned VM has power state unknown in Resources section. Unfortunately, I don't know how to get to this state reliably. I discovered this while running test_service_start test case from integration_tests framework. Out of 10 executions, the unknown power state has been encountered twice. Anyway, unknown power state isn't the problem, the problem is that it cannot be refreshed from SSUI.

Expected results:
I'd like to have an option to refresh power state of VM from UI. Because if I am a consumer of service that does not have an access to the admin UI, I am stuck with this.

Additional info:
- Workaround: If you find your VM in admin UI and do Configuration -> Refresh Relationships and Power states, the power state is refreshed even in SSUI. However, this can only be applied if you actually have an access to admin UI.
- I have attached engine.log from RHV engine and also logs from appliance. If you want to search for a VM that led me to discovery of this bug, search for:
VM: test-serv--ocam0001
Catalog Item: 3O2sWWsWbj
Catalog: cat_BlWjNdYqHJ
- I have also attached some screenshots from admin and SSUI

Comment 5 Jan Zmeskal 2018-08-21 10:19:41 UTC
Created attachment 1477480 [details]
Unknown power state in SSUI

Comment 6 Jan Zmeskal 2018-08-21 10:20:28 UTC
Created attachment 1477481 [details]
Unknown power state in Admin UI

Comment 8 Jan Zmeskal 2018-08-21 10:22:03 UTC
Created attachment 1477483 [details]
VM in SSUI after relationships/power state refresh

Comment 10 Chris Hale 2018-09-13 17:50:14 UTC
Jason and I discussed the options for this functionality and where might be the appropriate place for this to be worked on and I am assigning the ticket to him to allow him to respond with this thoughts on how to proceed with this request.

Comment 11 Jason Frey 2018-09-13 17:57:13 UTC
It's ambiguous from your description what you mean by "option to refresh power state of VM from UI".  Do you mean a button to refetch the data from the CloudForms API (more like a browser refresh, but without refreshing the page), or do you mean something similar to the "Refresh Relationships and Power states" from the admin UI?

The admin UI button actually forces a full refresh of the provider.  Full refreshes can be very expensive, and we should probably not expose that to self-service end users because they can unintentionally cause the system to slow down. If RBAC'd properly I'd be surprised if any admin would even give the permission for this feature to an end user, so adding a button doesn't feel like the right approach.

What does feel like the right approach is investigating what circumstances cause the power state to be reported improperly, replicating that in-house, and then just fixing the actual underlying problem.

A couple of questions.
- Does the value also show as unknown in the admin UI at the same time?  The attached screen shot shows it as also unknown, but does it eventually resolve itself?
- If you literally refresh the page, does the power state eventually correct itself?

Comment 12 Jan Zmeskal 2018-09-14 09:31:15 UTC
Hi Jason,

> Do you mean a button to refetch the data from the CloudForms API?
Yes, that's pretty much what I had in mind.

> What does feel like the right approach is investigating what circumstances
> cause the power state to be reported improperly, replicating that in-house,
> and then just fixing the actual underlying problem.
If you believe this is the correct way to tackle the problem, we can probably just re-state the problem defined in this bug and go this way.

> - Does the value also show as unknown in the admin UI at the same time?  The
> attached screen shot shows it as also unknown, but does it eventually
> resolve itself?
> - If you literally refresh the page, does the power state eventually correct
> itself?
The Unknown state can be seen at the same time in admin UI. However, the correct state (in this case ON) will eventually get displayed in the Admin UI. However, *only after* you refresh the VM details page.

Jan


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