Bug 1609953 - vdsm-client tasks that are started manually and they finish successfully, the tasks should be cleared.
Summary: vdsm-client tasks that are started manually and they finish successfully, the...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: vdsm
Version: 4.2.6
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Marcin Sobczyk
QA Contact: Elad
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-30 21:41 UTC by Bimal Chollera
Modified: 2024-06-13 21:57 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-29 09:13:57 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1627997 0 unspecified CLOSED [RFE] Allow SPM switching if all tasks have finished via REST-API 2024-06-13 21:58:30 UTC
Red Hat Issue Tracker RHV-43570 0 None None None 2021-09-09 15:15:31 UTC
Red Hat Knowledge Base (Solution) 3663541 0 Configure None vdsm does not clear tasks if they are manually started and finished successfully 2019-03-07 23:34:27 UTC
Red Hat Knowledge Base (Solution) 3970951 0 Supportability None Unable to switch SPM host role or place the SPM host into maintenance. 2019-03-07 23:33:07 UTC

Internal Links: 1627997

Description Bimal Chollera 2018-07-30 21:41:22 UTC
Description of problem:

If a vdsm-client task such as 'Volume delete' or 'Image delete' is started manually and it finishes successfully, then the 'Task clear' should be run automatically to clear the tasks.  Shouldn't require it to run manually.

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

vdsm-client-4.20.27.1-1.el7ev.noarch

How reproducible:
100%

Steps to Reproduce:

1.  Use the vdsm-client Volume delete command to delete a volume

~~~
# vdsm-client Volume delete storagedomainID=fad6f70d-af71-4698-bcba-f0b561f66773 storagepoolID=a4160a14-6064-11e8-ae64-00163e372e70 imageID=71540621-2cac-4aea-9550-28661a336c35 volumeID=d031394c-13a7-4499-aa7f-cb4e1e5a8605 postZero=False
~~~

2.  The vdsm logs indicate the task finished but getAllTasksStatuses continues to list the task.

~~~
2018-07-30 12:49:35,554-0400 INFO  (jsonrpc/5) [vdsm.api] START deleteVolume(sdUUID=u'fad6f70d-af71-4698-bcba-f0b561f66773', spUUID=u'a4160a14-6064-11e8-ae64-00163e372e70', imgUUID=u'71540621-2cac-4aea-9550-28661a336c35', volumes=[u'd031394c-13a7-4499-aa7f-cb4e1e5a8605'], postZero=u'False', force=False, discard=False) from=::1,51354, task_id=5103cfb1-2abc-4d02-99ad-aeb4adc07847 (api:46)

2018-07-30 12:49:35,684-0400 INFO  (jsonrpc/5) [vdsm.api] FINISH deleteVolume return=None from=::1,51354, task_id=5103cfb1-2abc-4d02-99ad-aeb4adc07847 (api:52)

2018-07-30 12:49:35,995-0400 INFO  (tasks/8) [storage.ThreadPool.WorkerThread] START task 5103cfb1-2abc-4d02-99ad-aeb4adc07847 (cmd=<bound method Task.commit of <vdsm.storage.task.Task instance at 0x7f4c13e7fcb0>>, args=None) (threadPool:208)

2018-07-30 12:49:36,493-0400 INFO  (tasks/8) [storage.ThreadPool.WorkerThread] FINISH task 5103cfb1-2abc-4d02-99ad-aeb4adc07847 (threadPool:210)

...

2018-07-30 17:45:47,096-0400INFO  (jsonrpc/7) [vdsm.api] START getAllTasksStatuses(spUUID=None, options=None) from=::1,51386, task_id=fc898a8a-af3c-4d35-afdf-591019ea6dca (api:46)

2018-07-30 17:45:47,096-0400 INFO  (jsonrpc/7) [vdsm.api] FINISH getAllTasksStatuses return={'allTasksStatus': {'5103cfb1-2abc-4d02-99ad-aeb4adc07847': {'code': 0, 'message': '1 jobs completed successfully', 'taskState': 'finished', 'taskResult': 'success', 'taskID': '5103cfb1-2abc-4d02-99ad-aeb4adc07847'}}} from=::1,50154, task_id=fc898a8a-af3c-4d35-afdf-591019ea6dca (api:52)
~~~

3.  Check the task status.

~~~
# vdsm-client Host getAllTasksStatuses
{
    "5103cfb1-2abc-4d02-99ad-aeb4adc07847": {
        "message": "1 jobs completed successfully", 
        "code": 0, 
        "taskID": "5103cfb1-2abc-4d02-99ad-aeb4adc07847", 
        "taskResult": "success", 
        "taskState": "finished"
    }
}
~~~


Actual results:

After the task has been finished successfully, getAllTaskStatuses continues to reflect the finished tasks.

Expected results:

If the task finish successfully, 'Task clear' should run to remove it automatically.

Additional info:

Workaround is to manually run the 'Task clear' command.

~~~
# vdsm-client Task clear taskID=5103cfb1-2abc-4d02-99ad-aeb4adc07847
true

# vdsm-client Host getAllTasksStatuses
{}
~~~

Comment 3 Tal Nisan 2018-07-31 11:20:16 UTC
vdsm-client is maintained by the infra team, if the Engine doesn't correctly clears ended tasks then it is indeed a bug

Comment 4 Ravi Nori 2018-08-06 11:34:42 UTC
vdsm-client is not intended to be used directly by end user. From engine point of view the tasks on vdsm side should not be cleaned up automatically, the engine execute the tasks and then gets the status of the tasks before executing the cleanup. If the tasks are cleaned up automatically on the vdsm side, engine won't be able to get the status of the tasks on the next polling.

Comment 5 Marina Kalinin 2018-08-29 21:52:21 UTC
Ravi, please read comment 1.
Maybe we can add a flag to vdsm-client to run Task Clear command after the task is done (that will require vdsm-client to monitor the task, too)?

If this is too much work and outside of scope of vdsm-client, probably we need to add this to our workflow and do the manual task cleaning. Which can be challenging, since customer may abandon the case, once the main issue is resolved. Bimal, any other suggestions here?

Comment 9 Martin Perina 2019-01-28 09:37:20 UTC
There is no difference between task started on engine or using vdsm-client. If task started from engine fisnishes successfully, engine sends VDSM verb to remove that finished task from VDSM. So tasks created from vdsm-client should behave the same, administrator which created them needs to manually remove them using vdsm-client

Marcin, could you please sync with Ravi and provide examples using vdsm-client how to find out if task is finished and how to remove finished task?

Comment 11 Marcin Sobczyk 2019-02-20 16:45:00 UTC
The examples are already provided by Bimal. The proper way of clearing tasks is to manually call 'vdsm-client Task clear ...'. Closing this as "wont fix".

Comment 12 Martin Perina 2019-02-20 19:00:45 UTC
The flow for engine <-> VDSM communication is described above:

1. engine creates a task on VDSM
2. engine monitors execution status of each task it executed
3. Once task is reported as finished, engine sends command to VDSM to clear this finished task

vdsm-client is developer only tool and it only uses the API which VDSM provides. We are not going to developer any special flow for vdsm-client <-> vdsm communication, vdsm-client needs to use the same flow as engine, so anyone who create a task using vdsm-client is responsible to clear this task once it's finished.

Moran, do you agree with closing that bug?

Comment 13 Marina Kalinin 2019-02-28 20:45:13 UTC
Bimal, please add this step to a KCS and we can close this BZ.
Thanks!

Comment 17 Martin Perina 2019-03-29 09:13:57 UTC
Closing as BZ1631587 is included in RHV 4.3 GA, so clearing task can be easily done using vdsm-client


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