KBI 310196 PowerCLI Can Leave Idle Sessions On vCenter


Argent for VMware (Argent AT) – All versions


11 Aug 2010


The VMware SDK (PowerCLI) can leave idle sessions on vCenter. The idle sessions can gradually drain vCenter resources and make it unresponsive.

Technical Background

Argent for VMware makes use of the VMware SDK (PowerCLI) to monitor the VMware infrastructure. The typical flow goes as follows:

Step 1: Call cmdlet ‘connect-viserver’ to make connection to vCenter or ESX host.

Step 2: Run monitoring PowerShell logic

Step 3: Call cmdlet ‘disconnect-viserver’ to disconnect from vCenter or ESX host.

It has been observed that PowerCLI can leave idle sessions on vCenter. This can be verified by checking the session section in vSphere client.

One session object represents a connection between vCenter and ESX host. When too many idle session objects eat up the vCenter resource, vCenter can become unresponsive.


In Argent AT 2.0A-1007-T1 and later, Argent for VMware introduced the ‘vCenter Idle Session Rule’ to combat this VMware specific issue.

vCenter Idle Session Rules can monitor the idle session count and optionally terminate the sessions. By running this Rule in a Relator against vCenter, users can keep vCenter always operational and responsive.

The field ‘Check Sessions That Has Been Idle More Than’ actually defines what is considered as an ‘idle session.

Using the ‘User Name’ field, customers can restrict whose idle sessions can be terminated. Sometimes, the operations team may have their own vSphere PowerShell console open for a long time. The logic of the ‘User Name’ field is a partial match — for example, ‘John’ matches ‘ARGSOFT\John’.