To invoke operations on the Site Recovery Manager (SRM) API, you must first connect to the Site Recovery Manager (SRM) instances on the local (protected) and the remote (recovery) sites.

Prerequisites

  • Verify that VMware Site Recovery Manager (SRM) is deployed to the local (protected) and to the remote (recovery) vCenter Server systems.

  • Verify that the Site Recovery Manager (SRM) instances on the local and the remote sites are connected.
  • 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. Connect to the local and to the remote Site Recovery Manager (SRM) servers.
    $localSrm = <local_srm_address_or_fqdn>
    $srmConnection = Connect-SrmSdkServer -Server $localSrm `
        -User 'MyLocalVCUser' `
        -Password 'MyLocalVCPassword' `
        -RemoteUser 'MyRemoteVCUser' `
        -RemotePassword 'MyRemoteVCPassword'
  2. (Optional) Print the ConnectedPairing property of the connection you created.
    $srmConnection.ConnectedPairing
    The command prints the Pairing object that represents the pair between the local and the remote Site Recovery Manager (SRM) sites.
    You will need the Pairing object and its properties for various Site Recovery Manager (SRM) API operations.