When attempting to delete a DirectPath Profile (DPP) in a vSphere environment after an associated VM class has been removed, the operation fails with a "Resource In Use" error.
Error messages observed
vim.fault.ResourceInUse: not allowed because it is being used by a VM resource profilecom.vmware.dpp.delete.dppInUseByVmRpVCF 9.x
vSphere 8.x
This issue occurs because a stale VM Resource Profile (VRP) remains in the vCenter Server inventory. Even if the VM class was successfully deleted, the underlying VRP may persist and maintain a metadata reference to the DirectPathProfile, preventing its removal.
The following error can be found in /var/log/vmware/vpxd.log:
error vpxd[3525636] [Originator@6876 sub=Default opID=mpm#####] [VpxLRO] -- ERROR lro-41207462 -- DirectPathProfileMgr -- vim.DirectPathProfileManager.deleteDirectPathProfile: :vim.fault.ResourceInUse
--> Result:
--> (vim.fault.ResourceInUse) {
--> faultCause = (vmodl.MethodFault) null,
--> faultMessage = (vmodl.LocalizableMessage) [
--> (vmodl.LocalizableMessage) {
--> key = "com.vmware.dpp.delete.dppInUseByVmRp",
--> arg = <unset>,
--> message = <unset>
--> }
--> ],
--> type = <unset>,
--> name = <unset>
--> msg = ""
--> }
--> Args:
-->
--> Arg id:
To resolve this issue, the stale VM Resource Profile must be manually identified and deleted using the dcli (Data Center CLI) on the vCenter Server Appliance.
dcli +show-unreleased com vmware vcenter vmresourceprofiles listdcli +show-unreleased com vmware vcenter vmresourceprofiles delete --vm-resource-profile <profile-name>Note: Replace <profile-name> with the actual name identified in step 2