VMware Cloud Community
al3XxX
Contributor
Contributor

Maximum simultaneous connections "Connect-VIServer"

Hi,

I have a script which connects to our vCenter server and it runs on several different machines.

The script works fine if I run it on one machine at a time, it also works fine if I run it on a couple of machines at the same time, but if I run it on all the servers at the same time I get the following error:

"Access is denied"

Is there a limitation of how many hosts that can CONNECT to the vCenter simultaneously?

Tags (1)
Reply
0 Kudos
13 Replies
LucD
Leadership
Leadership

Afaik the default maximum on a vCenter 5.* is 50 simultaneous sessions.

You should be able to change that default by changing the advanced setting VirtualCenter.MaxDBConnection

vcmax.png


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

Reply
0 Kudos
al3XxX
Contributor
Contributor

Hello,

Thanks for your quick answer!

I dont think that the problem is the simultaneous sessions though.

I think that the problem is the simultaneous connection attempts to the vCenter server, is that something that you have heard about before?

FYI, the number of simultaneous connection attempts to the vCenter is not over 50, they are ~ 30.

Thanks in advance!

Message was edited by: al3XxX

Reply
0 Kudos
LucD
Leadership
Leadership

No, never heard of that.

I can imagine that there would be a delay on establishing a connection when there are many parallel requests, but not that the connection would fail.

You could add a check in your script to check the numbers.

Something like this

$max =  Get-AdvancedSetting -Entity $global:DefaultVIServer -Name VirtualCenter.MaxDBConnection |
Select -ExpandProperty Value
$si = Get-View ServiceInstance
$sesMgr = Get-View $si.Content.SessionManager
$active = $sesMgr.SessionList.Count
"$active/$max sessions"


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

Reply
0 Kudos
al3XxX
Contributor
Contributor

That wouldn't help me so much because I am not even connected to the server, I get the "Access Denied" exception message from the "Connect-VIServer" command.

Reply
0 Kudos
LucD
Leadership
Leadership

Correct, but since you are doing multiple connections, this would show how many connections you already have open during the last successful connection before the failure.


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

Reply
0 Kudos
schepp
Leadership
Leadership

In the vSphere configurations maximums doc you find a limit of 100 vSphere client connections and 180 concurrent web client connections. PowerCLI sessions appear in the same session manager of vCenter but seem to count otherwise. Alan Renouf says the limit is 500 concurrent sessions: http://blogs.vmware.com/vipowershell/2011/09/list-and-disconnect-vcenter-sessions.html

Regards

Reply
0 Kudos
al3XxX
Contributor
Contributor

Indeed it would, the problem is that ALL of the connections will throw the error "Access Denied". None of the machines can successfully connect to the vCenter server...

Reply
0 Kudos
LucD
Leadership
Leadership

Then it looks as if it might be another issue that you are encountering.

Is there any further indication in the vCenter logs ?


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

Reply
0 Kudos
al3XxX
Contributor
Contributor

There are pretty many vCenter log, is there any specific you think that I should look in?

Reply
0 Kudos
LucD
Leadership
Leadership

I would start with the most recent vpxd log.

Do you see error messages in the vSphere client Task and Events for these failed connects ?

If yes, you can use that timestamp to locate the corresponding entry in the vpxd log.


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

Reply
0 Kudos
al3XxX
Contributor
Contributor

This is what I get from the log:

2013-11-13T23:00:23.723+01:00 [34188 info 'commonvpxLro' opID=4f015659] [VpxLRO] -- BEGIN task-internal-13041342 --  -- vim.SessionManager.loginBySSPI -- 05394315-dac7-b506-77b4-ae2bb70ef35e

2013-11-13T23:00:23.723+01:00 [37992 info 'vpxdvpxdInvtHostCnx' opID=HB-host-533057@75013-cab5cd49] [VpxdHostSync] Completed host synchronization for host-533057

2013-11-13T23:00:23.723+01:00 [37992 info 'commonvpxLro' opID=HB-host-533057@75013-cab5cd49] [VpxLRO] -- FINISH task-internal-13041324 -- host-533057 -- VpxdInvtHostSyncHostLRO.Synchronize --

2013-11-13T23:00:23.738+01:00 [37992 info 'commonvpxLro' opID=1dd2bc02] [VpxLRO] -- BEGIN task-internal-13041343 --  -- vim.ServiceInstance.retrieveContent -- ce0daec1-cc00-813f-6529-04ff13d7707e

2013-11-13T23:00:23.738+01:00 [37992 info 'commonvpxLro' opID=1dd2bc02] [VpxLRO] -- FINISH task-internal-13041343 --  -- vim.ServiceInstance.retrieveContent --

2013-11-13T23:00:23.769+01:00 [34188 error 'authvpxdSSPI' opID=4f015659] [SSPI] AcceptSecurityContext failed: (0x-2146893044)

2013-11-13T23:00:23.832+01:00 [37992 info 'commonvpxLro' opID=9436c0d5] [VpxLRO] -- BEGIN task-internal-13041344 --  -- vim.ServiceInstance.retrieveContent -- d7cde795-1e72-f8ae-5b1a-32ffe0c97284

2013-11-13T23:00:23.832+01:00 [37992 info 'commonvpxLro' opID=9436c0d5] [VpxLRO] -- FINISH task-internal-13041344 --  -- vim.ServiceInstance.retrieveContent --

2013-11-13T23:00:24.019+01:00 [27264 info 'commonvpxLro' opID=HB-host-105759@142646-711c913d] [VpxLRO] -- BEGIN task-internal-13041345 -- host-105759 -- VpxdInvtHostSyncHostLRO.Synchronize --

