PowerCLI: Find and Set the Service Console Memory value


Last year I wrote a blog post about changing the COS memory. You can find the post here: https://ict-freak.nl/2008/11/26/vmware-service-console-memory/ (it’s written in Dutch). In that post there is already a one-liner made by LucD butt in this post you’ll get an extra one-liner to determine the COS memory value.

If you want to see how much memory is allocated for the Service Console run the next script:

Get-VMHost | Sort Name | Get-View | Select Name, `
@{N="Service Console Memory";E= {"" + `
[math]::round($_.Config.ConsoleReservation.ServiceConsoleReserved / 1MB, 0) + " MB "}}


Just add | Export-Csv -NoTypeInformation "D:\cosmem.csv" to export the data to a CSV file.

The output will look like this:


The script/one-liner:

Get-VMHost | Get-View | % { 
$_.Name | Where { $_.Config.ConsoleReservation.ServiceConsoleReserved -eq "314572800" }
(Get-View -Id $_.ConfigManager.MemoryManager).ReconfigureServiceConsoleReservation(800*1mb) }

You can monitor the changes in vCenter:


More information about the maximum values can be found here:  vsp_40_config_max.pdf.

The maximum value for the COS Memory is 800MB so that’s what the script will use to set the COS memory.

Note: You have to restart the server to apply the changes.

VMware: Autostart from the COS

Duncan heeft vandaag de volgende blogpost http://www.yellow-bricks.com/2009/01/01/check-if-autostart-is-enabled-from-the-cos/ online gezet, over het nakijken van de autostart (van VM’s) feature in het COS.

I didn’t know this was possible. But you can easily check via the COS if autostarting of VM’s in enabled or not according to this KB article:

Via het volgende commando kun je nakijken of de setting op false staat:

cat /etc/vmware/hostd/vmAutoStart.xml | grep ‘<enabled>false</enabled>’


Via de volgende commando’s kun je deze setting aanpassen:

Om de setting op true te zetten voer je het volgende commando uit:

perl -p -i.old -e ‘s/<enabled>false/<enabled>true/g’ /etc/vmware/hostd/vmAutoStart.xml 
de optie –i.old zorgt er voor dat er een backup gemaakt wordt

Om de setting op false te zetten voer je het volgende commando uit:

perl -p -i.old -e ‘s/<enabled>true/<enabled>false/g’ /etc/vmware/hostd/vmAutoStart.xml