Wednesday, September 5, 2018

Issue with starting a vSphere replication a VM that was working previously

Had an issue with a customer that had an issue with restarting a vsphere replication after they had disabled replication to increase a VMDK.

The error shown was similar to this:

 Unable to configure replication for virtual machine VM_name because group group_name cannot be created. Another virtual machine configured_VM_name}' that has the same instance UUID instance_UUID already exists on protection site source_site_name.

 Looking at VMware documentation (https://docs.vmware.com/en/vSphere-Replication/6.1/com.vmware.vsphere.replication-admin.doc/GUID-06A0C28D-4854-4B2E-A91D-98EF2FD3AB22.html) it stated you need to find the GID of the VM in question and go to the vSphere replication appliance/manager and remove it from the MOB DB.

Unfortunately they do not provide how to find the GID for your target VM. I found this blog post (https://vwareindia.blogspot.com/2015/12/unable-to-configure-replication-for.html) and decided to modify it since the client had a newer version of postgres. Here are my steps in finding the GID:

1. SSH into your target recovery Site vSphere Replication Appliance.

 2. cd /opt/vmware/vpostgres/9.4/bin

 3. Take a backup of the postgres instance on the vsphere replication appliance:

./pg_dump -U vrmsdb -Fp -c > /tmp/DBBackup.bak

 4. connect to the postgres instance using this cmd:

./psql -U vrmsdb

5. Open replication VMs inventory table by entering this query:

 SELECT a.group_movalue AS "SECONDARY GID", b.name AS "VM Name", 'https://' || c.address || ':8043/mob/?moid=' || a.group_movalue || '&vmodl=1' AS "Link to Paste" FROM secondaryvirtualmachineentity a, virtualmachineentity b, localserverentity c WHERE a.movalue = b.movalue ORDER BY name;

6. Search for the target VM and copy Link from the “Link to Paste” column. It will look similar to: 

https://VRMS_IP:8043/mob/?moid=GID-87ae29b2-485f-4fd4-a19b-f5566c87e58b&vmodl=1

7. Open this link in the browser and login with an administrator account (ie. Administrator@vsphere.local. Note that this is case sensitive so you have to capitalize A in administrator.

8. Click on destroy in this list.

9. A new window will open, click on "Invoke Method".

10. Proceed with re-configuring replication for that VM.

If you have issues following my steps, contact VMware support to assist you.