Deduplication and enforced limit of ContainerView objects in ESXi
search cancel

Deduplication and enforced limit of ContainerView objects in ESXi

book

Article ID: 332720

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
hostd service is crashing.

Environment

VMware vSphere ESXi 7.0.x

Cause

This issue occurs as the the container view API allows clients to create container views and they would exist until explicitly destroyed while the session is alive. This led to some third party solutions which maintain a long-lived session being able to create so many container views which causes hostd service to run out of memory.

Resolution

Starting from ESX 7.0U1 the view objects are limited to 100000 and identical ones are being reused by default.
The 100000 limit and reuse are configurable.

Steps to configure the options in releases before ESXi 7.0 Update 2:
-------------------------------------------------------------------------------------------
1. Uncomment the following lines in file /etc/vmware/hostd/config.xml and set the wanted values:

<!-- <viewLimit>100000</viewLimit> -->

<!-- <reuseContainerViews>true</reuseContainerViews> -->

2. Run the command to restart hostd service:

$ /etc/init.d/hostd restart


Steps to configure the options in release ESXi 7.0 Update 2 and after:
---------------------------------------------------------------------------------------------
1.Run the command to create a temporary JSON file:

/bin/configstorecli config current get -c esx -g services -k hostd -outfile tmp.json


2. Run the command to edit the file:

/bin/vi tmp.json


3. Under vimsvc add

"view_limit": <desired_limit>


If you want to disable deduplication of views also add:

"reuse_container_views":false


4. Run the command to apply the file to the Database:

/bin/configstorecli config current set -c esx -g services -k hostd -infile tmp.json


5. Run the command to restart hostd service:

$ /etc/init.d/hostd restart

Workaround:
To work around this issue:
----------------------------------
Remove third party solutions that are creating ContainerView objects or make sure they are explicitly destroyed after no longer needed.