2013-11-13T23:00:24.019+01:00 [27264 info 'vpxdvpxdInvtHostCnx' opID=HB-host-105759@142646-711c913d] [VpxdHostSync] Synchronizing host: host-105759 (XXXesx01.DOMAIN.local, 172.20.92.100)

2013-11-13T23:00:24.613+01:00 [37992 info 'commonvpxLro' opID=51247ccb] [VpxLRO] -- BEGIN task-internal-13041346 --  -- vim.SessionManager.loginBySSPI -- 4cb5264e-76df-9297-4424-e50c9bd93c05

2013-11-13T23:00:24.613+01:00 [24036 info 'commonvpxLro' opID=cc4c9ab0] [VpxLRO] -- BEGIN task-internal-13041347 --  -- vim.SessionManager.loginBySSPI -- 1f47e329-63f5-6592-a786-54d284db0505

2013-11-13T23:00:24.613+01:00 [42472 info 'commonvpxLro' opID=bdb5c1fe] [VpxLRO] -- BEGIN task-internal-13041348 --  -- vim.SessionManager.loginBySSPI -- 97da95ce-c2b3-6f76-2e77-9394818e0172

2013-11-13T23:00:24.613+01:00 [43984 info 'commonvpxLro' opID=287d9dc7] [VpxLRO] -- BEGIN task-internal-13041349 --  -- vim.ServiceInstance.retrieveContent -- 75bf91c7-10ae-4c73-8028-8fde975e768e

2013-11-13T23:00:24.613+01:00 [43984 info 'commonvpxLro' opID=287d9dc7] [VpxLRO] -- FINISH task-internal-13041349 --  -- vim.ServiceInstance.retrieveContent --

2013-11-13T23:00:24.613+01:00 [37992 info '[SSO]' opID=51247ccb] [UserDirectorySso] GetUserInfo(DOMAIN\svc_vm, false)

2013-11-13T23:00:24.613+01:00 [37992 info '[SSO][SsoAdminFacadeImpl]' opID=51247ccb] [FindPersonUser]

2013-11-13T23:00:24.816+01:00 [27536 info 'commonvpxLro' opID=HB-host-194410@99719-aa28da1b] [VpxLRO] -- BEGIN task-internal-13041350 -- host-194410 -- VpxdInvtHostSyncHostLRO.Synchronize --

2013-11-13T23:00:24.816+01:00 [27536 info 'vpxdvpxdInvtHostCnx' opID=HB-host-194410@99719-aa28da1b] [VpxdHostSync] Synchronizing host: host-194410 (XXXesx01.DOMAIN.local, 172.20.16.100)

2013-11-13T23:00:24.863+01:00 [46944 info 'commonvpxLro' opID=b96a8e82] [VpxLRO] -- BEGIN task-internal-13041351 --  -- vim.SessionManager.loginBySSPI -- ce0daec1-cc00-813f-6529-04ff13d7707e

2013-11-13T23:00:24.973+01:00 [46944 error 'authvpxdSSPI' opID=b96a8e82] [SSPI] AcceptSecurityContext failed: (0x-2146893044)

2013-11-13T23:00:25.160+01:00 [24036 info '[SSO]' opID=cc4c9ab0] [UserDirectorySso] GetUserInfo(DOMAIN\svc_vm, false)

2013-11-13T23:00:25.160+01:00 [24036 info '[SSO][SsoAdminFacadeImpl]' opID=cc4c9ab0] [FindPersonUser]

2013-11-13T23:00:25.176+01:00 [16940 info 'commonvpxLro' opID=d7cacffb] [VpxLRO] -- FINISH task-internal-13041311 --  -- vim.SessionManager.loginBySSPI --

2013-11-13T23:00:25.176+01:00 [16940 info 'Default' opID=d7cacffb] [VpxLRO] -- ERROR task-internal-13041311 --  -- vim.SessionManager.loginBySSPI: vim.fault.InvalidLogin:

--> Result:

--> (vim.fault.InvalidLogin) {

-->    dynamicType = <unset>,

-->    faultCause = (vmodl.MethodFault) null,

-->    msg = "",

--> }

--> Args:

-->

The message is the same from every machine that tries to run it.

Reply
0 Kudos
LucD
Leadership
Leadership

Do you specify a User and Password parameter on the Connect-VIServer cmdlet ?

From the messages it could be that the credentials are missing or in an incorrect format.

Or that the SSO doesn't work in the script.

Do you by any chance submit PS jobs ?

At this point it would be useful if you could share the code you are using.


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

Reply
0 Kudos
al3XxX
Contributor
Contributor

All the scripts that are running are identical.

If I run the script from one machine it works, I have also tried from 5 machines simultaneously and that also works.

When I run it on ~30 machines simultaneously I get the "Access Denied" error.

"Do you specify a User and Password parameter on the Connect-VIServer cmdlet ?

From the messages it could be that the credentials are missing or in an incorrect format." <--- I dont specify the credentials but the script runs as a scheduled task with the correct account. There are no problems with the credentials if I run it from 1-5 machines only.

"Or that the SSO doesn't work in the script." <--- SSO should be working if I use it in other scripts simultaneously and it works when I only run one instance.

I dont use PSJobs in the script.

It only executes the first rows in the script then it exits (return) which is basically like this:

try

{

Connect-VIserver -server $vCenterServer

}

  catch

  {

  Writes error message to eventlog


  return

  }

Reply
0 Kudos