After MCS Image Update, ‘Delete Virtual Disk’ Tasks Repeatedly Fail

There appears to be an interesting behavior in XenDesktop 7.x that only occurs after an MCS Image Update process has completed where, repeatedly, a task to delete a non-existent virtual disk fails. The user account that XenDesktop uses to connect to VMware vCenter Server is shown as the initiator of the action, so there is little doubt what service causes the error.

This action, and subsequent failure, will quickly fill up the 'Recent Tasks' pane.

This action, and subsequent failure, will quickly fill up the ‘Recent Tasks’ pane.

This … consistently occurs after every image update.

Unfortunately, there is no way to control this task from Citrix Studio and PowerShell must be used. Fortunately for me, I sat in Adam Platt‘s PowerShell Masterclass and immediately got to work! The hardest part was figuring out which cmdlet was used for MCS Tasks. After some digging through PowerShell ISE, I found the ProvTask cmdlet, but initially dismissed it because I thought, “This is MCS, not Provisioning Services!”. After some quick googling, I was surprised to find out that I was wrong and MCS uses that cmdlet.

The following two commands will first stop the task from running, and second delete the task. If you so desire, you can save this as a PowerShell script, but don’t forget to add the Citrix Snap-in first.

  • Get-ProvTask | where {$_.Type -eq “DisusedImageCleanup” -and $_.Status -ne “Finished”} | Stop-ProvTask
  • Get-ProvTask | where {$_.Type -eq “DisusedImageCleanup” -and $_.WorkflowStatus -eq “Terminated”} | Remove-ProvTask

This behavior consistently occurs after every image update. Hopefully this will be resolved in a future version.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: