Nutanix: Remove Stuck Tasks

Don't try this at home
The technical indications given in this article are risky and may lead to the instability of your Nutanix cluster in case of error. Contact Nutanix support first!
Sometimes tasks may be stuck indefinitely on your cluster without ever completing or failing. In this case, you need to take manual action to resolve the issue.

Be careful, this operation is not without risks, which is why I strongly advise you to contact Nutanix support if you are not sure.
The first step is to check how long the task has been running. To do this, go to the tasks page and filter on the tasks currently running:

In this case, we can see that the task has been running for more than 10 months. No doubt, it is crashed and must be canceled manually.
To do this, you must connect to one of the CVMs and type the following command:
nutanix@CVM:~$ ecli task.list include_completed=false
You should have a return that looks like this:
Task UUID Parent Task UUID Component Sequence-id Type Status
37a430d3-b80b-4ae7-bfaf-9df5247e9ce7 Nutanix Guest Tools 282 MountGuestTools kQueued
Retrieve the UUID of the affected task and type the following command:
ergon_update_task –task_uuid='TASK_UUID' –task_status=aborted
In my case, that’s the command is need to execute:
ergon_update_task –task_uuid='37a430d3-b80b-4ae7-bfaf-9df5247e9ce7' –task_status=aborted
This will force the currently running task to be canceled.
0 comments