Enabling replication for a virtual machine fails with the error: Replication is already enabled
search cancel

Enabling replication for a virtual machine fails with the error: Replication is already enabled

book

Article ID: 310328

calendar_today

Updated On:

Products

VMware Live Recovery VMware vSphere ESXi

Issue/Introduction

Symptoms:
  • Cannot enable replication via vSphere Client
  • Enabling replication for a virtual machine fails
  • You see the error:

    Replication is already enabled


Environment

VMware vCenter Site Recovery Manager 5.1.x
VMware vSphere Replication 5.1.x

Cause

vSphere replication runs in conjunction with Host Based Replication (HBR). HBR is a service that runs on the ESXi host, not on the vCenter Server or the vSphere Replication (VR) appliance.
If there is a configuration change in vCenter Server which is not correctly synchronized with the ESXi host, the host thinks that replication is enabled but the vCenter Server and the vSphere Replication (VR) appliance thinks otherwise. Subsequently, when you try to enable replication in vCenter Server it queries the host and the host returns the status message that Replication is already enabled.

Resolution

To resolve the synchronization issue, we need to change the virtual machine replication status directly on the ESXi host via the command line.

To disable replication for the virtual machine:
  1. Open a SSH access to the ESXi host that is hosting the virtual machine you are trying to enable replication on. For more information, see Using ESXi Shell in ESXi 5.x (2004746).
  2. Run this command to list all virtual machines running on the host and displaying the corresponding virtual machine identifier (VMID):

    vim-cmd vmsvc/getallvms

  3. Make a note of the VMID of the virtual machine.
  4. Run this command to show the current replication state of the virtual machine:

    vim-cmd hbrsvc/vmreplica.getState <VMID> (the number you noted in step 3)

  5. This should return a status which confirms that virtual machine replication is enabled.
  6. To set the replication status of this virtual machine to disabled, run this command:

    vim-cmd hbrsvc/vmreplica.disable <VMID>

  7. Navigate back to the vSphere Client and enable virtual machine replication as normal.


Additional Information

For more information about managing and ESXi host with shell access via SSH, see the Remote ESXi Shell Access with SSH section in the vSphere 5.1 documentation.

Using ESXi Shell in ESXi 5.x and 6.x