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 {} ~~~
vdsm-client is maintained by the infra team, if the Engine doesn't correctly clears ended tasks then it is indeed a bug
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.
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?
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?
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".
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?
Bimal, please add this step to a KCS and we can close this BZ. Thanks!
Closing as BZ1631587 is included in RHV 4.3 GA, so clearing task can be easily done using vdsm-client