resource monitoring

70
Resource Monitoring Module 9

Upload: palila

Post on 24-Feb-2016

65 views

Category:

Documents


0 download

DESCRIPTION

Resource Monitoring. Module 9. You Are Here. vSphere Environment. Operations. Introduction to VMware Virtualization. Access Control. VMware ESX and ESXi. Resource Monitoring. VMware vCenter Server. Data Protection. Networking. Scalability. Storage. High Availability. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Resource Monitoring

Resource Monitoring Module 9

Page 2: Resource Monitoring

Module 2-2

You Are Here

VMware vSphere 4.1: Install, Configure, Manage – Revision A

vSphere Environment

Introduction to VMware Virtualization

VMware ESX and ESXi

VMware vCenter Server

Networking

Storage

Virtual Machines

Operations

Access Control

Data Protection

Scalability

High Availability

Patch Management

Installing VMware ESX and ESXi

Resource Monitoring

Page 3: Resource Monitoring

Module 2-3

Importance

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Although the VMkernel works proactively to avoid resource contention, maximizing performance requires both analysis and ongoing monitoring.

Page 4: Resource Monitoring

Module 2-4

Module Lessons

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Lesson 1: Resource Controls and Resource Pools Lesson 2: Virtual CPU and Memory Concepts Lesson 3: Monitoring Resource Usage Lesson 4: Using Alarms

Page 5: Resource Monitoring

Module 2-5

Lesson 1:Resource Controls and Resource Pools

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Page 6: Resource Monitoring

Module 2-6

Lesson Objectives

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Describe resource allocation settings for: • CPU• Memory• Storage I/O

Create a resource pool

Page 7: Resource Monitoring

Module 2-7

Systems for Optimizing Virtual Machine Resource Use

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Managed by VMkernelConfigured by virtual machine owner

Adjustable by administrator

CPU cycles

• Hyperthreading• Load balancing• NUMA

• VMware® Virtual SMP

• 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• Storage I/O Control• Multipathing

Network bandwidth

• NIC teaming

• Traffic shaping• Network I/O Control

(distributed virtual switch only)

Page 8: Resource Monitoring

Module 2-8

Resource Management

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Resource management is the allocation of resources from providers (hosts, clusters, and resource pools) to consumers (virtual machines). Resources include CPU, memory, storage, and network.

Resource management: Resolves resource overcommitment Prevents virtual machines from monopolizing resources Exploits undercommitted resources Controls the relative importance of virtual machines

Resource allocation settings: CPU and memory is controlled by using shares, limits, and reservations. Storage I/O is controlled by using shares and limits.

Page 9: Resource Monitoring

Module 2-9

Virtual Machine CPU Resource Settings

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Limit (MHz): A cap on the consumption

of CPU time by this virtual machine

Reservation (MHz): A certain number of CPU

cycles reserved for this virtual machine

Shares: A value that specifies the

relative priority or importance of a virtual machine

Page 10: Resource Monitoring

Module 2-10

How Virtual Machines Compete for Resources

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Proportional-share system for relative resource management: Applied during resource contention Prevents virtual machines from monopolizing resources Guarantees predictable resource shares

Number of shares

Change number of shares.

Power on VM.

Power off VM.

Page 11: Resource Monitoring

Module 2-11

Virtual Machine Memory Resource Settings

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Available memory: Memory size defined when the

virtual machine was createdLimit (MB): A cap on the consumption of

physical memory by this virtual machine

Reservation (MB): A certain amount of physical

memory reserved for this virtual machine

Shares: A value that specifies the relative

priority or importance of a virtual machine

A virtual machine swap file covers the range between available memory and reservation.

Page 12: Resource Monitoring

Module 2-12

Virtual Machine Storage I/O Resource Settings

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Storage I/O Control resource settings: Limit (IOPs):

• Cap on the storage I/O bandwidth for the virtual machine Shares:

• A value that shows relative importance of a virtual machine

Storage I/O Control: Must be enabled on the datastore Has several requirements

IOPS Iometer latencyVM1 1,500 20msVM2 1,500 21ms

IOPS Iometer latency1,080 31ms1,900 16ms

Example 1: Two VMs running Iometer(VM1:1,000 shares, VM2: 2,000 shares)

Without shares/limits With shares/limits

Page 13: Resource Monitoring

Module 2-13

What Is a Resource Pool?

VMware vSphere 4.1: Install, Configure, Manage – Revision A

A resource pool is a logical abstraction for hierarchically managing CPU and memory resources.It is used on standalone hosts or clusters enabled for VMware Distributed Resource Scheduler.It provides resources for virtual machines and child pools.

resource pools

rootresource

pool

Page 14: Resource Monitoring

Module 2-14

Why Use Resource Pools?

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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

Page 15: Resource Monitoring

Module 2-15

Resource Pool Attributes

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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.

Page 16: Resource Monitoring

Module 2-16

Resource Pool Scenario

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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.

