Tuesday, October 13, 2009

Update Service Console Memory across Environment

I recently noticed a host in my environment that had its Service Console Memory set to 272MB which is far lower than recommended but is default. Since it is possible that others in my environment are also misconfigured I decided I needed a script to change this. A quick search on the internets led me to:

http://ict-freak.nl/2009/07/17/powercli-find-and-set-the-service-console-memory-value/

In his post, Arne Fokkema demonstrates how to generate a report on Console Memory in the environment using his script:

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

Fortunately he also provided a script for modifying this setting. I have it written below with a small modification that takes advantage of PowerShell's ability to perform calculations based on unit (KB/MB/GB). Functionally it isn't any different then Arne's script, but I found it a little more user friendly.

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


Thanks to Arne for his post and work. Take a look at his blog at http://ict-freak.nl/

No comments:

Post a Comment