For replications from a source to a target vCenter Server system, you use the Connect-VrServer cmdlet to connect to the local and to the remote vSphere Replication server.

Prerequisites

  • Verify that vSphere Replication appliances are deployed at the local and at the remote vCenter Server systems.

  • If the certificate of the server you want to connect to is not trusted, verify that your PowerCLI invalid server certificate action settings are configured properly. For more information, see Configuring PowerCLI Response to Untrusted Certificates.

  • If you use a proxy server for the connection, verify that it is configured properly, so that the connection is kept alive long enough for tasks to finish.

    Note: If you do not want to use a proxy server for the connection, run Set-PowerCLIConfiguration -ProxyPolicy NoProxy.

Procedure

  1. Run Connect-VrServer and create a variable for the connection. Use the local vSphere Replication server address with the local vCenter Server user credentials. For the remote server connection, use the remote vCenter Server address with the remote vCenter Server user credentials.
    $vr2 = Connect-VrServer -Server <local_vr_address_or_fqdn> -User 'MyVCUser' -Password 'MyVCPassword' -RemoteServer <remote_vc_server_name> -RemoteUser 'MyRemoteVCUser' -RemotePassword 'MyRemoteVCPassword'
  2. (Optional) Print the connection variable to see the VrServerConnection object you created.
    $vr2

    The VrServerConnection object contains the ConnectedPairings property with the pairing you created. You might need this property to extract information required by some vSphere Replication operations.