Bug 1910302

Summary: [RFE] Allow SPM switching if all tasks have finished via UI
Product: Red Hat Enterprise Virtualization Manager Reporter: Pavel Bar <pbar>
Component: ovirt-engineAssignee: Pavel Bar <pbar>
Status: CLOSED ERRATA QA Contact: Evelina Shames <eshames>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2.6CC: dfodor, emarcus, eshenitz, pelauter, sfishbai
Target Milestone: ovirt-4.4.5Keywords: FutureFeature, ZStream
Target Release: 4.4.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Previously, the storage pool manager (SPM) failed to switch to another host if the SPM had uncleared tasks. With this enhancement, a new UI menu has been added to enable cleaning up finished tasks.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-14 11:40:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pavel Bar 2020-12-23 11:22:14 UTC
Description of problem:

Continued work on #1627997.
Implementing an option to trigger the finished tasks cleanup via UI.

Comment 1 Pavel Bar 2021-02-04 14:18:07 UTC
Verification flow for QE - mostly copied from https://bugzilla.redhat.com/show_bug.cgi?id=1627997, only step #11 is different:
Please try the following:
1) Run the engine, add a host and a Storage Domain.
2) Open the CLI terminal to the host via ssh.
3) Execute on the host the following command:
$ vdsm-client Host getAllTasksStatuses
You should probably see an empty response, i.e., "{}". That's good, now you can continue.
4) Start adding a new disk: Storage --> Disks --> New. Don't press "OK" just yet.

The following steps need to be done fast, I used breakpoints to stop the flow where I need it, so I was more lucky :)
5) Press "OK" to finish adding a disk.
6) Go to the host CLI and see the response:
$ vdsm-client Host getAllTasksStatuses
It should be something like that:
{
    "1dc4d885-577a-4b6a-b01f-e682602a907c": {
        "code": 0,
        "message": "1 jobs completed successfully",
        "taskID": "1dc4d885-577a-4b6a-b01f-e682602a907c",
        "taskResult": "success",
        "taskState": "finished"
    }
}
7) Kill the engine as fast as possible: CTRL+C.
8) After the engine stops verify that there still a finished task on the host (same command as mentioned above), that is you don't receive an empty result "{}". If that doesn't happen, try not to execute step #6 in order to save time, simply press "OK" and kill engine after 1 second or faster.
9) Start the engine, wait until it's up.
10) Verify (again) that there still a finished task on the host, as in step #6.
11) Go to the engine UI: Compute --> Data Centers.
  11a) Select the relevant Data Center (where host with SPM runs) and via the menu you can "Cleanup Finished Tasks".
  11b) You can also run flows with a multiple selection of Data Centers (the "Cleanup Finished Tasks" commands runs in parallel on all of them). Worth checking.
  11c) The "Cleanup Finished Tasks" menu is allowed only if *all* the selected Data Centers are active. If at least one is not active the menu is greyed-out/inactive. Also worth checking :)
12) Verify (using the above command) that there are NO finished tasks on the host (that means all were cleared by the command that you executed from the UI menu) and you receive an empty response as it was at the beginning: "{}".

Comment 5 Evelina Shames 2021-02-14 11:43:25 UTC
(In reply to Pavel Bar from comment #1)
> Verification flow for QE - mostly copied from
> https://bugzilla.redhat.com/show_bug.cgi?id=1627997, only step #11 is
> different:
> Please try the following:
> 1) Run the engine, add a host and a Storage Domain.
> 2) Open the CLI terminal to the host via ssh.
> 3) Execute on the host the following command:
> $ vdsm-client Host getAllTasksStatuses
> You should probably see an empty response, i.e., "{}". That's good, now you
> can continue.
> 4) Start adding a new disk: Storage --> Disks --> New. Don't press "OK" just
> yet.
> 
> The following steps need to be done fast, I used breakpoints to stop the
> flow where I need it, so I was more lucky :)
> 5) Press "OK" to finish adding a disk.
> 6) Go to the host CLI and see the response:
> $ vdsm-client Host getAllTasksStatuses
> It should be something like that:
> {
>     "1dc4d885-577a-4b6a-b01f-e682602a907c": {
>         "code": 0,
>         "message": "1 jobs completed successfully",
>         "taskID": "1dc4d885-577a-4b6a-b01f-e682602a907c",
>         "taskResult": "success",
>         "taskState": "finished"
>     }
> }
> 7) Kill the engine as fast as possible: CTRL+C.
> 8) After the engine stops verify that there still a finished task on the
> host (same command as mentioned above), that is you don't receive an empty
> result "{}". If that doesn't happen, try not to execute step #6 in order to
> save time, simply press "OK" and kill engine after 1 second or faster.
> 9) Start the engine, wait until it's up.
> 10) Verify (again) that there still a finished task on the host, as in step
> #6.
> 11) Go to the engine UI: Compute --> Data Centers.
>   11a) Select the relevant Data Center (where host with SPM runs) and via
> the menu you can "Cleanup Finished Tasks".
>   11b) You can also run flows with a multiple selection of Data Centers (the
> "Cleanup Finished Tasks" commands runs in parallel on all of them). Worth
> checking.
>   11c) The "Cleanup Finished Tasks" menu is allowed only if *all* the
> selected Data Centers are active. If at least one is not active the menu is
> greyed-out/inactive. Also worth checking :)
> 12) Verify (using the above command) that there are NO finished tasks on the
> host (that means all were cleared by the command that you executed from the
> UI menu) and you receive an empty response as it was at the beginning: "{}".

Verified on:
vdsm-4.40.50.4-1.el8ev.x86_64
ovirt-engine-4.4.5.4-0.6.el8ev.noarch

Moving to 'VERIFIED'.

Comment 11 errata-xmlrpc 2021-04-14 11:40:02 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 (Moderate: RHV Manager (ovirt-engine) 4.4.z [ovirt-4.4.5] security, bug fix, enhancement), 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/RHSA-2021:1169