This entity is managed by solution VMware vCenter Site Recovery Manager Extension. It is not recommended to modify it directly. Instead use the management console for the solution if you want to make changes.
vm.config.managedBy
property to claim certain virtual machines as placeholder virtual machines on the failover vCenter Server site. At the time of actual failover, these virtual machines become real (production) virtual machines.vm.reconfigure
operation on the placeholder virtual machines to clean up the vm.config.managedBy
property. vCenter Server cleans up this property from its cache, but it is not cleared from the vCenter Server database table VPX_VM
.vm.config.managedBy
and vm.summary.config.managedBy
, and the second property (vm.summary.config.managedBy
) is not cleared from the VPX_VM
table.VPX_VM
table and the vm.summary.config.managedBy
property is populated with the old managedBy
value, which incorrectly declares the real virtual machines as placeholder virtual machines.Set-ExecutionPolicy -scope CurrentUser -ExecutionPolicy RemoteSigned
$hmsVms = .\ManagedBy.ps1 -Cmd getVms -extKey "com.vmware.vcDr"
.\ManagedBy.ps1 -Cmd Clear -VMs $hmsVmsTo view the list of virtual machines, run this command:$hmsVms
Note: This script finds virtual machine IDs whose managed_by_ext_key and managed_by_ext_type fields are not in sync between the VPX_VM and VPX_VM_CONFIG_INFO tables.
select t1.ID, t1.MANAGED_BY_EXT_KEY, t1.MANAGED_BY_TYPE
from [VIM_VCDB].[dbo].[VPX_VM] t1
inner join [VIM_VCDB].[dbo].[VPX_VM_CONFIG_INFO] t2
on t1.ID = t2.ID
where t2.MANAGED_BY_EXT_KEY IS NULL and t1.MANAGED_BY_EXT_KEY IS NOT NULL
select COUNT(t1.ID)
from [VIM_VCDB].[dbo].[VPX_VM] t1
inner join [VIM_VCDB].[dbo].[VPX_VM_CONFIG_INFO] t2
on t1.ID = t2.ID
where t2.MANAGED_BY_EXT_KEY IS NULL and t1.MANAGED_BY_EXT_KEY IS NOT NULL
echo "data : $hmsVms"
update [VIM_VCDB].[dbo].[VPX_VM]
set MANAGED_BY_EXT_KEY=t2.MANAGED_BY_EXT_KEY, MANAGED_BY_TYPE=t2.MANAGED_BY_TYPE
from [VIM_VCDB].[dbo].[VPX_VM] t1
inner join [VIM_VCDB].[dbo].[VPX_VM_CONFIG_INFO] t2
on t1.ID = t2.ID
where t2.MANAGED_BY_EXT_KEY IS NULL and t1.MANAGED_BY_EXT_KEY IS NOT NULL
The output reports the number of rows affected. Compare this number with the number of rows in the output of step 4, and ensure that the numbers match.