Citrix Invalid DataStore Path Errors

Resolving Invalid DataStore Path Errors Related to Orphaned Citrix MCS VDI Disks in vCenter
Introduction
In a virtualized environment managed by VMware vCenter, managing storage resources efficiently is crucial. However, sometimes you may encounter "Invalid DataStore Path" errors, especially when dealing with orphaned Virtual Disk Images (VDIs) from Citrix MCS master images and workers. These errors can disrupt your virtual infrastructure and cause issues with VM management. In this blog post, we will explore what causes these errors and provide steps to resolve them.

Understanding Invalid DataStore Path Errors
"Invalid DataStore Path" errors occur when vCenter is unable to locate or access the storage path associated with a VM's virtual disk image. These errors often arise from orphaned VDI files, which are no longer associated with a VM but still reside in the data store.

Causes of Invalid DataStore Path Errors
When VMs are deleted or migrated, their associated VDI files may not be properly cleaned up, leaving behind orphaned VDI disk files.

During Machine Creation Services (MCS) process, few temporary virtual machines were created to facilitate the image update and are terminated at the end of the update process. Some of these temporary instances are not deleted or properly cleaned up leaving their disk files as orphaned files in the datastores.

Citrix runs an image cleanup task periodically to delete such orphaned files. However, it won’t remove the entries related to these files from the database. So, they keep reporting in vCenter as ‘Invalid datastore path’ errors as shown in the below screenshot.
Resolution

Citrix performs a regular cleanup task, ‘DisusedImageCleanup’ to clean up the orphaned files. However, deleting of the orphaned files from the datastores will not stop the errors from appearing in vCenter. We need to delete the stale entries/rows related to these files from Citrix Site database to stop them from appearing the vCenter console.

Use the following command to find the details about the finished cleanup tasks:
Get-ProvTask -Active $false -Type ‘DisusedImageCleanup’

The data in the ‘ImagesToDelete’ field contains the list of stale entries/rows that needs to be removed from the database.

In an on-premises Citrix environment, we can connect to the Site Database, delete stale entries/rows from the ‘DesktopUpdateManagerSchema.PendingImageDeletes’ table.

In Citrix Cloud, as we do not have control over the Site Database, we need to reach out to Citrix support and share the files to them for deletion.

Once, the files were deleted we no longer see the errors in vCenter.