Clear stale tasks from the vCenter "Recent Tasks" panel
search cancel

Clear stale tasks from the vCenter "Recent Tasks" panel

book

Article ID: 388665

calendar_today

Updated On:

Products

VMware vCenter Server VMware vCenter Server 7.0 VMware vCenter Server 8.0 VMware vSphere ESXi 7.0 VMware vSphere ESXi 8.0

Issue/Introduction

This KB article provides the steps for clearing a stale, or otherwise stuck task from the vCenter "Recent Tasks" panel.

 

Please see the other common stuck or stale task KB's below:

Troubleshooting virtual machine power on task hangs (342633)
HA configuration task is stuck for long time or fails with Configuration error after an ESXi host update in the cluster (369999)
ESXi host stuck "in progress" when entering maintenance mode (318773)
Clear any stale backup tasks from vCenter UI. (378061)
[VMC on AWS] Clear stale HCX tasks within vCenter (319152)
[VMC] SRM task hung on vCenter Server (335248)
Stuck tasks -- "Recompute Datastore Groups" and "Recompute Device Groups" in vSphere Client (384687)

 

Important: Do not cancel snapshot consolidation tasks. Doing so has a high chance of corrupting the VMs virtual disks.
You can monitor the consolidation task progress using the commands in Collecting information about tasks in VMware ESXi

If a snapshot consolidation task is stuck you can review the below KB's or open a case with Broadcom Support for assistance.

Snapshot removal task stops at 99% (341355) - From the KB: The is no way to stop or cancel the consolidation process without risking data corruption.
Unable to power on a virtual machine after cancelling snapshot consolidation (318793) - From the KB: These processes should not be cancelled at any time. Cancelling these processes has a very high chance of causing virtual disk corruption.

Resolution

How to clear a hung, stuck, or stale task from the "Recent Tasks" panel

Before removal of the stale task validate if the task in question has completed successfully or not. If it did not complete and is still present in the Recent Tasks panel then proceed with the following steps.

Additionally before making changes to the vCenter Server ensure to take a valid snapshot of the vCenter Server Virtual Machine. If the vCenter is in Enhanced Linked Mode (ELM), take offline snapshot of all vCenter Servers in the Single Sign-on domain, for more details please see: VMware vCenter in Enhanced Linked Mode pre-changes snapshot (online or offline) best practice 

 

Restarting services to clear a stale task

The first method to clear a stuck task is to restart the vsphere-ui and vpxd services. To clear a stale task without a restart of these services see the next section "Using the Managed Object Browser (MOB) Task Manager to clear a stale task"

  1. Restart the vsphere-ui service with this command:
    service-control --stop vsphere-ui && service-control --start vsphere-ui
  2. Once the vsphere-ui service has been resarted log back into the vCenter Web client and check the status of the task.
  3. If the task is still present then restart the vmware-vpxd service with this command:
    service-control --stop vmware-vpxd && service-control --start vmware-vpxd
  4. If the above steps do not work in clearing the task, refer to the additional method below.

 

Using the Managed Object Browser (MOB) Task Manager to clear a stale task

The second method to clear a stale task is to use the MOB Task Manager and modify the task state directly to success.

  1. Open the vCenter MOB Task Manager - https://vcenter_FQDN>/mob/?moid=TaskManager   
      1. It will prompt for Administrator credentials. Enter your fully qualified SSO Administrator credentials. (Example: [email protected])
    1. Manually inspect the individual tasks listed in the recentTask field to locate the stale task.
      1. After clicking on a task ID (Example: task-####), clicking info in the TaskInfo property it will display further details about the task descriptionId, current state, and startTime.
      2. Use the details in the TaskInfo property to confirm you have selected the correct task. 
    2. Once the task is identified, invoke SetTaskState in the Methods section for the task.
    3. Invoke SetTaskState with the following parameters:
      1. In the state parameter enter the value: success
      2. Empty any values listed in the result or fault parameters.
      3. Confirm that the state value is success and no other values are entered in the other boxes, press Invoke Method at the bottom of the SetTaskState pop up window, and the task sate will be set to Success.
    4. Refresh the vCenter UI and the stale task should clear from the Recent Tasks panel.

Additional Information

If removing the stale task within the vCenter is not successful, please create an SR (Creating and managing Broadcom support cases) with Broadcom Support for further assistance clearing the stale task from vCenter.