Unable to Delete XenDesktop Machines from Catalog

Unable to Delete XenDesktop Machines from Catalog

book

Article ID: CTX229310

calendar_today

Updated On:

Description

Cannot delete XD 7.6 machines, the process completes without error but the machine still exists in the environment.

You will see the following messages in a CDF Trace:

FAILED: System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.
Getting ProvisionedVM for the provisioning scheme failed with error DataStoreException."
Getting ProvisionedVM for the provisioning scheme failed with error DataStoreException."

Resolution

Create a backup of the XenDesktop Site DB, and remove the VM entry manually from the DesktopUpdateManagerSchema.ProvisionedVirtualMachine table.


Problem Cause

As per traces we have 1 VM to remove "VM_NAME" and for that ProvisionedVmGet executes our DesktopUpdateManagerSchema.ProvisionedVmGet Stored Procedure to collect all VMs

in the relevant ProvScheme. 
  • This is where we encountered an InvalidCastException i.e. Unable to cast object of type 'System.DBNull' to type 'System.String'. 
  • The implication is that our DesktopUpdateManagerSchema.ProvisionedVirtualMachine table contains an entry with invalid data that we can't validate in the environment. 

Issue/Introduction

FAILED: System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'. Getting ProvisionedVM for the provisioning scheme failed with error DataStoreException." Getting ProvisionedVM for the provisioning scheme failed with error DataStoreException."