This article provides information about the scenario where the error is seen.
Symptoms:
User gets below deserialization error when calling this PbmQueryAssociatedProfiles method using VMware-vSphere-SDKERROR 2023-02-22T09:37:57 Replay.Common.Implementation.Virtualization.VSphereApi.EsxVirtualMachine ()
Failed to obtain storage profiles for virtual machine 'VM' on server '10.35.21.42'
Replay.Common.Implementation.Virtualization.VSphereApi.PbmProfileQueryFailedException: Query associated profiles failed ---> System.InvalidOperationException: There is an error in XML document (1, 359). ---> System.InvalidOperationException: The specified type was not recognized: name='PbmProfileQueryProfileResultInternal', namespace='urn:pbm', at <returnval xmlns='urn:pbm'>.
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPbmServiceInternal.Read2985_PbmQueryProfileResult(Boolean isNullable, Boolean checkType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPbmServiceInternal.Read3087_Item()
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
This is caused by a bug in the VMware vCenter server which fails to filter the response by upcasting the internal result i.e. PbmProfileQueryProfileResultInternal to the public result i.e. PbmQueryAssociatedProfileResult that is why it is not able to deserialize the PbmQueryProfileResult as it receives PbmProfileQueryProfileResultInternal type in response instead of the expected PbmProfileQueryProfileResult when PbmQueryAssociatedProfiles method is called.x
To be fixed in future version of vCenter
Workaround:
This is a known issue affecting vCenter 7.X. There is currently no resolution
Impact/Risks:
User will not be able to call and get results from the PbmQueryAssociatedProfiles method.