Background: I need accurate measurement of VM memory utilization for billing and capacity planning.
The issue: The CPU and Memory stats reported by VMware vCenter and the definition of the stats in the documentation do not match.
What we are reading:
1. We are reading the Daily, Weekly, Monthly and Yearly stat values from the vCenter database from the database views:
- VPXV_HIST_STAT_DAILY, VPXV_HIST_STAT_Weekly, VPXV_HIST_STAT_Monthly VPXV_HIST_STAT_Yearly
2. We are reading the stat_values for stat_group ‘mem’ and for stat_name ‘usage’ and ‘consumed’
3. Note that we cannot get ‘Active’ mem stat-values because the default monitoring level is 1 and we cannot upgrade it 2 or above because of the potential performance impact.
(note alternately, I am using api to get these)
Documentation as defined in: https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/memory_counters.html
· Consumed = Amount of guest physical memory consumed by the virtual machine for guest memory. Consumed memory does not includeoverheadmemory. It includes shared memory and memory that might be reserved, but not actually used.
Usage = Memory usage as percentage of total configured or available memory. = active÷ virtual machine configured size
Our goalis to get the ‘Active’ memory usage (without turning of level 2) which according to documentation we should be able to get by the following formula:
Active = ‘Consumed’ x ‘Usage’
The actual datawe are getting - See sample below:
SAMPLE_TIME | STAT_ID | STAT_NAME | STAT_GROUP | STAT_ROLLUP_TYPE | ENTITY | STAT_VALUE |
3/25/14 0:00 | 16 | usage | mem | average | vm-1312 | 940 |
3/25/14 0:00 | 90 | consumed | mem | average | vm-1312 | 4192903 |
3/25/14 0:00 | 16 | usage | mem | average | vm-1316 | 196 |
3/25/14 0:00 | 90 | consumed | mem | average | vm-1316 | 2094434 |
As you can see the memusagevalue is above 100 (which cannot be if it is a percentage). Theconsumedvalue is consistent.
(note we get the same data when we access via the sdk apis)
THE QUESTION:
How should we interpret the value ofmemory/usagestat value?
Any assistance would be highly appreciated.