Setting MMU for your VMs
I was asked by my friend Duncan if it was easy enough to set the Memory Management Unit (MMU) for each of his VM’s. Read his post here for more information on what he was working on.
He was about to set this by hand for 50+ VM’s which would take a while, so with the power of the VI Toolkit he can now take it easy whilst PowerShell does the hard work:
For one VM:
Get-VM -Name "MyVM" | Get-View | foreach { $spec = New-Object VMware.Vim.VirtualMachineConfigSpec $spec.flags = New-Object VMware.Vim.VirtualMachineFlagInfo $spec.flags.VirtualMMuUsage = "on" $taskMoRef = $_.ReconfigVM_Task($spec) }
For all VMs you could use:
Get-VM | Get-View | foreach { $spec = New-Object VMware.Vim.VirtualMachineConfigSpec $spec.flags = New-Object VMware.Vim.VirtualMachineFlagInfo $spec.flags.VirtualMMuUsage = "on" $taskMoRef = $_.ReconfigVM_Task($spec) }
Or for each of the VMs in a cluster:
Get-Cluster "MyCluster" | Get-VM | Get-View | foreach { $spec = New-Object VMware.Vim.VirtualMachineConfigSpec $spec.flags = New-Object VMware.Vim.VirtualMachineFlagInfo $spec.flags.VirtualMMuUsage = "on" $taskMoRef = $_.ReconfigVM_Task($spec) }
To list each of the VM’s and their current MMU setting use this one-liner:
Get-VM | Get-View | ForEach {Write "$($_.Name) - $($_.Config.Flags.VirtualMmuUsage)"}







about 1 year ago
Quick question comes to my mind…
How do you tell the actual state of the virtualized MMU ?
Sure by default it is set to ‘Allow the host….’ but then is it ON or OFF ?
Thx
about 1 year ago
Thats a very good question, one unfortunatly I do not know the answer for, you can list from the vm side of things what that option is set too but im guessing the actual detection would need to be done from inside the guest OS, I wonder how you can tell ? I will have a look.
about 1 year ago
Ahhh, Duncan has just answered the question….. “we also wanted to test with “virtualized MMU” set to forced. For a 32Bit Windows OS this setting needs to be set to force other wise it will not be utilized.”
http://www.yellow-bricks.com/2009/03/06/virtualized-mmu-and-tp/
Thanks Duncan
about 1 year ago
Yup he came back to me on VMware Communities as well.
BTW how would you do to test first if guest is a w32bit rather than x64bit one ?
Thx
about 1 year ago
I have adjusted the post to give you a one-liner which will list there current setting.