Creation of a new MCS catalog fails with the following Image Preparation timeout exception:
Citrix.Console.Models.Exceptions.ProvisioningTaskException Preparation of the Master VM Image failed. Make sure the selected image has a supported OS (for example, Windows 7) and the correct version of the VDA (7.0 or later) installed.
at Citrix.Console.PowerShellSdk.ProvisioningSchemeService.BackgroundTasks.ProvisioningSchemeTask.CheckForTerminatingError(SdkProvisioningSchemeAction sdkProvisioningSchemeAction)
at Citrix.Console.PowerShellSdk.ProvisioningSchemeService.BackgroundTasks.ProvisioningSchemeTask.WaitForProvisioningSchemeActionCompletion(Guid taskId, Action`1 actionResultsObtained)
at Citrix.Console.PowerShellSdk.ProvisioningSchemeService.BackgroundTasks.ProvisioningSchemeCreationTask.StartProvisioningAction()
at Citrix.Console.PowerShellSdk.ProvisioningSchemeService.BackgroundTasks.ProvisioningSchemeCreationTask.RunTask()
at Citrix.Console.PowerShellSdk.BackgroundTaskService.BackgroundTask.Task.Run()
DesktopStudio_ErrorId : UnknownError
ErrorCategory : NotSpecified
ErrorID : ImagePreparationFinalizationFailedCompletely
TaskErrorInformation : Terminated
InternalErrorMessage : Image Preparation timed out, image preparation failed.
DesktopStudio_PowerShellHistory : Create Machine Catalog 'test'
CDF Trace collected from the Delivery Controller at the time of the failure also shows that the exception occurs after the default image preparation timeout. CDF Trace can be analyzed to confirm the following sequence:
Logging can be enabled to understand the sequence of events happening within the Preparation VM.
1. First increase the Preparation timeout for the purposes of troubleshooting using the following PowerShell command from one of the Delivery Controllers:
Set-ProvServiceConfigurationData -Name ImageManagementPrep_PreparationTimeout -Value 60
2. Create the following registry entries on Master VM to enable required logging:
HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\MachineIdentityServiceAgent
Name: LOGGING (REG_DWORD)
Value : 1
HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\PVSVMAgent
Name: LOGGING (REG_DWORD)
Value : 1
2. Restart the VM for the registry changes to take effect
3. Start MCS catalog creation.
4. Login to Preparation VM after the Prep VM has been created on the hypervisor .
5. Go to C:\ and look for the log files : ImagePrep.log and PvsVmagentlog.txt
Analyzing these two logs will help to narrow down the cause of the failure. If the log files show "Drive is Write Protected" exception for Image preparation , please follow the recommendations below :
1. Check for Antivirus on the Master image : uninstall and test .
2. Check for any monitoring tools on master image like Lumension , Digital Guardian etc : Uninstall and test.
3. Remove Bitlocker encryption tool if present.
4. Move the Master image and the machine AD accounts (in case using existing accounts) to an OU with blocked inheritance and no GPOs linked if there are any as there can be disk write protection policies.
As a best practice , also look at Firewall and any storage related alerts on the hypervisor datastore .
PS: Once the cause is identified the above mentioned registry keys on the master VM can be set to 0 to turn off logging and also the same powershell command can be run to set the Preparation timeout back to 20 mins which is the default,