Check replicated VM list from vSphere Replication Server.
search cancel

Check replicated VM list from vSphere Replication Server.

book

Article ID: 307270

calendar_today

Updated On:

Products

VMware Live Recovery VMware vSphere ESXi

Issue/Introduction

When the appliance is not connecting to vCenter to figure out the node names, and when running a large environment where the source and destination datastore is unknown.

The following can help in re-configuring the VM unavailable to vCenter to know replication status. This may be required to check how many VMs are replicating along with replication status, RPO settings, compression, quiesce and violation and gid of the VMs.

Environment

VMware vSphere Replication 8.x

Cause

Unavailability of vSphere Replication server at vCenter level, or redeploy of vSphere Replication server.

Resolution

The below commands will help to figure out the required details of replicated VMs. This needs to be run on each appliance to get the info.

  • Login into vSphere Replication server console as root and enable SSH.
  • Once connected from putty, run the below commands.
  • On the VR appliance navigate to the data base directory:
       cd /opt/vmware/vpostgres/9.5/bin     (here you may change the version folder 9.5 to the proper one)
  • Back up both the source and remote VRMS databases:
    ./pg_dump -U vrmsdb -Fp -c > /tmp/DBBackup.bak

    This statement will display current replications and their options. For PROD and DR replication, it needs to be executed on the DR replication appliance:

  • echo -e "\n\n" && echo -e "\t\t ***REPLICATED VMs AND THEIR CONFIGURATION*** \n" && echo "select name AS Replicated_VM_Name, networkcompressionenabled AS compression, quiesceguestenabled AS quiesce, rpo AS rpo_in_minutes, rpoviolation AS Violation, movalue AS GID from groupentity;" | /opt/vmware/vpostgres/current/bin/psql -U vrmsdb 

    Output:
                     ***REPLICATED VMs AND THEIR CONFIGURATION***

     replicated_vm_name | compression | quiesce | rpo_in_minutes | violation |                   gid
    --------------------+-------------+---------+----------------+-----------+------------------------------------------
     win2k12r2          | t           | f       |           1440 | f         | GID-########-####-####-####-############
     Rep                | f           | f       |           1440 | f         | GID-########-####-####-####-############

    This statement allows for display of target storage for the replication. For PROD to DR replication, it needs to be executed on the DR replication appliance:

  • echo -e "\n\n" && echo -e "\t\t ***REPLICATED VMs AND THEIR TARGET STORAGE*** \n" && echo "select sourcediskfilename AS source_disk, '/vmfs/volumes/' || destinationdatastoreuuid || '/' || destinationpath || '/' || destinationdiskfilename AS Destination_Path_Disk from diskentity;" | /opt/vmware/vpostgres/current/bin/psql -U vrmsdb  

    Output:
                     ***REPLICATED VMs AND THEIR TARGET STORAGE***

                source_disk             |                           destination_path_disk
    ------------------------------------+----------------------------------------------------------------------------
     [iscsi-1] win2k12r2/win2k12r2.vmdk | /vmfs/volumes/########-########-####-############/win2k12r2/win2k12r2.vmdk
     [iscsi-1] Rep/Rep.vmdk             | /vmfs/volumes/########-########-####-############/Rep/Rep.vmdk


    Please note that this statement will provide an ID of a storage location. It can be easily matched to the datastore name by executing ls -l on the /vmfs/volumes directory on the DR ESXi host.

    Note: If the output is large please export the output to individual files to >/tmp/vmlist.txt, >/tmp/vmdisklist.txt which can be later copied using scp software.

Additional Information

Impact/Risks:

Perform a database backup before executing the commands.