I periodically get questions about vSphere "session timeouts" and because there are several different session timeouts in vSphere, there is usually a back and fourth to understand which session timeout a user is specifically asking about? 🙂
Once the specific vSphere session timeout has been identified, the next series of questions are typically:
- What is the default or current value?
- Is it configurable?
- If so, where and how can I change it?
To help simplify questions around this topic, I have put together this quick overview that also includes details for each specific session timeout and where to find and update the values.
vCenter - H5 Client UI Session Timeout
- Description: This is the timeout for the vSphere HTML5 or Flash UI Client (apologies for those that are still using this client) and the vCenter Server
- Default Timeout: 120 minutes
- Documentation: https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vcenterhost.doc/GUID-975412DE-CDCB-49A1-8E2A-0965325D33A5.html
- UI Configurable: Yes
As of vSphere 7.x, the session timeout can now be change directly within the vSphere H5 Client under Administration->Deployment->Client Configuration
- CLI/API Configurable: Yes
The session timeout is configurable when logging into the vCenter Server Appliance (VCSA) and locating the session.timeout parameter which can be found in the following files:
- H5 Client - /etc/vmware/vsphere-ui/webclient.properties
- Flex Client - /etc/vmware/vsphere-client/webclient.properties
A restart of the service using either service-control --restart vsphere-ui or service-control --restart vsphere-client is required for the change to go into effect.
vCenter - vSphere API Session Timeout
- Description: This is the timeout for vSphere API Clients such as PowerCLI or any of the vSphere SDK and CLI using either vSphere SOAP or REST API connected to vCenter Server
- Default Timeout: 30 minutes
- Documentation: https://kb.vmware.com/kb/1031039
- UI Configurable: No
- API/CLI Configurable: Yes
The session timeout is configurable when logging into the vCenter Server Appliance (VCSA) by adding a new <sessionTimeout> entry and the desired value into /etc/vmware-vpx/vpxd.cfg file and restarting the vCenter Server service. For more details, please refer to this VMware KB 1031039.
ESXi - Host Client UI Session Timeout
- Description: This is the timeout for the ESXi Host Client UI and the ESXi host
- Default Timeout: 15 minutes
- Documentation: https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.hostclient.doc/GUID-9D0473C3-232B-4280-8F1E-2A99829706F9.html and https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.hostclient.doc/GUID-9D0473C3-232B-4280-8F1E-2A99829706F9.html
- UI Configurable: Yes
When logging into the ESXi Host Client, navigate to Username->Settings->Application timeout and choose from one of the five options: 15min, 30min, 1hr, 2hr or off
- API/CLI Configurable: Yes
The session timeout is store in an ESXi Advanced Setting called UserVars.HostClientSessionTimeout (seconds) and can be updated using any vSphere API Client including PowerCLI
Get-VMHost | Get-AdvancedSetting -Name UserVars.HostClientSessionTimeout
Get-VMHost | Get-AdvancedSetting -Name UserVars.HostClientSessionTimeout | Set-AdvancedSetting -Value 1200
ESXi - vSphere API Session Timeout
- Description: This is the timeout for vSphere API Clients such as PowerCLI or any of the vSphere SDK and CLI using either vSphere SOAP or REST API connected to ESXi host
- Default Timeout: 30 minutes
- Documentation: https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.hostclient.doc/GUID-E3D95B5C-A888-4E21-A6A0-AFC6A3DC1192.htmlÂ
- UI Configurable: Yes
When logging into the ESXi Host Client, navigate to System->Advanced Settings and search for the Config.HostAgent.vmacore.soap.sessionTimeout advanced setting
- API/CLI Configurable: Yes
The session timeout is store in ESXi Advanced Setting called Config.HostAgent.vmacore.soap.sessionTimeout and can be updated using any vSphere API Client including PowerCLI
Get-VMHost | Get-AdvancedSetting -Name Config.HostAgent.vmacore.soap.sessionTimeout
Get-VMHost | Get-AdvancedSetting -Name Config.HostAgent.vmacore.soap.sessionTimeout | Set-AdvancedSetting -Value 60
I normally set a few timeouts to follow our own desired timeout settings and it sort of works. One odd thing that happens is if I Authenticate to vCenter with a 10 minute timeout and then switch to another browser tab - I will be on that new window for over 20 minutes. Every time when I return to the vCenter WebUI it prompts my session will timeout in 20 seconds.
This leaves me to believe that I am not returning at the 10 minute mark on the dot but rather it will not drop my connection until I have that window/tab focused. Curious if there is an explanation on what occurs here.