Home > Blogs > VMware vSphere Blog


Stop vs Pause with vSphere Replication

Something to be aware of with regards to vSphere Replication is how we handle stopping vs pausing replication.  With a pause we temporarily stop shipping differential data to the recovery site, but with a stop we completely stop the replication, remove it from the UI *and delete the recovery data*.

Let’s take a look at this.

Say we have a VM that’s replicated, in this example “TestSRV1″.

NewImage

We can see the replication in the “Outgoing Replications” tab, everything is looking good.  We can go take a look at the recovery site datastore to see what files are there.

NewImage

A bit of explanation of key files:

  • TestSRV1.vmdk : The target disk file to which we are ultimately committing the replications.
  • hbrdisk.RDID….vmdk: The current redo log that is complete as of the last replication
  • hbrcfg…vmx(f): The shadow VMX files that will be ‘promoted’ to the full config files when we do our restore

If we right-click on the replication in the VR service, we have the options to Reconfigure, Pause, Sync, or Stop replication.  If we choose to stop, we are prompted to make *sure* we want to stop:

NewImageNewImage

 

So let’s say we stop… what happens?  Well, VR will disable the replication, and “Unconfigure” it.   We can see that in the “Recent Tasks” section of the interface as we commit this action.  The replication then disappears outright from our VR monitor

NewImageNewImage

 

Great, so we’ve stopped replication, but what does this mean?  Well “Unconfigure” means completely unconfigure – including wiping out all the files in the target directory that it created for the replication at the recovery location.  Notice that while the directory remains behind, all our files therein are gone:

NewImage

So be very careful doing a “Stop”.  Often a pause will be much handier for normal actions.  Even if you wipe out the primary disk file while it’s paused, the replica stays there in place, and is ready to be recovered.  If the primary gets annihilated, it will eventually hit an RPO violation state, but as long as the replication is still configured and not stopped, you can still recover the VM.

So my best practice is this:  Even if you think you’re going to get rid of a replicated VM, use pause and only “Stop” the replication after you’re completely sure you’re done with the replica, as “Stop” is an unrecoverable action.

There’s always the ability, mind you, to copy the target VMDK to another location, while the replication is paused, and use it as a seed for replication if you think you might need to restart it again at some point.

*** Post Script ***

My esteemed colleague Mr Dilworth pointed out to me that I should clarify how this is handled in SRM vs. using vSphere Replication on its own.  With SRM the interface for replication is handled entirely through the SRM plugin in the vSphere client, and it looks a little bit different:

As you can see, within SRM stopping the replication is titled “Remove Replication” which is probably a touch more informative.  The behaviour is the same as outlined above, though: We are completely removing the replication and its replica files, including the config file for the replication itself with the RPO, VSS quiescing policy, etc.  This means again, recreating the replication will require setting all the policies from scratch and potentially having to re-seed a copy at the recovery location if you want to save on bandwidth and time for the initial full sync.

-Ken

14 thoughts on “Stop vs Pause with vSphere Replication

  1. Ken

    Hi Preetam, not really, no. You can use the SRM API to retrieve statuses of protected VMs, but not a list of what is particularly replicated by vSphere Replication.

    Reply
  2. JJ

    Ken,

    What will happen to the VM replica if I shutdown the recovery site VRMS/VR 5.1 server and delete it, Will the VM replica be still there or will it be wiped out. I would like to know the result when the Vsphere replication is used as standalone and when used along with SRM.

    Can you also tell me whats the best way to re-use the VM replica which will save us to do a complete initial sync when initiating a VM replication, if I had to redeploy the VRMS/VR 5.1 because of some issues with the appliance.

    Thanks,
    JJ

    Reply
    1. Ken

      Hi JJ. The replica will still be there if you delete the VR Appliance, but it won’t really be accessible without jumping through some hoops.
      Even if you reinstall a new VR Appliance, the old replica won’t get picked up and you’d need to reconfigure replication for those VMs from scratch.
      The moral of the story is you need to backup your VR Appliances!
      If you wipe out the VR Appliance and need to redeploy (without a backup of it) the replica VMDK should still be there and be usable as a seed since it would have the same disk ID. It would need to do a full sync again, but wouldn’t need to replicate all the data.

      Reply
  3. Doug B

    I was thinking about Preetam’s script request and think I may have something. I don’t know 100% that this is an ‘approved’ way to do it, but it does produce a list of VMs that are flagged for replication using vSphere Replication:
    (in PowerCLI):

    #bind to your vCenter
    Foreach ($vm in (Get-VM)) {
    $vmv = Get-View $vm
    $dest = $vmv.config.ExtraConfig | select | where {$_.key -eq “hbr_filter.destination”}
    If (($dest) -and ($dest.Value)) {
    Write-host $vm.name is replicated via $dest.Value
    }
    }

    It’s dirty, but may do the trick. I had to check for a non-null value of the destination because the “hbr_filter.destination” key gets added when vSphere Replication is configured, but remains after replication is stopped; its value just gets wiped out. It may be a good idea to check out the value of the “hbr_filter.pause” config item as well, just to make sure replication is active.

    YMMV

    Reply
  4. Alan Renouf

    Doug,

    With PowerCLI 5.1 you can also use the Get-AdvancedSetting to list the VMX entries instead of the more complicated Get-View method, this may help simplify your script a little.

    Alan

    Reply
  5. Eric

    How do rid a VM of SRM all together? I have uninstalled SRM but my VMs still have hbr_filter information in the vmx.

    Thanks,
    Eric

    Reply
    1. Ken

      SRM is a separate thing from replication. The replication is likely still taking place behind the scenes – SRM doesn’t stop it.
      If you still had SRM you could go to the VR tab in the UI and click on the VMs you want to stop replicating and select “stop replication”.
      Since you uninstalled SRM you’ll do it now through the web UI.
      Navigate to the “Replication” area of the web UI, it will show you the configured replications, select the replications you want to stop and click “stop replication”. When you stop a replication it will unconfigure the VM for replication and remove the replica.

      Reply
  6. Rogier

    Does anyone know why the VM folder is left behing (empty) after the “Stop replication” action is performed? I stopped replication, and re-initialized it after some days. It then created a new folder for the replica like ‘vm folder(1)’

    Reply
    1. Martin Valkanov

      It is a known issue. VRMS does not remove the folder, because it does not know if it has created it or the user has pointed the replica to an already existing folder.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>