Archive for December, 2012
Resolving VM Memory Limits with PowerCLI
Dec 14th
During a health check of a pre-existing environment using the vCheck script, I found a lot of VMs with Memory Limits configured. After further investigation, these limits did not appear to be on purpose, but perhaps from a previous template or mis-configuration.
Since there were probably about 50 or so, I wanted to attack this in an automated manner instead of manually editing the settings of each VM, comparing configured memory with the limit, and so on. I found a lot of good resources for clearing them in a sweeping manner, but I wanted an approach that would allow me to first get a report of what the configured memory is and what the configured limit is. Unable to find these, I spent a few minutes concocting the following set of commands:
Get-VM | Foreach-Object -Process { Tee-Object -InputObject $_ -Variable Temp | Get-VMResourceConfiguration | where {$_.MemLimitMB -ne ‘-1′} } | Select VM,@{N=”MemoryMB”;E={$Temp.MemoryMB}},MemLimitMB
This returns in a format as follows:
So, based on the output there may be some VMs with no real reason to have a memory limit since it is equal to their configured memory anyway, but there are also some that have memory limits much lower than their configured memory. If I just cleared all memory limits, I’d have several machines with memory possibly over-allocated. Instead of clearing them all, I found the ones that had these values equal via the following command:
Get-VM | Foreach-Object -Process { Tee-Object -InputObject $_ -Variable Temp | Get-VMResourceConfiguration | where {$_.MemLimitMB -eq $Temp.MemoryMB} } | Select VM,@{N=”MemoryMB”;E={$Temp.MemoryMB}},MemLimitMB
Then I went ahead and cleared those via:
Get-VM | Foreach-Object -Process { Tee-Object -InputObject $_ -Variable Temp | Get-VMResourceConfiguration | where {$_.MemLimitMB -eq $Temp.MemoryMB} } | Set-VMResourceConfiguration -MemLimitMB $null
To reiterate, the aforementioned clears out any memory limits where the limit is the same size as the configured memory. This will spawn sequential tasks within vCenter that, from my runs, took about ~6 seconds each:
For the list of virtual machines with limits set different from their configured memory, those will be addressed manually with re-sizing if appropriate.
VCP5-DT Exam Experience
Dec 8th
In July of 2011, I took and passed the VCA-DT exam based on View 4.x; however, I figured it was time to go ahead and update to the VCP-DT on View 5.x. I found a 25% off exam coupon on Twitter around Thanksgiving time, so I went ahead and scheduled it using that (I’ve seen these floating around frequently and it usually states for the VCP specifically but also applies to VCP-Desktop and VCP-Cloud, from my experience).
Due to Holidays and travel plans, my study time was a little cramped but was able to put together some notes based on the blue print and study some great resources that others in the community have put together. The following are the resources I used:
- VMware Community Member jkpk’s VCP5-DT Notes – Security Guide, Administration Guide, Installation Guide, and Architecture Planning Guide
- SpeakVirtual’s VCP5-DT Blueprint Study Guide
- My personal VCP5-DT Exam Notes
- Official VMware View 5.1 Architecture Planning Guide
- Official VMware View 5.1 Installation Guide
- Official VMware View 5.1 Administration Guide
- Official VMware View 5.1 Security Guide
As far as my experience, I arrived at the testing center early, but myself and others (who were taking things like TSA exams, Microsoft exams, and Cosmetology exams) weren’t able to begin until an hour or so later due to the proctor arriving late. I thought the test was challenging but passed with a pretty good score so in the end it all worked out. I was able to finish with about 45 minutes left of the total 90 minutes allowed. I hope the aforementioned documents prove helpful, and I wish the best of luck to all others in their efforts to obtain this certification!