Page 17: Resource Monitoring

Module 2-17

Resource Pool Example

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Page 18: Resource Monitoring

Module 2-18

Resource Pools Example: CPU Shares

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Page 19: Resource Monitoring

Module 2-19

Resource Pools Example: CPU Contention

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Page 20: Resource Monitoring

Module 2-20

Expandable Reservation

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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.

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.

Page 21: Resource Monitoring

Module 2-21

Example of Expandable Reservation (1)

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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.

Retail pool

reservation: 3,000MHz expandable reservation: No

VM1R=40

0

VM2R=30

0VM3

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

Page 22: Resource Monitoring

Module 2-22

Example of Expandable Reservation (2)

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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.

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

VM2

R=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

Page 23: Resource Monitoring

Module 2-23

Admission Control for CPU and Memory Reservations

VMware vSphere 4.1: 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

Page 24: Resource Monitoring

Module 2-24

Resource Pool Summary Tab

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Click the resource pool’s Summary tab in the Hosts and Clusters inventory view.

Page 25: Resource Monitoring

Module 2-25

Resource Allocation Tab

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Click the resource pool’s Resource Allocation tab.

Page 26: Resource Monitoring

Module 2-26

Scheduling Changes to Resource Settings

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Schedule a task to change the resource settings of a resource

pool or a virtual machine.

Page 27: Resource Monitoring

Module 2-27

Lab 14

VMware vSphere 4.1: Install, Configure, Manage – Revision A

In this lab, you will create and use resource pools on an ESXi host.1. Create a resource pool.2. Verify resource pool functionality.

Page 28: Resource Monitoring

Module 2-28

Lesson Summary

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Describe resource allocation settings for:• CPU• Memory• Storage I/O

Create a resource pool

Page 29: Resource Monitoring

Module 2-29

Lesson 2:Virtual CPU and Memory Concepts

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Page 30: Resource Monitoring

Module 2-30

Lesson Objectives

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Identify the methods used by the VMkernel for optimizing CPU and memory usage

Page 31: Resource Monitoring

Module 2-31

Multicore Processors

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Page 32: Resource Monitoring

Module 2-32

Hyperthreading

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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.

Page 33: Resource Monitoring

Module 2-33

CPU Load Balancing

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Page 34: Resource Monitoring

Module 2-34

Memory Virtualization Overview

VMware vSphere 4.1: Install, Configure, Manage – Revision A

The VMkernel manages a machine’s entire memory. Part of this memory is used by the VMkernel. Some memory is used by the service console (ESX only). The rest is available for use by virtual machines:

• Configured memory, plus overhead

Virtual machines can use more memory than the physical machine has available. This is called memory overcommitment.

Memory compression improves virtual machine performance when memory is overcommitted. When memory becomes overcommitted, virtual pages are

compressed and stored in memory. Compressed memory is faster to access than memory swapped

to disk.

Page 35: Resource Monitoring

Module 2-35

Transparent Page Sharing

VMware vSphere 4.1: Install, Configure, Manage – Revision A

The VMkernel detects identical pages in the memory of virtual machines and maps them to the same underlying physical page: No changes to guest

operating system requiredThe VMkernel treats the shared pages as copy-on-write: Read-only when shared Private copies after write

A best practice is to always keep transparent page sharing enabled.

hardware RAM

VM RAMVM RAMVM RAM

Page 36: Resource Monitoring

Module 2-36

vmmemctl: Balloon-Driver Mechanism

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Deallocate memory from selected virtual machines when RAM is scarce.

Inflate balloon. (Driver demands

memory from guest OS.)

Guest is forced to page out to its own paging area.

The VMkernel reclaims memory.

Guest can page in. ESX/ESXi

grants memory.

Deflate balloon. (Driver relinquishes

memory.)

Ample memory.Balloon remains

uninflated.

Page 37: Resource Monitoring

Module 2-37

VMkernel Swap

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Each powered-on virtual machine needs its own VMkernel swap file: Created when the virtual machine is

powered on. Deleted when the virtual machine is powered off.

Default location: same VMware vStorage VMFS volume as virtual machine’s boot disk.

Size is equal to the difference between the memory guaranteed to it, if any, and the maximum it can use.

Allows the VMkernel to swap out the virtual machine entirely if memory is scarce.

Use of VMkernel swap is a last resort. Performance will be noticeably slow.

Page 38: Resource Monitoring

Module 2-38

Ballooning Compared with VMkernel Swapping

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Page 39: Resource Monitoring

Module 2-39

Lesson Summary

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Identify the methods used by the VMkernel for optimizing CPU and memory usage

Page 40: Resource Monitoring

Module 2-40

Lesson 3:Monitoring Resource Usage

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Page 41: Resource Monitoring

Module 2-41

Lesson Objectives

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Monitor a virtual machine’s resource usage:• CPU• Memory• Disk• Network bandwidth

Page 42: Resource Monitoring

