This post is intended to cover a couple of closely linked VCAP-DCA objectives. Namely, Calculating Available Resources and Sizing Virtual Machines based on Application Workload.
Calculating Available Resources
There are a number of ways to view resource usage and availability in vCenter, depending on whether you are looking at a cluster as a whole, or at individual hosts. To get an overall view of resource utilization for a cluster, you can use the cluster’s resource distribution chart, which has detail on both CPU and memory utilizaton.
You can investigate resource utilisation on individual hosts by using the vSphere client to view performance data, or by using esxtop/resxtop. The host’s summary tab gives an overview of the host’s CPU and memory usage, though you should bear in mind that the memory usage data here is based on ‘consumed’ memory, and not a total of the virtual machines ‘active’ memory:
More in depth information can be seen by viewing the charts available on the host’s Performance tab:
As stated earlier, you can also use esxtop to help you calculate a host’s available CPU and memory resources. For example, pressing ‘c’ lets you view CPU performance information:
~ # esxtop 9:24:41am up 7:20, 290 worlds, 0 VMs, 0 vCPUs; CPU load average: 0.01, 0.00 PCPU USED(%): 2.2 1.8 1.0 1.0 AVG: 1.5 PCPU UTIL(%): 2.7 2.5 2.0 1.4 AVG: 2.2
PCPU USED (%)represents the effective work of that particular CPU, allowing you to calculate the available resources per PCPU. To check the current memory utilization in esxtop, press the ‘m’ key:
9:27:32am up 7:22, 290 worlds, 0 VMs, 0 vCPUs; MEM overcommit avg: 0.00, 0.00, 0.00 PMEM /MB: 3071 total: 936 vmk, 106 other, 2028 free VMKMEM/MB: 3057 managed: 183 minfree, 2178 rsvd, 878 ursvd, high state PSHARE/MB: 18 shared, 18 common: 0 saving SWAP /MB: 0 curr, 0 rclmtgt: 0.00 r/s, 0.00 w/s ZIP /MB: 0 zipped, 0 saved MEMCTL/MB: 0 curr, 0 target, 0 max
PMEM show’s the amount of physical memory in the host, how much is being used by the vmkernel and how much memory is free. I have written other posts on viewing performance information using esxtop here and here.
You can also view memory and cpu resource usage details for individual virtual machines in the vSphere client, on the virtual machine’s resource allocation tab:
Properly Size a Virtual Machine based on Application Workload
It’s important to allocate the correct amount of resources to a virtual machine to avoid creating performance issues, and wasted resources. There are tools such as VMware’s Capacity Planner, which can help you analyse a servers workload in order to allocate it the correct amount of resources as a virtual machine. Remember – you can always increase the VMs resource allocation if necessary, so it’s better to start with less rather than more resources if you are unsure exactly what the resource requirements are.Keep up to date with new posts on Buildvirtual.net - Follow us on Twitter: Follow @buildvirtual