Use the ConnectedPairings property to extract connection information that you might need for vSphere Replication SDK operations.

The ConnectedPairings property is a key-value dictionary that contains information about all available vSphere Replication pairings. Use ConnectedPairings to extract information such as PairingID and VcServerID, which is required for some vSphere Replication SDK operations.

Prerequisites

Verify that you have a valid VrServerConnection. This example uses the $vr2 connection variable from Connect to a Local and to a Remote vSphere Replication Server.

Procedure

  1. To list the connected pairings for a vSphere Replication connection, run:
    $vr2.ConnectedPairings

    The system lists a key-value map with your connected pairings.

  2. To list a pairing, run:
    $vr2.ConnectedPairings[<vc_server_name>].Pairing

    The system returns the Pairing object with all its properties. You can copy the PairingID property as it is required by some vSphere Replication API operations.

  3. To list the LocalVcServer object, run:
    $vr2.ConnectedPairings[<vc_server_name>].Pairing.LocalVcServer

    The system returns a ServerInfo object that contains a server ID that is required by some vSphere Replication API operations.

  4. To list the RemoteVcServer object, run:
    $vr2.ConnectedPairings[<vc_server_name>].Pairing.RemoteVcServer

    The system returns a ServerInfo object that contains a server ID that is required by some vSphere Replication API operations.