Module 2-42

Performance-Tuning Methodology

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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.

Do not make casual changes to production systems.

Page 43: Resource Monitoring

Module 2-43

Guest Operating System Monitoring Tools

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Task ManagerIometer

Page 44: Resource Monitoring

Module 2-44

Using Perfmon to Monitor Virtual Machine Resources

VMware vSphere 4.1: 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.

Page 45: Resource Monitoring

Module 2-45

VMware vCenter Server Performance Charts

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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

Page 46: Resource Monitoring

Module 2-46

Interpreting Data from the Tools

VMware vSphere 4.1: Install, Configure, Manage – Revision A

VMware vCenter™ Server monitoring tools and guest operating system monitoring tools provide different points of view.

Task Manager inguest operating system

CPU Usagechart for host

Page 47: Resource Monitoring

Module 2-47

Is a Virtual Machine CPU-Constrained?

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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.

Check the virtual machine’s CPU

usage.

Page 48: Resource Monitoring

Module 2-48

Are Virtual Machines CPU-Constrained?

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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

CPU Ready graph of several virtual machinesTask Manager of several operating systems

Page 49: Resource Monitoring

Module 2-49

Is a Virtual Machine Memory-Constrained?

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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.

Page 50: Resource Monitoring

Module 2-50

Is the Host Memory-Constrained?

VMware vSphere 4.1: Install, Configure, Manage – Revision A

If there is active host-level swapping, then host memory is overcommitted.

Page 51: Resource Monitoring

Module 2-51

Monitoring Active Memory of a Virtual Machine

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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.

Page 52: Resource Monitoring

Module 2-52

Are Virtual Machines Disk-Constrained?

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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

Inventory object Chart option Storage typeHost Datastore FC, iSCSI, NFSHost Storage adapter FCHost Storage path FC, iSCSI

Virtual machine Datastore FC, iSCSI, NFSVirtual machine Virtual disk FC, iSCSI, NFS

Page 53: Resource Monitoring

Module 2-53

Monitoring Disk Latency

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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.

Page 54: Resource Monitoring

Module 2-54

Are Virtual Machines Network-Constrained?

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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.

Page 55: Resource Monitoring

Module 2-55

Lab 15

VMware vSphere 4.1: Install, Configure, Manage – Revision A

In this lab, you will see how CPU workload is reflected by system monitoring tools.1. Use vCenter Server to monitor CPU utilization.

Page 56: Resource Monitoring

Module 2-56

Lesson Summary

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Monitor a virtual machine’s resource usage:• CPU• Memory• Disk• Network bandwidth

Page 57: Resource Monitoring

Module 2-57

Lesson 4:Using Alarms

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Page 58: Resource Monitoring

Module 2-58

Lesson Objectives

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Create alarms with condition-based triggers Create alarms with event-based triggers View and acknowledge triggered alarms

Page 59: Resource Monitoring

Module 2-59

What Is an Alarm?

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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

Default datacenter

alarms (partial list)

Page 60: Resource Monitoring

Module 2-60

Alarm Settings

VMware vSphere 4.1: Install, Configure, Manage – Revision A

To create an alarm, right-click the inventory object and select Alarm > Add Alarm.

Alarm types for:Virtual machines

HostsClusters

DatacentersDatastoresNetworks

Distributed switchesDistributed virtual port groups

Page 61: Resource Monitoring

Module 2-61

Alarm Triggers

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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.

Page 62: Resource Monitoring

Module 2-62

Configuring Condition Triggers

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Condition triggers for a virtual machine

Page 63: Resource Monitoring

Module 2-63

Configuring Event Triggers

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Event trigger for a host

Page 64: Resource Monitoring

Module 2-64

Configuring Reporting Options

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Use the Reporting pane to avoid needless re-alarms.

Avoid small

fluctuations.

Avoid repeats.

Page 65: Resource Monitoring

Module 2-65

Configuring Actions

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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.

Page 66: Resource Monitoring

Module 2-66

Configuring vCenter Server Notifications

VMware vSphere 4.1: Install, Configure, Manage – Revision A

In the menu bar, select Administration > vCenter Server Settings.

Select SNMP to specify trap

destinations.

Select Mail to set SMTP parameters.

Page 67: Resource Monitoring

Module 2-67

Viewing and Acknowledging Triggered Alarms

VMware vSphere 4.1: Install, Configure, Manage – Revision A

The Acknowledge Alarm feature is used to track when triggered alarms are addressed.

Page 68: Resource Monitoring

Module 2-68

Lab 16

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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.

Page 69: Resource Monitoring

Module 2-69

Lesson Summary

VMware vSphere 4.1: Install, Configure, Manage – Revision A

Create alarms with condition-based triggers Create alarms with event-based triggers View and acknowledge triggered alarms

Page 70: Resource Monitoring

Module 2-70

Key Points

VMware vSphere 4.1: Install, Configure, Manage – Revision A

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.