Automation

 View Only
  • 1.  Get vCenter Linked Mode partners via PowerCLI

    Posted Mar 14, 2018 06:05 PM

    I only saw one other post about this and it hasn't seen any response in years, so I'll try a new thread and see if there is any luck.  I have a need to see if a particular vCenter I'm connected to is in an Enhanced Linked Mode configuration or not, can this be done via PowerCLI or via API call from PowerCLI perhaps?  Anyone know where this information is exposed that I could get to from my PowerShell script?



  • 2.  RE: Get vCenter Linked Mode partners via PowerCLI

    Posted Mar 15, 2018 01:50 AM

    You could try:

    Connect-VIServer vcenter-fqdn -AllLinked

    Then output:

    $global:DefaultVIServers



  • 3.  RE: Get vCenter Linked Mode partners via PowerCLI

    Posted Mar 15, 2018 02:39 PM

    Thanks, I could do that, however that presupposes I know that server is in linked mode already.  I am working from multiple vCenters with a mix of linked and unlinked and want to perform additional checks for linked mode vCenters, like testing some replication points for consistency since there isn't any way that I've found to automatically check PSC replication states yet.



  • 4.  RE: Get vCenter Linked Mode partners via PowerCLI
    Best Answer

    Posted Mar 15, 2018 07:36 AM

    I assume you are referring ot the Querying vCenter Linked Mode with the vSphere API post?

    As far as I can tell this QueryServiceEndpointListResponse method is not available in vSphere 6.5 anymore.

    It looks like this functionality is not available through a public API (as William already stated in 2009, see Re: VI SDK and Linked mode questions )

    With the introduction of Hybrid Linked Mode vs the older Enhanced Linked Mode, the situation becomes even more complex.

    For one you will need to query the PSC it seems.

    Have a look at William's Enhanced Linked Mode (ELM) vs Hybrid Linked Mode (HLM) post for further info.



  • 5.  RE: Get vCenter Linked Mode partners via PowerCLI

    Posted Mar 15, 2018 02:47 PM

    I had looked over that article but due to its age was hoping that someone might have added something since then.  If the only method is going at it that way, and not guaranteed to continue to work going forward, I'll go back to my original plan of manually documenting relationships in a config file.

    Thanks once again for your time!



  • 6.  RE: Get vCenter Linked Mode partners via PowerCLI

    Posted Apr 19, 2023 09:42 AM

    Found this with PowerCLI 13.0.0.20829139:

    $vCConnection = Connect-VIServer vCenter
    #or
    $vCConnection = $global:DefaultVIServer

    $vCClient = $VCConnection.GetClient()

    $LinkedServerList = $vCClient.ConnectivityService.GetLinkedServers()

    #Get All Linked Mode Partners, returns nothing when there is no partner
    foreach ($LinkedServer in $LinkedServerList)
    {
    $LinkedServer[0]

    #$LinkedServer[1] contains an ID
    }



  • 7.  RE: Get vCenter Linked Mode partners via PowerCLI

    Posted Feb 29, 2024 01:38 PM

    Thanks ChrisOfBerlin. It's working. I was looking for long time for this info.