Resource Management and Monitoring
Module 8
© 2015 VMware Inc. All rights reserved.
You Are Here
9.
7.
Virtual Machine Management
10. Software-Defined Data Center
8.
Resource Management and Monitoring
11.
9.
vSphere HA and vSphere Fault Tolerance
Course Introduction
Creating Virtual Machines
12. vCenter Server
10. Host Scalability
13. Configuring and Managing Virtual Networks
11.
14. Configuring and Managing Virtual Storage
12. Installing vSphere Components
vSphere Update Manager and Host Maintenance
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-2
Importance
Although the VMkernel works proactively to avoid resource contention, maximizing performance requires both analysis and
ongoing monitoring.
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-3
Module Lessons
Lesson 1:
Virtual CPU and Memory Concepts
Lesson 2:
Resource Controls and Resource Pools
Lesson 3:
Monitoring Resource Use
Lesson 4:
Using Alarms
Lesson 5:
vRealize Operations Manager
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-4
Lesson 1:
Virtual CPU and Memory Concepts
8-5
© 2015 VMware Inc. All rights reserved.
Learner Objectives
By the end of this lesson, you should be able to meet the following objectives:
•
Discuss CPU and memory concepts in a virtualized environment
•
Describe what overcommitment of a resource means
•
Identify additional technologies that improve memory utilization
ã
Describe how VMware vSpheređ Virtual Symmetric Multiprocessing works and how hyperthreading is used by the VMkernel
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-6
Memory Virtualization Basics
VMware vSpheređ has three layers of memory:
ã
Guest operating system virtual memory is presented to
applications by the operating system.
•
Guest operating system physical memory is presented
to the virtual machine by the VMkernel.
•
Host machine memory that is managed by the
VMkernel provides a contiguous, addressable memory
space that is used by the virtual machine.
Virtual Machine
Application
Operating System
Guest OS
Virtual Memory
Guest OS
Physical Memory
ESXi Host
ESXi Host
Machine Memory
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-7
Virtual Machine Memory Overcommitment
Memory is overcommitted when the combined
Host machine memory = 2 GB
working memory footprint of all virtual machines
exceeds that of the host memory sizes.
Total configured VM memory = 4 GB
Virtual machines do not always use their full
allocated memory.
On
Off
On
On
An ESXi host transfers memory from idle virtual
machines to virtual machines that need more
1GB
memory to improve memory utilization.
1GB
1GB
1GB
Memory overhead is stored in a swap file (.vswp).
vmxd-*.vswp
VM 1
VM 2
VM 3
.vswp
.vswp
.vswp
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-8
Memory Reclamation Techniques
Economize use of physical memory pages:
•
Transparent page sharing allows pages with identical contents to be stored only once.
Deallocate memory from one virtual machine for another:
•
Ballooning mechanism, active when memory is scarce, forces virtual machines to use their own paging areas.
Memory compression:
•
Attempts to reclaim some memory performance when memory contention is high.
Host-level SSD swapping:
•
Use of a solid-state drive (SSD) on the host for a host cache swap file might increase performance.
Page virtual machine memory out to disk:
•
Use of VMkernel swap space is the last resort due to the poor performance.
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-9
Virtual SMP
dual VM
uni VM
vCPU
vCPU
quad VM
vCPU
vCPU
vCPU
vCPU
vCPU
Virtual
Physical
Thread
Core
LCPU
LCPU
LCPU
LCPU
LCPU
LCPU
LCPU
LCPU
Socket
Single-Core Dual-Socket System
Dual-Core Single-Socket System
Quad-Core Single-Socket System
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-10
Hyperthreading
Hyperthreading enables a core to execute two threads, or sets of
instructions, at the same time.
dual VM
uni VM
Hyperthreading provides more scheduler throughput.
To enable hyperthreading:
1.
Verify that the host system supports hyperthreading.
2.
Enable hyperthreading in the system BIOS.
3.
Ensure that hyperthreading for the ESXi host is turned on.
4.
Hyperthreading is enabled by default.
LCPU
LCPU
LCPU
LCPU
Dual-Core Single-Socket System with Hyperthreading
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-11
CPU Load Balancing
uni
uni VM
VM
uni
uni VM
VM
dual VM
uni
uni VM
VM
LCPU
LCPU
LCPU
LCPU
LCPU
LCPU
LCPU
LCPU
Hyperthreaded Dual-Core, Dual-Socket System
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-12
Review of Learner Objectives
You should be able to meet the following objectives:
•
Discuss CPU and memory concepts in a virtualized environment
•
Describe what overcommitment of a resource means
•
Identify additional technologies that improve memory utilization
ã
Describe how VMware vSpheređ Virtual Symmetric Multiprocessing works and how hyperthreading is used by the VMkernel
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-13
Lesson 2:
Resource Controls and Resource Pools
8-14
© 2015 VMware Inc. All rights reserved.
Learner Objectives
By the end of this lesson, you should be able to meet the following objectives:
•
Assign share values for CPU, memory, and disk resources
•
Describe how virtual machines compete for resources
•
Create a resource pool
•
Set resource pool attributes
•
Establish CPU and memory reservations and limits
ã
Describe expandable reservations
VMware vSphere: Install, Configure, Manage
â 2015 VMware Inc. All rights reserved.
8-15
Shares, Limits, and Reservations
A virtual machine powers on only if its reservation can be guaranteed.
Available Capacity
Limit
Shares are used to compete in this
range.
Reservation
0 MHz/MB
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-16
How Virtual Machines Compete for Resources
Virtual machines are resource consumers. The default resource settings that you assign during creation work well for most
machines.
Number of shares.
Change number of shares.
Power on virtual machine.
Power off virtual machine.
1000
1000
1000
VM A
VM B
VM C
1000
3000
1000
VM A
VM B
VM C
1000
3000
1000
1000
VM A
VM B
VM C
VM D
1000
3000
1000
VM A
VM B
VM D
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-17
About Resource Pools
A resource pool is a logical abstraction of hierarchically managed CPU and memory resources.
Root Resource Pool
Sibling Resource Pools
Parent Resource Pool
Child Resource Pool
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-18
Resource Pool Attributes
You can create a child resource pool of any VMware
ESXi™ host, resource pool, or VMware vSphere®
Distributed Resource Scheduler™ cluster.
•
•
•
Shares: Low, Normal, High, Custom
Reservations: In MHz or GHz, MB or GB
Limits:
–
–
•
In MHz or GHz, MB or GB.
Unlimited access, by default, up to maximum amount of
resource accessible.
Reservation type:
–
Expandable selected: Virtual machines and subpools can
draw from this pool’s parent.
–
Expandable deselected: Virtual machines and subpools can
draw only from this pool, even if its parent has free
resources.
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-19
Reasons to Use Resource Pools
Use of resource pools can provide these benefits:
•
Flexible hierarchical organization
•
Isolation between pools and sharing in pools
•
Access control and delegation
•
Separation of resources from hardware
•
Management of sets of virtual machines running a multitier service
•
Ability to prioritize virtual machine workloads
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-20
Resource Pool Case Study
Company X’s IT department has two internal customers:
•
The Finance Department supplies two-thirds of the budget.
•
The Engineering Department supplies one-third of the budget.
Each internal customer has both production and test/dev virtual machines.
You must control the resource consumption of the test/dev virtual machines.
You must also ensure the entitled resources of the Finance Department.
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-21
Resource Pool Example
This example shows where resource attributes are set on a resource pool.
Engineering Pool
CPU Shares: 1000
Reservation: 1,000 MHz
Limit: 4,000 MHz
Expandable Reservation: Yes
Eng-Test VM
Eng-Prod VM
CPU Shares: 1000
CPU Shares: 2000
Reservation: 0 MHz
Reservation: 250 MHz
Limit: 4000 MHz
Limit: 4000 MHz
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-22
Resource Pools Example: CPU Shares
In this example, the Finance resource pool has twice as many CPU shares as the Engineering resource pool. It is entitled to
twice as many CPU resources as the Engineering resource pool.
Standalone Host: Srv001 (Root Resource Pool)
Eng-Test VM
CPU Shares: 1000
Engineering Pool
Engineering pool
Finance Pool
Engineering pool
CPU Shares: 1000
CPU Shares: 2000
Eng-Prod VM
CPU Shares: 2000
Fin-Prod VM
Fin-Test VM
CPU Shares: 1000
CPU Shares: 2000
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-23
Resource Pools Example: CPU Contention
Srv01
All VMs below are running on the same physical
CPU.
Engineering Pool
Engineering pool
Eng-Test VM
CPU Shares: 1000
Finance Pool
Engineering pool
CPU Shares: 1000
CPU Shares: 2000
-%33 of Physical CPU
-67% of Physical CPU
Eng-Prod VM
CPU Shares: 2000
Fin-Prod VM
Fin-Test VM
CPU Shares: 1000
CPU Shares: 2000
Engineering ~33%
11%
Eng-test gets ~33% of Engineering’s CPU allocation: approximately 11% of the
physical CPU.
22%
Finance ~67%
45%
22%
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-24
Expandable Reservation
Root Resource Pool
Borrowing resources occurs recursively from the ancestors
of the current resource pool:
Total CPU: 10,200 MHz
Total Memory: 3,000 MB
•
The Expandable Reservation option must be enabled.
•
This option offers more flexibility but less protection.
Retail Pool
Expanded reservations are not released until the virtual
Reservation: 3,000 MHz
Expandable Reservation: Yes
machine that caused the expansion is shut down or its
reservation is reduced.
eCommerce Apps Pool
eCommerce Web Pool
Reservation: 1,200 MHz
Reservation:
Expandable? Yes
1,000 MHz
Expandable? No
A mismanaged or mis-sized expandable reservation might claim all unreserved capacity.
VMware vSphere: Install, Configure, Manage
© 2015 VMware Inc. All rights reserved.
8-25