Tuesday, July 16, 2013

Replication is already enabled..............But it's not

Don't lie to me vSphere Replication!


Have you ever gone to enable vSphere Replication (VR) in the new 5.1 web GUI and it comes back with the error "Replication is already enabled" when it just clearly is not? YES?! Well then maybe I can help you! VR is based off of a service called Host Based Replication (HBR). This is a service that actually runs on the host and not on the vSphere Replication Appliance or vCenter. Because of this, if you lose your VRA or VC configuration, your host may still think it's replicating a VM but VRA and/or VC think otherwise. When you go to enable replication, VC queries the host and the host comes back and says (you guessed it) "Replication is already enabled".


So how do we make an honest box out of VR?


Here is a quick way to diagnose and resolve this issue.

1) In the summary tab for the VM, find what host the VM is currently on
2) Get an SSH session to the host
3) Run the command ~#vim-cmd vmsvc/getallvms
4) In front of the VM in question, there will be a number, copy this number down
5) Run the command ~#vim-cmd hbrsvc/vmreplica.getState <#>  where "<#>" is replaced with the number in the previous step
6) If the replica state says "VM not enabled for replication" there is a different issue and you will need to dig further
7) If the VM shows that the disks are replicating you can stop the replication with the command ~#vim-cmd hbrsvc/vmreplica.disable <#> where "<#>" is replaced with the same number as in step 5
8) A
fter that, you should be able to enable replication again through the GUI

Hopefully this helps get your replication back up and running!

Want the SRM findings of a TSE in the trenches? Follow me on Twitter! @SRM_Guru

**********************************************Disclaimer**********************************************
This blog is in no way sponsored, supported or endorsed by VMware. Any configuration or environmental changes are to be made at your own risk. Casey, VMware, and any other company and/or persons mentioned in this blog take no responsibility for anything.   

Monday, July 15, 2013

Another quick fix...... if you look in the logs.

Help! My SRM Service is dead!

What's wrong?!


So your SRM service is dying? What do you do? Call VMware? Call your system admin? Call the hardware vendor? NO! You open the logs! The SRM logs give great insight into why the SRM service is crashing, usually it even tells you what is wrong. So Casey, where are these magical logs you speak of? The SRM logs for SRM 5.x are at

C:\ProgramData\VMware\VMware vCenter Site Recovery Manager\Logs\vmware-dr.txt

If the service is crashing, the logical place to look for the error is at the bottom. Scroll all the way to the bottom and read the last page or so of the logs. In this case, the customer saw this error:

Initializing service content: std::exception 'class Vmacore::Exception' "Registration with the local VC server is not valid"

As it turns out, the customer had encountered and issue over the weekend and had to re-install vCenter. This wiped out the SRM extension.

So that's nice, how did you fix it?! 


Simple. Do a modify install. This will register SRM to the new vCenter. We did the modify install, kept all the old settings (used the previous database, kept the same certificate, etc.) and when we were done, the service stayed up and everything was fixed! Just goes to show you, a little log review can go a looooooong way!


Want the SRM findings of a TSE in the trenches? Follow me on Twitter! @SRM_Guru


**********************************************Disclaimer**********************************************
This blog is in no way sponsored, supported or endorsed by VMware. Any configuration or environmental changes are to be made at your own risk. Casey, VMware, and any other company and/or persons mentioned in this blog take no responsibility for anything.