I was asked today to cancel a task of a machine import today - because it was created by mistake. So I naturally asked the Cluster Admin, "Why do you not do it yourself?". And he naturally answered me, "Because I can't! The option is greyed out."
Now there are certain tasks you cannot cancel in vCenter. The exact list - I am sure LucD will be able to pull this out of the SDK - but this was not the purpose of this post.
The way permissions are set up in my environment - is least amount of privileges needed is what is granted.
Each Admin is assigned Full Administrator permissions on their Cluster with Propagation set. On the Top level folder is whole different ball game.
The way I do my daily work is by assigning myself the same rights as the Cluster Admin (msaidelk)- and all Elevated privileges are performed with another user (admin) that have full control over the whole Environment. I do my PowerCLI work with that elevated user.
So I checked with my msaidelk user and I also could not cancel the task.
So I checked if it was because the task was not cancellable. That was simple with PowerCLI
get-task -Status running | select ID, StartTime, IsCancelable| fl
Which gave me output that the task was cancellable.
Id : Task-task-33529
StartTime : 13/09/2010 18:59:40
IsCancelable : True
I tried to stop the task with my admin user
Get-Task | where {$_.id -eq "Task-task-33529" } | stop-task -confirm:$false
Worked fine. So this had to be a permissions issue.
I looked on the Permissions for the Top folder and found my issue
Global -> Cancel Task was not checked
You might have thought that if the user was an admin on the cluster then they would be able to cancel the task but I guess not.
Added that right to role and Voila!