Petit mémento suite à une question en interne qui a aboutie sur étendre le nombre maximum par défaut de volumes NFS sur un ESXi (valeur par défaut à 8).
On a donc sorti la KB qui traite du problème via la modification de configuration avancée des ESXi (KB2239) :
- NFS.MaxVolumes: Limits the number of NFS Datastores which can be mounted by the vSphere ESX/ESXi host concurrently. The default value is 8, and can be increased to a maximum specific to the version of ESX/ESXi:
- ESX/ESXi 3.x: Set NFS.MaxVolumes to 32
- ESX/ESXi 4.x: Set NFS.MaxVolumes to 64
- ESXi 5.0; Set NFS.MaxVoumes to 256
Net.TcpipHeapSize: The amount of heap memory, measured in megabytes, which is allocated for managing VMkernel TCP/IP network connectivity. When increasing the number of NFS Datastores, increase the default amount of heap memory as well:
- ESX/ESXi 3.x: Set Net.TcpipHeapSize to 30
- ESX/ESXi 4.x: Set Net.TcpipHeapSize to 32
- ESXi 5.0: Set Net.TcpipHeapSize to 32
- Net.TcpipHeapMax: The maximum amount of heap memory, measured in megabytes, which can be allocated for managing VMkernel TCP/IP network connectivity. When increasing the number of NFS Datastores, increase the maximum amount of heap memory as well, up to the maximum specific to the version of ESXi/ESX host.
- ESX/ESXi 3.x : Set Net.TcpipHeapMax to 120
- ESX/ESXi 4.x: Set Net.TcpipHeapMax to 128
- ESXi 5.0: Set Net.TcpipHeapMax to 128
Note: These settings enable the maximum number of NFS mounts for vSphere ESX/ESXi.
Cependant, la personne voulait automatiser cela (forcement) pour tous les serveurs de sa plateforme vSphere. On lui a donc fournit un OneLiner PowerCLI afin d’effectuer cela.
Vu que la demande concernait une plateforme qui n’était pas entièrement migrée en ESXi 5.0, il a fallu gérer la version (puisque les maximum sont différents suivants ESXi 4 et 5) :
foreach ( $esxhost in Get-VMHost | ?{ $_.PowerState -eq "poweredOn" } ) { if ( ($esxhost.Version -match "^5") -And (((Get-VMHostAdvancedConfiguration -VMHost $esxhost -Name "NFS.MaxVolumes").values -ne 256) -Or ((Get-VMHostAdvancedConfiguration -VMHost $esxhost -Name "Net.TcpipHeapSize").values -ne 32) -Or ((Get-VMHostAdvancedConfiguration -VMHost $esxhost -Name "Net.TcpipHeapMax").values -ne 128))) { Set-VMHostAdvancedConfiguration -VMHost $esxhost -NameValue @{ "NFS.MaxVolumes" = 256; "Net.TcpipHeapSize" = 32; "Net.TcpipHeapMax" = 128 } | Out-Null } elseif ( ($esxhost.Version -match "^4") -And (((Get-VMHostAdvancedConfiguration -VMHost $esxhost -Name "NFS.MaxVolumes").values -ne 64) -Or ((Get-VMHostAdvancedConfiguration -VMHost $esxhost -Name "Net.TcpipHeapSize").values -ne 32) -Or ((Get-VMHostAdvancedConfiguration -VMHost $esxhost -Name "Net.TcpipHeapMax").values -ne 128))) { Set-VMHostAdvancedConfiguration -VMHost $esxhost -NameValue @{ "NFS.MaxVolumes" = 64; "Net.TcpipHeapSize" = 32; "Net.TcpipHeapMax" = 128 } | Out-Null }}
Certains paramètres (Net.TcpipHeapSize et Net.TcpipHeapMax) nécessite un redémarrage afin d’être pris en compte:


Oh My God un oneliner ici !
Mais lol
Oh purée je viens d’avoir une idée pour un nouveau t-shirt
Commande cet après midi ^^
copyright sur « One|Liner » hein !
Oui oui celui la je te le laisse (et je veux bien le même d’ailleurs ^^ )
Non la c’est autre chose
Je craint le pire encore