When working with vCenter, you’ll occasionally encounter the “Task was cancelled by an administrator” error message. This error occurs more frequently than you might expect, particularly during time-intensive operations like snapshot tasks or VM migrations. Many administrators struggle with this issue, but fortunately, several effective resolution methods are available. Today we’ll explore step-by-step solutions to safely and reliably resolve these situations.
Primary Causes of Task Cancellation Errors
Task cancellation errors in vCenter can occur for various reasons:
- Timeout Issues: Operations exceeding vCenter’s default timeout setting (15 minutes)
- Resource Conflicts: Multiple simultaneous tasks running on the same object
- Network Connectivity Problems: Communication failures between vCenter and ESXi hosts
- Backup Software Interference: Backup programs locking VM files
- Snapshot-Related Operations: Interruptions during large snapshot creation/deletion processes
Cause | Frequency | Resolution Difficulty |
---|---|---|
Timeout Issues | High | Moderate |
Resource Conflicts | Moderate | Easy |
Network Problems | Low | Difficult |
Backup Interference | Moderate | Easy |
Snapshot Issues | High | Difficult |
1. Basic Resolution Through vSphere Client UI
The first approach to try is resolving the issue through the vSphere Client user interface.
Direct Cancellation from Recent Tasks Panel
- Log into vSphere Client and navigate to Menu → Administration → Recent Tasks
- Locate the problematic task and click the cancel button next to the progress bar in the Status column
- Verify that the task cancels successfully
Finding Specific Problem Tasks Through Task Filtering
In complex environments, filtering tasks helps identify issues efficiently:
- Click the Monitor tab → Tasks
- Open the Filter Tasks dialog box
- Select relevant statuses from the Status options
- Choose between system or user tasks from the Type dropdown
2. Resolution Through vCenter Service Restart
When UI methods don’t work, restarting vCenter services can be effective.
Single Service Restart
SSH into the vCenter Server and execute these commands:
# Restart only vpxd service
service-control --stop vmware-vpxd && service-control --start vmware-vpxd
# Restart both vSphere UI service (recommended)
service-control --stop vmware-vpxd
service-control --stop vsphere-ui
service-control --start vmware-vpxd
service-control --start vsphere-ui
Complete Service Restart
For a more comprehensive approach, restart all vCenter services:
service-control --stop && service-control --start
⚠️ Warning: Service restart will temporarily make vCenter inaccessible, so schedule this during maintenance windows or off-hours.
3. Advanced Resolution Using MOB (Managed Object Browser)
When UI methods and service restarts don’t resolve the issue, use MOB to directly change task states.
Accessing MOB and Searching Tasks
- Open web browser to
https://vCenterServerFQDN/mob/?moid=TaskManager
- Enter SSO administrator credentials (e.g., administrator@vsphere.local)
- Find the problematic task ID in the recentTask field
- Click the task ID → Click info in TaskInfo property to view details
Changing Task State
Once you’ve identified the problem task, you can directly change its state:
- Invoke SetTaskState in the Methods section
- Set the following parameters:
- state value: success
- Leave result or fault parameters empty
- Click Invoke Method to change the task state to success
4. ESXi Host-Level Resolution via SSH
For stuck VM-related tasks, you can resolve them directly on the ESXi host.
Enable ESXi SSH
- Select ESXi host in vSphere Client
- Navigate to Configure → Services
- Select SSH → Click Start
Command-Line Task Cancellation
SSH into the ESXi host and run:
# Check running VM processes
esxcli vm process list
# Terminate process after identifying VM's World ID
esxcli vm process kill --type=soft --world-id=[World ID]
# For more forceful termination if needed
esxcli vm process kill --type=hard --world-id=[World ID]
Task Management Using vim-cmd
# List all VMs
vim-cmd vmsvc/getallvms
# Check tasks for specific VM
vim-cmd vimsvc/task_list
# Cancel task (requires task ID)
vim-cmd vimsvc/task_cancel [TaskID]
5. Remote Resolution Using PowerCLI
PowerCLI provides powerful remote connectivity to vCenter for troubleshooting.
PowerCLI Connection and VM Status Check
# Connect to vCenter
Connect-VIServer -Server vCenterServerAddress
# Check problematic VMs
Get-VM | Where-Object {$_.PowerState -eq "Unknown"}
# Force shutdown specific VM
Stop-VM -VM "VMName" -Kill -Confirm:$false
Task Monitoring and Management
# Check running tasks
Get-Task | Where-Object {$_.State -eq "Running"}
# Cancel specific task
Get-Task | Where-Object {$_.Description -like "*ProblemTask*"} | Stop-Task
6. Preventive Measures Through Timeout Configuration Changes
For fundamental resolution, adjust vCenter timeout settings.
Modifying vpxd.cfg File
Edit the /etc/vmware-vpx/vpxd.cfg
file on vCenter Server:
<config>
<task>
<timeout>10800</timeout> <!-- Extended to 3 hours -->
</task>
<vmomi>
<soapStubAdapter>
<blockingTimeoutSeconds>10800</blockingTimeoutSeconds>
</soapStubAdapter>
</vmomi>
</config>
ESXi Host Timeout Settings
Similarly modify /etc/vmware/vpxa/vpxa.cfg
on ESXi hosts:
<config>
<task>
<timeout>10800</timeout>
</task>
<vmomi>
<soapStubAdapter>
<blockingTimeoutSeconds>10800</blockingTimeoutSeconds>
</soapStubAdapter>
</vmomi>
</config>
7. Special Precautions and Solutions for Snapshot-Related Issues
Snapshot consolidation tasks require special attention. Never force-cancel these operations.
Monitoring Snapshot Consolidation Tasks
To check if snapshot consolidation is in progress:
# Run on ESXi host
tail -f /vmfs/volumes/datastore/VMname/vmware.log | grep -i consolidate
Safe Snapshot Problem Resolution
Situation | Recommended Action | Strictly Prohibited |
---|---|---|
Stuck at 99% | Wait or contact VMware support | Force cancellation |
Failed with error | Check datastore space, then retry | Process kill |
Running for days | Check logs, seek expert help | Arbitrary reboot |
While vCenter’s “Task was cancelled by an administrator” error can stem from various causes, most cases are resolvable through systematic approaches. The key is to prioritize data safety and never force-interrupt critical operations like snapshot consolidation. For persistent or complex issues, don’t hesitate to seek assistance from VMware Support or experienced professionals rather than attempting risky solutions. The best approach is preventing these problems through regular backups and monitoring.