2015年7月9日 星期四

VMware Replicating a virtual machine fails

Error: VR server has no hosts through which to access destination datastore

Environment:
VMware ESXi 5.1
vCenter (install via OVF Template)
vSphere Replication Appliance (install via OVF Template and use Embedded vSphere Replication Database)

Reference::
Replicating a virtual machine fails with the error: VR server localhost.localdom has no hosts through which to access destination datastore (2032571)
Connecting to vPostgres Databases
How do I list all databases and tables using psql?

Solution:
1. login vSphere Replication Appliance with account root (using putty)
2. su - vrmsdb
3. psql
4. \connect vrmsdb
5. Run this query to determine if any hosts are marked as Unsupported:
  • To query hosts that are not associated with a VR server:
select * from HostEntity h where state=4 and not exists (select * from HbrHostEntity where h.vcMoId=HbrHostEntity.vcHost_vcMoId);
  • To query hosts that are associated with a VR server:
select * from HostEntity h where state=4 and exists (select * from HbrHostEntity where h.vcMoId=HbrHostEntity.vcHost_vcMoId);
This query returns a host ID. You can use the vCenter MOB to identify the host using the host ID.

6. Run this query to perform a cleanup:
  • To clean up Unsupported records for hosts that are not associated with a VR server:
delete from HostEntity where state=4 and not exists (select * from HbrHostEntity where vcMoId=HbrHostEntity.vcHost_vcMoId);

  • To change the state of hosts that are tagged as Unsupported and associated with a VR server to ACTIVE:
update HostEntity set state=1 where state=4 and exists (select * from HbrHostEntity where vcMoId=HbrHostEntity.vcHost_vcMoId);

7. Restart vSphere Replication Appliance at the Recovery site.
8. setup replication configuration for the VM guest again.

Possible Cause:
VMware host upgrade from ESX 4.x to 5.1. (I think)

沒有留言:

張貼留言