VMware Cloud Community
Foyman1973
Enthusiast
Enthusiast
Jump to solution

Get vCenter Linked Mode partners via PowerCLI

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?

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
6 Replies
kwhornlcs
Enthusiast
Enthusiast
Jump to solution

You could try:

Connect-VIServer vcenter-fqdn -AllLinked

Then output:

$global:DefaultVIServers

0 Kudos
LucD
Leadership
Leadership
Jump to solution

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.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Foyman1973
Enthusiast
Enthusiast
Jump to solution

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.

0 Kudos
Foyman1973
Enthusiast
Enthusiast
Jump to solution

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!

0 Kudos
ChrisOfBerlin
Contributor
Contributor
Jump to solution

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
}

Ivanuci
Contributor
Contributor
Jump to solution

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

0 Kudos