Jan 08 2014

ESXi 5.1 VMFS HeapSize configuration using PowerCLI

There are a few of my customer still running vSphere 5.1 U1 and one of them reported an issue related to the VMFS Heap Size (VMFS3.MaxHeapSizeMB) configuration a few days ago. Keep in mind that my customer upgraded to U1 from a previous vSphere 5.1 version meaning that the old VMFS3.MaxHeapSizeMB was retained at 80 MB instead of changed to the vSphere 5.1 U1 value of 640 MB. There is a note about that an upgrade might retain the old value here.

My customer faced several of the issues describe in VMware KB 1004420 when their ESXi hosts addressed more than 8 TB of open VMDKs. See the maximum TB amount of open VMDKs per ESXi in the above mentioned KB.

The blow scripts are tested and verified on the following platform:

  • Windows Server 2008 R2
  • vCenter Server 5.5
  • ESXi 5.5
  • PowerCLI version 5.5
  • PowerShell version 2.0

You can easily verify the ESXi host VMFS3.MaxHeapSizeMB configuration by running the following one-liner.
Change the get-cluster and – value parameters to match your environment and needed configuration.

The below command can be used if you are running PowerShell 3.0.

You can use the following one-liner to change the VMFS3.MaxHeapSizeMB for the ESXi hosts to the value you prefer.

The below command can be used if you are running PowerShell 3.0.

Keep in mind that the above one-liner will set the VMFS3.MaxHeapSizeMB to 640 configuration even if it is already set to 640.

But for those of you who know me i must also provide a script that will only change the value if needed and also send a email report of what has been done:)
Below you’ll find the PowerCLI script i used in my customers environment.

Change the following parameters in the below script to match your environment:

  • $vcenter = “vc-demo01“
  • $vcenteruser = “vcdx56\magnus“
  • $vcenterpw = “not secret“
  • $cluster = “VCDX56-01”
  • $sendTo = “magnus@vcdx56.com“
  • $sendFrom = “vc-demo01@vcdx56.com“
  • $smtpserver = “smtp.vcdx56.local“
  • $VHSMB = “640”

Here is the email report you’ll receive when running the script:
Screen Shot 2014-01-04 at 00.32.30


  1. Oskar Norén

    For me, using powershell 4 and powerCLI 5.5, it complained at using “Get-VMHostAdvancedConfiguration”, so I used below instead. Also, below checks all clusters…

    foreach($cluster in get-cluster){foreach ($esxi in ($cluster | get-vmhost)) {Get-AdvancedSetting -entity $esxi -name VMFS3.MaxHeapSizeMB | select Entity, Name, Value | ?{!($_.Value -eq 640)}}}

  2. Oskar Norén

    Sorry, Powershell 3 and PowerCLI 5.1 it was on the client I ran the oneliner.

  3. magander3

    Thanks for sharing Oskar.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">