vs5icm_m10_resourcemonitoring
TRANSCRIPT
© 2011 VMware Inc. All rights reserved
Resource Management and Monitoring
Module 10
10-2
© 2011 VMware Inc. All rights reserved
You Are Here
Course Introduction
Introduction to Virtualization
Virtual Machines
VMware vCenter Server
Configure and Manage Virtual Networks
Configure and Manage Virtual Storage
Managing Virtual Machines
Data Protection
Access & Authentication Control
Resource Management and Monitoring
High Availability
Scalability
Patch Management
Installing vSphere Components
VMware vSphere: Install, Configure, Manage – Revision A
10-3
© 2011 VMware Inc. All rights reserved
Importance
Although the VMkernel works proactively to avoid resource contention, maximizing performance requires both analysis and ongoing monitoring.
VMware vSphere: Install, Configure, Manage – Revision A
10-4
© 2011 VMware Inc. All rights reserved
Module Lessons
Lesson 1: Virtual CPU and Memory Concepts
Lesson 2: Resource Controls
Lesson 3: Resource Pools
Lesson 4: Monitoring Resource Usage
Lesson 5: Using Alarms
VMware vSphere: Install, Configure, Manage – Revision A
10-5
© 2011 VMware Inc. All rights reserved
Lesson 1:Virtual CPU and Memory Concepts
VMware vSphere: Install, Configure, Manage – Revision A
10-6
© 2011 VMware Inc. All rights reserved
Learner Objectives
After this lesson, you should be able to do the following:
Discuss CPU and memory concepts in a virtualized environment.
Describe what over commitment of a resource means.
Identify additional technologies that improve memory utilization.
Describe how virtual SMP works and how hyperthreading is used by the VMkernel.
VMware vSphere: Install, Configure, Manage – Revision A
10-7
© 2011 VMware Inc. All rights reserved
Memory Virtualization Basics
VMware vSphere: Install, Configure, Manage – Revision A
guest OS virtual memory
guest OS physical memory
ESXi hostphysical memory
application
operating system
VMware® ESXi™ host
virtual machineThere are 3 layers of memory in VMware vSphere®.
Guest OS virtual memory is presented to applications by the operating system.
Guest OS physical memory is presented to the virtual machine by the VMkernel.
Host physical memory managed by the VMkernel provides a contiguous, addressable memory space that will be used by the virtual machine.
10-8
© 2011 VMware Inc. All rights reserved
Virtual Machine Memory Overcommitment
VMware vSphere: Install, Configure, Manage – Revision A
Allow RAM overcommitment
A virtual machine swap file (.vswp) is created when a virtual machine’s maximum RAM allocation exceeds its minimum RAM allocation
Virtual machines power on only if:
Minimum memory available, that is overhead memory
Swap file size equals the difference between allocated and reserved memory
VM 1256 MB.vswp
VM 2256 MB.vswp
VM 3256 MB.vswp
On On On Off
256MB 256MB 256MB 256MB
allocated memory = 512 MB
reserved memory = 256 MB
10-9
© 2011 VMware Inc. All rights reserved
Memory Reclamation Techniques
VMware vSphere: Install, Configure, Manage – Revision A
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
Page virtual machine memory out to disk
Use of VMkernel swap space is the last resort, performs poorly
10-10
© 2011 VMware Inc. All rights reserved
Memory Compression
VMware vSphere: Install, Configure, Manage – Revision A
Guest OS physical memory
A 4K B
2K
2K
= memory compression cache
Memory pages are compressed to 2KB and stored in a per-VM compression cache.
Memory pages that are candidates for swap to disk are targeted for compression.
Decompressing a compressed page in memory is faster than performing disk I/O operations.
Compression only takes place when there is contention for physical memory resources.
10-11
© 2011 VMware Inc. All rights reserved
Virtual SMP
VMware vSphere: Install, Configure, Manage – Revision A
10-12
© 2011 VMware Inc. All rights reserved
Hyperthreading
Hyperthreading enables a core to execute two threads, or sets of instructions, at the same time.
To enable hyperthreading:
1. Verify that system supports hyperthreading.
2. Enable hyperthreading in the system BIOS.
3. Ensure that hyperthreading for the VMware ESX®/ESXi host is turned on.
VMware vSphere: Install, Configure, Manage – Revision A
10-13
© 2011 VMware Inc. All rights reserved
CPU Load Balancing
VMware vSphere: Install, Configure, Manage – Revision A
10-14
© 2011 VMware Inc. All rights reserved
Review of Learner Objectives
You should be able to do the following:
Discuss CPU and memory concepts in a virtualized environment.
Describe what over commitment of a resource means.
Identify additional technologies that improve memory utilization.
Describe how virtual SMP works and how hyperthreading is used by the VMkernel.
VMware vSphere: Install, Configure, Manage – Revision A
10-15
© 2011 VMware Inc. All rights reserved
Lesson 2:Resource Controls
VMware vSphere: Install, Configure, Manage – Revision A
10-16
© 2011 VMware Inc. All rights reserved
Learner Objectives
After this lesson, you should be able to do the following:
Describe the resources that can be optimized on virtual machines.
Assign share values for CPU, memory, and disk resources.
Establish CPU, memory, and disk reservations and limits.
Describe how virtual machines compete for resources.
VMware vSphere: Install, Configure, Manage – Revision A
10-17
© 2011 VMware Inc. All rights reserved
Resource Contention
Since virtual machines simultaneously use the resources of a physical server, they should know how to respond when virtual machines are competing for resources.
For proper resource management, vSphere has mechanisms to do the following:
• Enable less, more, or an equal amount of access to a defined resource
• Prevent a virtual machine from consuming large amounts of a resource
• Allow a virtual machine, whose performance is not adequate or requires a certain amount of a resource to run properly, to have a defined amount of resource
VMware vSphere: Install, Configure, Manage – Revision A
10-18
© 2011 VMware Inc. All rights reserved
Shares, Limits, and Reservations
VMware vSphere: Install, Configure, Manage – Revision A
available capacity
0 MHz/MB
limit
Shares are usedto compete in
this range.
reservation
A virtual machine willpower on only if its reservation
can be guaranteed.
10-19
© 2011 VMware Inc. All rights reserved
How Virtual Machines Compete for Resources
VMware vSphere: Install, Configure, Manage – Revision A
Number of shares
Change number of shares
Power on virtual machine
Power off virtual machine
VM A
1000
VM B
1000
VM C
1000
VM A
1000
VM B
3000
VM C
1000
VM A
1000
VM B
3000
VM C
1000
VM D
1000
VM A
1000
VM B
3000
VM D
1000
10-20
© 2011 VMware Inc. All rights reserved
Managed by VMkernelConfigured by virtual machine creator
Adjustable by administrator
CPU cycles
• Hyperthreading• Load balancing• NUMA
• VMware vSphere Virtual Symmetric Multiprocessing
• Limit• Reservation• Share allocation
RAM
• Transparent page sharing
• vmmemctl• Memory compression• VMkernel swap files
for virtual machines
• Available memory
• Limit• Reservation• Share allocation
Disk bandwidth
• Virtual machine file location
• Multipathing
Network bandwidth
• NIC teaming • Traffic shaping
Systems for Optimizing Virtual Machine Resource Use
VMware vSphere: Install, Configure, Manage – Revision A
10-21
© 2011 VMware Inc. All rights reserved
Review of Learner Objectives
You should be able to do the following:
Describe the resources that can be optimized on virtual machines.
Assign share values for CPU, memory, and disk resources.
Establish CPU, memory, and disk reservations and limits.
Describe how virtual machines compete for resources.
VMware vSphere: Install, Configure, Manage – Revision A
10-22
© 2011 VMware Inc. All rights reserved
Lesson 3:Resource Pools
VMware vSphere: Install, Configure, Manage – Revision A
10-23
© 2011 VMware Inc. All rights reserved
Learner Objectives
After this lesson, you should be able to do the following:
Describe resource allocation settings for CPU and memory.
Create a resource pool.
Set resource pool attributes.
Describe expandable reservations.
VMware vSphere: Install, Configure, Manage – Revision A
10-24
© 2011 VMware Inc. All rights reserved
What Is a Resource Pool?
A resource pool is a logical abstraction for hierarchically managing CPU and memory resources.
It is used on standalone hosts or clusters enabled for vSphere Distributed Resource Scheduler (DRS).
It provides resources for virtual machines and child pools.
VMware vSphere: Install, Configure, Manage – Revision A
resource pools
rootresource
pool
10-25
© 2011 VMware Inc. All rights reserved
Why Use Resource Pools?
Using resource pools can result in these benefits:
Flexible hierarchical organization
Isolation between pools and sharing within pools
Access control and delegation
Separation of resources from hardware
Management of sets of virtual machines running a multitier service
VMware vSphere: Install, Configure, Manage – Revision A
10-26
© 2011 VMware Inc. All rights reserved
Resource Pool Attributes
Resource pool attributes:
Shares:
• Low, Normal, High, Custom
Reservations, in MHz and MB
Limits (in MHz and MB):
• Unlimited access, by default (up to maximum amount of resource accessible)
Expandable reservation?
• Yes – Virtual machines and subpools can draw from this pool’s parent.
• No – Virtual machines and subpools can draw only from this pool, even if its parent has free resources.
VMware vSphere: Install, Configure, Manage – Revision A
10-27
© 2011 VMware Inc. All rights reserved
Resource Pool Scenario
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.
We must cap the resource consumption of the test/dev virtual machines.
VMware vSphere: Install, Configure, Manage – Revision A
10-28
© 2011 VMware Inc. All rights reserved
Resource Pool Example
VMware vSphere: Install, Configure, Manage – Revision A
10-29
© 2011 VMware Inc. All rights reserved
Resource Pools Example: CPU Shares
VMware vSphere: Install, Configure, Manage – Revision A
10-30
© 2011 VMware Inc. All rights reserved
Resource Pools Example: CPU Contention
VMware vSphere: Install, Configure, Manage – Revision A
10-31
© 2011 VMware Inc. All rights reserved
Expandable Reservation
Borrowing resources occurs recursively from the ancestors of the current resource pool.
Expandable Reservation option must be enabled.
This option offers more flexibility but less protection.
Expanded reservations are not released until the virtual machine that caused the expansion is shut down or its reservation is reduced.
VMware vSphere: Install, Configure, Manage – Revision A
Retail pool
reservation: 3,000MHz
expandable reservation: Yes
Root resource pool
total CPU: 10,200MHz
total memory: 3,000MB
eCommerce Apps pool
eCommerce Web pool
reservation:1,000MHz
expandable? No
reservation: 1,200MHz
expandable? Yes
An expandable reservation might allow a rogueapplication to claim all unreserved capacity.
10-32
© 2011 VMware Inc. All rights reserved
Example of Expandable Reservation (1)
eCommerce resource pools reserve 2,200MHz of the 3,000MHz that the Retail pool has reserved.
Power on virtual machines in the eCommerce Web pool.
With Expandable Reservation disabled on the eCommerce Web pool, VM3 cannot be started with a reservation of 500MHz.
Lower the virtual machine reservation.
Enable Expandable Reservation.
Increase the eCommerce Web pool’s reservation.
VMware vSphere: Install, Configure, Manage – Revision A
Retail pool
reservation: 3,000MHz
expandable reservation: No
VM1
R=400
VM2
R=300
VM3
R=500
Root resource pool
Total CPU: 10,200MHz
Total memory: 3,000 MB
eCommerce Apps pool
eCommerce Web pool
reservation:1,000MHz
expandable? No
reservation: 1,200MHz
expandable? Yes
10-33
© 2011 VMware Inc. All rights reserved
Example of Expandable Reservation (2)
Enable Expandable Reservation on the eCommerce Web pool.
The system considers the resources available in the child resource pool and its direct parent resource pool.
The virtual machine’s reservation is charged against the reservation for eCommerce Web.
eCommerce Web’s reservation is charged against the reservation for Retail.
VMware vSphere: Install, Configure, Manage – Revision A
Retail pool reservation: 3,000MHz
expandable reservation: Yes
Root resource pool
Total CPU: 10,000MHz Total memory: 3,000MB
VM4R=500
VM5R=500
VM6R=500
VM1R=400
VM2R=300
VM7R=500
VM3R=500
**200MHz used by Retail**
**full reservation used**
eCommerce Apps pool
eCommerce Web pool
reservation:1,000MHz
expandable? Yes
reservation: 1,200MHz
expandable? Yes
10-34
© 2011 VMware Inc. All rights reserved
Admission Control for CPU and Memory Reservations
VMware vSphere: Install, Configure, Manage – Revision A
Power on a virtual machine. Create a new subpoolwith its own reservation.
Increase a pool’sreservation.
Expandablereservation?
Can this poolsatisfy reservation?
No
Yes – Go to parent pool.
Succeed
FailNo
Yes
10-35
© 2011 VMware Inc. All rights reserved
Resource Pool Summary Tab
Click the resource pool’s Summary tab in the Hosts and Clusters inventory view.
VMware vSphere: Install, Configure, Manage – Revision A
10-36
© 2011 VMware Inc. All rights reserved
Resource Allocation Tab
Click the resource pool’s Resource Allocation tab.
VMware vSphere: Install, Configure, Manage – Revision A
10-37
© 2011 VMware Inc. All rights reserved
Scheduling Changes to Resource Settings
VMware vSphere: Install, Configure, Manage – Revision A
Schedule a task to change the resource settings of a
resource pool or a virtual machine.
10-38
© 2011 VMware Inc. All rights reserved
Lab 15
In this lab, you will create and use resource pools on an ESXi host.
1. Create CPU contention.
2. Create a resource pool named Fin-Test.
3. Create a resource pool named Fin-Prod.
4. Verify resource pool functionality.
VMware vSphere: Install, Configure, Manage – Revision A
10-39
© 2011 VMware Inc. All rights reserved
Review of Learner Objectives
You should be able to do the following:
Describe resource allocation settings for CPU and memory.
Create a resource pool.
Set resource pool attributes.
Describe expandable reservations.
VMware vSphere: Install, Configure, Manage – Revision A
10-40
© 2011 VMware Inc. All rights reserved
Lesson 4:Monitoring Resource Usage
VMware vSphere: Install, Configure, Manage – Revision A
10-41
© 2011 VMware Inc. All rights reserved
Learner Objectives
After this lesson, you should be able to do the following:
Monitor a virtual machine’s resource usage:
• CPU
• Memory
• Disk
• Network bandwidth
VMware vSphere: Install, Configure, Manage – Revision A
10-42
© 2011 VMware Inc. All rights reserved
Performance-Tuning Methodology
Assess performance.
Use appropriate monitoring tools.
Record a numerical benchmark before changes.
Identify the limiting resource.
Make more resources available.
Allocate more.
Reduce competition.
Log your changes.
Benchmark again.
VMware vSphere: Install, Configure, Manage – Revision A
Do not make casual changes to production systems.
10-43
© 2011 VMware Inc. All rights reserved
Guest Operating System Monitoring Tools
VMware vSphere: Install, Configure, Manage – Revision A
Task ManagerIometer
10-44
© 2011 VMware Inc. All rights reserved
Using Perfmon to Monitor Virtual Machine Resources
VMware vSphere: Install, Configure, Manage – Revision A
The Perfmon DLL in VMware Tools provides virtual machine processor and memory objects to access host statistics
inside a virtual machine.
10-45
© 2011 VMware Inc. All rights reserved
VMware vCenter Server Performance Charts
The Performance tab displays two kinds of charts for hosts and virtual machines:
Overview charts:
• Display the most common metrics for an object
Advanced charts:
• Display data counters not shown in the overview charts
VMware vSphere: Install, Configure, Manage – Revision A
10-46
© 2011 VMware Inc. All rights reserved
Interpreting Data from the Tools
VMware vCenter Server™ monitoring tools and guest operating system monitoring tools provide different points of view.
VMware vSphere: Install, Configure, Manage – Revision A
Task Manager inguest operating system
CPU Usagechart for host
10-47
© 2011 VMware Inc. All rights reserved
Is a Virtual Machine CPU-Constrained?
If CPU usage is continuously high, the virtual machine is constrained by CPU.
But the host might have enough CPU for other virtual machines to run.
VMware vSphere: Install, Configure, Manage – Revision A
Check the virtual machine’s CPU usage.
10-48
© 2011 VMware Inc. All rights reserved
Are Virtual Machines CPU-Constrained?
Multiple virtual machines are constrained by CPU if:
There is high CPU use in the guest operating system
There are relatively high CPU ready values for the virtual machines
VMware vSphere: Install, Configure, Manage – Revision A
CPU Ready graph of several virtual machinesTask Manager of several operating systems
10-49
© 2011 VMware Inc. All rights reserved
Is a Virtual Machine Memory-Constrained?
Check the virtual machine’s ballooning activity: If ballooning activity is high, this might not be a problem if all virtual machines
have sufficient memory. If ballooning activity is high and the guest operating system is swapping, then
the virtual machine is constrained for memory.
VMware vSphere: Install, Configure, Manage – Revision A
10-50
© 2011 VMware Inc. All rights reserved
Is the Host Memory-Constrained?
If there is active host-level swapping, then host memory is overcommitted.
VMware vSphere: Install, Configure, Manage – Revision A
10-51
© 2011 VMware Inc. All rights reserved
Monitoring Active Memory of a Virtual Machine
Monitor for increases in active memory on the host:
Host active memory refers to active physical memory used by virtual machines and the VMkernel.
If amount of active memory is high, this could lead to virtual machines that are memory-constrained.
VMware vSphere: Install, Configure, Manage – Revision A
10-52
© 2011 VMware Inc. All rights reserved
Are Virtual Machines Disk-Constrained?
Disk-intensive applications can saturate the storage or the path.
If you suspect that a virtual machine is constrained by disk access:
Measure the throughput and latency between the virtual machine and storage.
Use the advanced performance charts to monitor:
• Read rate and write rate
• Read latency and write latency
VMware vSphere: Install, Configure, Manage – Revision A
Inventory object Chart option Storage type
Host Datastore FC, iSCSI, NFS
Host Storage adapter FC
Host Storage path FC, iSCSI
Virtual machine Datastore FC, iSCSI, NFS
Virtual machine Virtual disk FC, iSCSI, NFS
10-53
© 2011 VMware Inc. All rights reserved
Monitoring Disk Latency
To determine disk performance problems, monitor two disk latency data counters:
Kernel command latency:
• The average time spent in the VMkernel per SCSI command.
• High numbers (greater than 2–3ms) represent either an overworked array or an overworked host.
Physical device command latency:
• The average time the physical device takes to complete a SCSI command.
• High numbers (greater than 15–20ms) represent a slow or overworked array.
VMware vSphere: Install, Configure, Manage – Revision A
10-54
© 2011 VMware Inc. All rights reserved
Are Virtual Machines Network-Constrained?
Network-intensive applications often bottleneck on path segments outside the ESX/ESXi host:
Example: WAN links between server and client
If you suspect that a virtual machine is constrained by the network:
Confirm that VMware Tools is installed.
• Enhanced network drivers are available.
Measure the effective bandwidth between the virtual machine and its peer system.
Check for dropped receive packets and dropped transmit packets.
VMware vSphere: Install, Configure, Manage – Revision A
10-55
© 2011 VMware Inc. All rights reserved
Lab 16
In this lab, you will see how CPU workload is reflected by system monitoring tools.
1. Use vCenter Server to monitor CPU utilization.
2. Undo changes made to your virtual machines.
VMware vSphere: Install, Configure, Manage – Revision A
10-56
© 2011 VMware Inc. All rights reserved
Review of Learner Objectives
You should be able to do the following:
Monitor a virtual machine’s resource usage:
• CPU
• Memory
• Disk
• Network bandwidth
VMware vSphere: Install, Configure, Manage – Revision A
10-57
© 2011 VMware Inc. All rights reserved
Lesson 5:Using Alarms
VMware vSphere: Install, Configure, Manage – Revision A
10-58
© 2011 VMware Inc. All rights reserved
Learner Objectives
After this lesson, you should be able to do the following:
Create alarms with condition-based triggers.
Create alarms with event-based triggers.
View and acknowledge triggered alarms.
VMware vSphere: Install, Configure, Manage – Revision A
10-59
© 2011 VMware Inc. All rights reserved
What Is an Alarm?
An alarm is a notification that occurs in response to selected events or conditions that occur with an object in the inventory.
Default alarms exist for various inventory objects:
Many default alarms for hosts and virtual machines
You can create custom alarms for a wide range of inventory objects:
Virtual machines, hosts, clusters, datacenters, datastores, networks, distributed switches, and distributed port groups
VMware vSphere: Install, Configure, Manage – Revision A
Default datacenter
alarms (partial list)
10-60
© 2011 VMware Inc. All rights reserved
Alarm Settings
To create an alarm, right-click the inventory object and select Alarm > Add Alarm.
VMware vSphere: Install, Configure, Manage – Revision A
Alarm types for:
Virtual machinesHosts
ClustersDatacentersDatastoresNetworks
Distributed switchesDistributed virtual port groups
10-61
© 2011 VMware Inc. All rights reserved
Alarm Triggers
An alarm requires a trigger. Types of triggers:
Condition or state trigger – Monitors the current condition or state. Example:
• A virtual machine’s current snapshot is above 2GB in size.
• A host is using 90 percent of its total memory.
• A datastore has been disconnected from all hosts.
Event – Monitors events. Example:
• The health of a host’s hardware has changed.
• A license has expired in the datacenter.
• A host has left the vNetwork distributed switch.
VMware vSphere: Install, Configure, Manage – Revision A
10-62
© 2011 VMware Inc. All rights reserved
Configuring Condition Triggers
Condition triggers for a virtual machine
VMware vSphere: Install, Configure, Manage – Revision A
10-63
© 2011 VMware Inc. All rights reserved
Configuring Event Triggers
Event trigger for a host
VMware vSphere: Install, Configure, Manage – Revision A
10-64
© 2011 VMware Inc. All rights reserved
Configuring Reporting Options
Use the Reporting pane to avoid needless re-alarms.
VMware vSphere: Install, Configure, Manage – Revision A
Avoid smallfluctuations.
Avoid repeats.
10-65
© 2011 VMware Inc. All rights reserved
Configuring Actions
Every alarm type has these actions:
Send a notification email, send a notification trap, or run a command.
Virtual machine alarms and host alarms have more actions.
VMware vSphere: Install, Configure, Manage – Revision A
10-66
© 2011 VMware Inc. All rights reserved
Configuring vCenter Server Notifications
In the menu bar, select Administration > vCenter Server Settings.
VMware vSphere: Install, Configure, Manage – Revision A
Select SNMP to specify trap destinations.
Select Mail to set SMTP parameters.
10-67
© 2011 VMware Inc. All rights reserved
Viewing and Acknowledging Triggered Alarms
VMware vSphere: Install, Configure, Manage – Revision A
The Acknowledge Alarm feature is used to track when triggered alarms are addressed.
10-68
© 2011 VMware Inc. All rights reserved
Lab 17
In this lab, you will demonstrate the vCenter Server alarm feature.
1. Create a virtual machine alarm that monitors for a condition.
2. Create a virtual machine alarm that monitors for an event.
3. Trigger virtual machine alarms and acknowledge them.
4. Disable virtual machine alarms.
VMware vSphere: Install, Configure, Manage – Revision A
10-69
© 2011 VMware Inc. All rights reserved
VMware vSphere: Install, Configure, Manage – Revision A
Review of Learner Objectives
You should be able to do the following:
Create alarms with condition-based triggers.
Create alarms with event-based triggers.
View and acknowledge triggered alarms.
10-70
© 2011 VMware Inc. All rights reserved
Key Points
The VMkernel has built-in mechanisms (such as CPU load balancing and transparent page sharing) for managing the CPU and memory allocation on an ESX/ESXi host.
The Performance tab allows you to monitor a host or virtual machine’s performance in real time or over a period of time.
Use alarms to monitor your vCenter Server inventory. Alarms notify you when selected events or conditions have occurred.
VMware vSphere: Install, Configure, Manage – Revision A