Sunteți pe pagina 1din 61

VM

Resource
Management
Module 8

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-1
You are here

Virtual Infrastructure Virtual Machines Operations


VMware Overview VM Creation and Data Protection
ESX Server Installation Management
ESX Server Installation VM Creation & Management VM Resource Monitoring

Networking Resource Pools


Networking VM Access Control Data & Availability Protection
Storage
Storage VM Resource Management Troubleshooting Tips

ESX ServerInstallation
VirtualCenter Installation

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-2
Importance and module objectives

• Importance
• VMotion is a valuable tool for availability and resource
management
• Resource pools allow you to define resource policies that are
enforceable regardless of server heterogeneity, VMotion activity, or
VMware HA activity
• Objectives for the learner
• To use standalone resource pools for single-host resource policy
control
• To create and configure a DRS cluster
• To build child resource pools in a DRS cluster and use them to
manage resource policies across hosts

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-3
Module lessons

• Lesson 1: Using Resource Pools


• Lesson 2: Migrate VMs with VMotion
• Lesson 3: VMware DRS (Distributed Resource Scheduler)
• Lesson 4: Resource Pools in a DRS Cluster

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-4
Lesson 1:
Using
Resource Pools

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-5
Lesson topics

• How are VMs’ CPU and memory resources managed?


• What is a resource pool?
• Managing a pool’s resources
• A resource pool example
• Admission control

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-6
VMs’ CPU resource settings
• Limit
• A cap on the consumption of CPU time by this
VM, measured in MHz
• Reservation
• A certain number of CPU cycles reserved for
this VM, measured in MHz
• The VMkernel chooses which CPU(s), and
may migrate
• Shares
• More shares means that this VM will win
competitions for CPU time more often

• All the VCPUs in a VM must be


simultaneously scheduled
• Therefore, a reservation of 1000 MHz might be
generous for a 1-VCPU VM, but not for a
4-VCPU VM

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-7
VMs’ memory resource settings
• Limit
• A cap on the consumption of memory by this
VM, measured in MB
• Reservation
• A certain amount of memory reserved for this
VM, measured in MB
• Shares
• More shares means that this VM will win
competitions for memory more often

• VMkernel allocates a per-VM swap file


to cover each VM’s range between limit
and reservation

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-8
How VMs compete for resources
• Proportional-share system for relative resource management
• Applied during resource contention
• Prevents VMs from monopolizing resources
• Guarantees predictable resource shares
Number of Shares

• Change number of
shares
• Power on VM

• Power off VM

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-9
What is a resource pool?

• An object in the
VirtualCenter inventory
• A pool of CPU and memory
for VMs
• Can have associated
access control and
permissions
• Can be used on a stand-
alone host or in a cluster
Cluster
(group of hosts)
Resource
pool

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-10
Managing a pool’s resources

• Resource pools have the


following attributes:
• Shares
• Low, Normal, High
• Reservations, in MHz and MB
• Limits, in MHz and MB
• Unlimited access, by default (up to
maximum amount of resource accessible)
• Expandable Reservation?
• Yes: VMs and sub-pools may draw from this
pool’s parent
• No: VMs and sub-pools may only draw from
this pool, even if its parent has free
resources

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-11
Scenario

• Company X’s IT department has two internal customers


• The finance department supplies 2/3 of the budget
• The engineering department supplies 1/3 of the budget
• Each internal customer has both production and test/dev
virtual machines
• We must cap the test/dev VMs’ resource consumption

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-12
Resource pool example
stand-alone host – Svr001
(root resource pool)
CPU: 12000 MHz
Memory: 4 GB

Engineering (Resource Pool)


CPU Shares: 1000
Reservation: 1000 MHz
Limit: 4000 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 Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-13
Resource pools example: CPU shares
stand-alone host – Svr001
(root resource pool)

Engineering (Resource Pool) Finance (Resource Pool)

CPU Shares: 1000 CPU Shares: 2000

Eng-Test (VM) Eng-Prod (VM) Fin-Test (VM) Fin-Prod (VM)

CPU Shares: 1000 CPU Shares: 2000 CPU Shares: 1000 CPU Shares: 2000

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-14
Resource pools example: CPU contention
Svr001
All VMs below are running on
same physical CPU (PCPU)

Engineering Finance
CPU Shares: 1000 CPU Shares: 2000
~33% of PCPU ~67% of PCPU

Eng-Test Eng-Prod Fin-Test Fin-Prod


CPU Shares: CPU Shares: CPU Shares: CPU Shares: Engineering
1000 2000 1000 2000 ~33%
11%

22%
45%

22%

Eng-Test gets ~33% of Engineering’s Finance


CPU allocation = Approximately 11% of ~67%
the PCPU
%age of PCPU allocation

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-15
Admission control for CPU and memory reservations

Create a new sub-pool Change a pool’s


Power on a VM
with its own reservation reservation

No Expandable Yes
reservation?

Yes Can this pool


Can this pool
or its parent satisfy
satisfy reservation?
reservation?

No Succeed No

Fail

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-16
Lab for lesson 1

• Create and Use Resource Pools on a Standalone Host


• In this lab, you will perform the following tasks:
• Build two resource pools and assign resource policies to them
• See the resource pools’ impact on resource allocation

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-17
Lesson summary

• Resource pools are a way to aggregate resource policies


• Resource pools can be built on top of either standalone
ESX Server hosts or DRS clusters
• VMs can only be powered on if their resource
requirements can be satisfied

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-18
Lesson 2:
Migrate VMs
with
VMotion

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-19
Lesson topics

• VMotion migration
• VMotion compatibility requirements
• Topology maps

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-20
Move VM between ESX servers: VMotion migration

• A VMotion migration moves a VM that is powered on


• Why migrate using VMotion?
• Improve overall hardware utilization
• Allow continued VM operation while accommodating scheduled
hardware downtime

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-21
How VMotion works
• Users currently accessing VM A on esx01
• Initiate migration of VM A from esx01 to esx02
while VM A is up and running

VMotion
Network
Production
Network

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-22
How VMotion works (2)
• Pre-copy memory from esx01 to esx02
• Log ongoing memory changes into a memory bitmap on
esx01

Memory
Bitmap

VMotion Memory
Network
Production
Network

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-23
How VMotion works (3)
• Quiesce virtual machine on esx01
• Copy memory bitmap to esx02

VMotion Memory Bitmap


Network
Production
Network

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-24
How VMotion works (4)
• Start VM A on esx02
• Users now access VM A on esx02

Memory
Bitmap

VMotion
Network
Production
Network

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-25
How VMotion works (5)
• Copy VM’s remaining memory (as listed in memory
bitmap) from esx01
• Fetch pages from source VM when applications attempt
to read/write modified memory in VM A on esx02

Memory
Bitmap

VMotion Fetch Pages/Copy


Network Pages
Production
Network

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-26
How VMotion works (6)
• Delete VM A from esx01 after migration is successful

VMotion
Network
Production
Network

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-27
Virtual machine requirements for VMotion

• Migrating a VM with the following conditions produces


an error:
• VM has an active connection to an internal virtual switch
• VM has an active connection to a CD-ROM or floppy device
with a local image mounted
• VM has its CPU affinity set to run on one or more specific,
physical CPUs
• VM is in a cluster relationship (e.g. using MSCS) with another VM
• Migrating a VM with the following conditions produces
a warning:
• VM is configured with an internal virtual switch but is not
connected to it
• VM is configured to access a local CD-ROM or floppy image
but is not connected to it

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-28
Host requirements for VMotion

• Source and destination ESX Servers must have


• Visibility to all SAN LUNs (either FC or iSCSI) and NAS devices
used by VM
• A Gigabit Ethernet backplane
• Access to the same physical networks
• Consistently labeled virtual switch port groups
• Compatible CPUs
• New CPU features exposed, which introduce new VMotion
compatibility constraints and trade-offs

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-29
CPU constraints on VMotion

CPU
Exact Match Required? Why or why not?
Characteristics
Clock speeds, cache No Virtualized away by VMkernel
sizes, hyper-
threading, and
number of cores
Manufacturer Yes Instruction sets contain many small
(Intel or AMD) differences
Family
(P3, P4, Opteron)
Presence or absence Yes Multimedia instructions usable
of SSE3 instructions directly by applications

Virtualization For 32-bit VMs: No Virtualized away by VMkernel


Hardware Assist
For 64-bit VMs on Intel: VMware’s Intel 64-bit implementation
Yes leverages VT
Execution-Disable Yes (but customizable) Guest OS relies on NX/XD bit if
detected

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-30
Enable or disable Nx/xD

Choose between
Nx/xD security features
or broadest VMotion
compatibility

For future CPU


features, edit mask
at the bit level

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-31
Identifying CPU characteristics
• In most cases, use server & CPU family/model specifications
• Use VMware’s CPU bootable utility

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-32
Using topology maps to plan VMotion layout
• Topology maps are a VirtualCenter feature that
allow you to graphically show the relationships
between:
• Hosts
• Virtual machines
• Networks
• Datastores
• Used to answer questions when planning
VMotion scenarios, such as:
• Are all my hosts attached to the same shared storage?
• What hosts can my virtual machine VMotion to?
• Can also be useful for other scenarios such as
planning VMware HA and DRS clusters
• Is my cluster set up correctly to support DRS?

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-33
Example: Checking VMotion requirements

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-34
Example: Hosts attached to same shared storage?

Host Resources Map

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-35
Example: VM on storage shared by both ESX servers?

Legend Virtual Machine Resources Map


= Datastore

= vSwitch

= VM
= Managed host

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-36
Example: Create a custom topology map

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-37
Lab for lesson 2

• Migrate Virtual Machines


Using VMotion New lab requirement:
Join another team’s
• In this lab, you will perform the
following tasks: VirtualCenter!
• Create a VMkernel port for VirtualCenter VirtualCenter
VMotion Server Server
#3 #4
• Migrate a virtual machine using
VMotion
ESX Server ESX Server
#3 #4
ESX Server of higher-
numbered team must be added
to VirtualCenter Server of Student 03a Student 03b Student 04a Student 04b

lower-numbered team

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-38
Lesson 3:
VMware DRS
(Distributed Resource
Scheduler)

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-39
Lesson topics

• DRS benefits and how it works


• DRS cluster settings
• Automation level
• System-wide
• Per-VM
• Placement constraints
• DRS best practices

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-40
DRS cluster in the VirtualCenter inventory

• DRS allows you to


aggregate several hosts’
resources into one
resource pool
• Create a cluster, enable
DRS, add hosts
• A DRS cluster is implicitly a
resource pool
• You may divide each Cluster
resource pool into sub-
pools Resource
• And grant other pool
administrators the privilege
to make VMs and/or
subpools there

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-41
DRS: purpose and features

• Goals of DRS
• Balance virtual machine load across hosts in cluster
• Enforce resource policies accurately (reservations, limits, shares)
• Respect placement constraints
• Affinity and anti-affinity rules
• VMotion compatibility (CPU type, SAN and LAN connectivity)

• Initial placement • Dynamic balancing


• Power on virtual machine in • Monitor key virtual machine,
resource pool pool, and host metrics
• Recommend host (prioritized • Deliver entitled resources to
list) pools and VMs
• Recommend migrations
(prioritized list)

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-42
DRS cluster settings—automation level
Configure the automation level for initial placement of
VMs and dynamic balancing while VMs are running

Automation Initial VM Dynamic


level placement balancing

Manual Manual Manual

Partially-
Automatic Manual
automated
Fully-
Automatic Automatic
automated

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-43
DRS cluster settings—migration threshold
The migration threshold levels determine how quickly virtual
machines are migrated

Level Applies all


1 – Most conservative recommendations
With five stars only
2 – Moderately With four or more stars
conservative
3 – Midpoint (default) With three or more stars
4 – Moderately aggressive With two or more stars
5 – Aggressive With one or more stars

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-44
DRS cluster settings – placement constraints

• Affinity rules
• Run virtual machines on
same host
• Use for multi-VM systems
where performance benefits
• Anti-affinity rules
• Run virtual machines on
different hosts
• Use for multi-VM systems
that load balance or require
high availability

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-45
DRS cluster settings – automation level per VM

• Optionally set automation level per VM

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-46
Best practices for DRS

• Because adding a host to a DRS cluster requires


maintenance mode, plan to use VMotion to evacuate
the host
• When DRS makes strong recommendations (typically 4-
or 5-star), follow them
• Otherwise, balance and fairness may deteriorate
• Some VMotion is necessary
• Enable automation
• Choose default based on environment, comfort level
• Let DRS autonomously manage most VMs
• Use per-VM automation level overrides to accommodate sensitive
VMs

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-47
Lab for lesson 3

• Create a DRS Cluster Two ESX Server


• In this lab, you will perform the teams belong to one
following tasks:
Cluster team
• Create a DRS cluster
• Add ESX Servers to the DRS VirtualCenter VirtualCenter
cluster Server Server
#3 #4

ESX Server ESX Server


#3 #4

Student 03a Student 03b Student 04a Student 04b

Cluster Team

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-48
Lesson summary

• DRS applies intelligence to the location of VMs


• Upon initial power-on
• Dynamically (using VMotion)
• Accepting DRS’s recommendations leads to balanced
resource utilization

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-49
Lesson 4:
Resource Pools
in a
DRS Cluster

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-50
Lesson topics

• The role of resource pools in DRS clusters


• Using sub-pools for delegated administration
• Monitoring the state of resource use in a pool
• Building a cluster

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-51
Resource pools in a DRS cluster
Resource pools are used to subdivide
the computing resources in a cluster
Root Resource Pool
5 x (4.8 GHz, 4 GB)
(CPU = 24 GHz, Memory = 20 GB)
Cluster

Resource Pool 1 Resource Pool 2


(CPU = 16 GHz, Memory = 12 GB) (CPU = 3 GHz, Memory = 3 GB)

CPU Shares: 2000 CPU Shares: 4000


Reservation: 4 GHz Reservation: 0
Limit: 16 GHz Limit: 3 GHz

VM VM
VM VM VM
CPU Shares: 1000 CPU Shares: 3000
Reservation: 0 Reservation: 1 GHz
Limit: 16 GHz Limit: 2 GHz

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-52
Delegated administration

• Joe administers cluster Cluster


• Carves up cluster resources (Root Resource Pool)
into pools, provides bulk
allocations to pool admins
Joe
• Has “Datacenter Administrator”
VC role
• Jane administers
Resource Pool 1 Resource Pool 1 Resource Pool 2
(CPU = 16 GHz (CPU = 3 GHz
• Carves up pool resources Mem = 12 GB) Mem = 3 GB)
into smaller pools for users
Jane
• Has “Resource Pool
Administrator” VC role Resource Resource VM VM VM
Pool 3 Pool 4
• Ted administers VMs (CPU = 6 GHz (CPU = 4 GHz
in Resource Pool 3 Mem = 8 GB) Mem = 4 GB)

• Allocates resources to VMs


• Has “Virtual Machine Power VM VM VM VM
User role” Ted

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-53
When to use expandable reservations

Cluster
(Root Resource Pool)

Resource Pool 1 Resource Pool 2


Expandable Reservation = Yes Expandable Reservation = Yes
Pools for use within our team

Pools created by us VM VM VM
Resource Resource
for use by our customers Pool 3 Pool 4
ER = No ER = No

VM VM VM VM

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-54
Monitor cluster usage

• VirtualCenter reports the state of a cluster:


• Valid (no color): All resource constraints satisfied
• Yellow: Some resource constraints are not satisfied
• Usually because hosts in the cluster went down
• Remedy: Can’t increase resource reservations until more resources are
added or reservations are decreased
• Red: The cluster is internally inconsistent
• An administrator bypassed VirtualCenter and made resource-pool
changes directly on a host

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-55
Adding host to DRS cluster

• When adding a new host or moving an existing host into


the DRS cluster, you have the option of keeping the
resource pool hierarchy of the existing host, if one exists
• For example, add kentfield04.priv.vmeduc.com to Lab
Cluster

When adding
the host, choose
to create a new
resource pool
for this host’s
virtual
machines and
resource pools.

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-56
Removing host from DRS cluster

• When removing a host from a DRS Cluster, you must first place
the host in maintenance mode
• Maintenance mode protects virtual machines from changes in
ESX Server state
Normal mode
You can power on VMs as needed, and
VMs can be migrated to this host

Any running VMs continue to run, but no new VMs can


be powered on; no VMs will be migrated to this host
Maintenance mode
All VMs have been manually powered off, and no new
VMs can be powered on; no VMs will be migrated to
this host

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-57
Lab for lesson 4

• Resource Pools in a DRS


Cluster Two ESX Server
• In this lab, you will perform the teams belong to one
following tasks: Cluster team
• Create two resource pools in a
DRS cluster VirtualCenter VirtualCenter
Server Server
• Cause DRS to make resource #3 #4
balancing recommendations

ESX Server ESX Server


#3 #4

Student 03a Student 03b Student 04a Student 04b

Cluster Team

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-58
Lesson summary

• Use DRS clusters to delegate the right to allocate


resources
• When DRS clusters are in use, do not manually make
changes to individual hosts’ resource pools

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-59
Module summary

• A resource pool has three attributes – reservation, limit


and shares
• Resource pools can be created on standalone hosts or in
DRS clusters
• VMotion is the underlying technology of VMware DRS
• A DRS cluster provides initial placement of VMs at power
on and dynamic load balancing of running VMs

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-60
Questions?

VMware Infrastructure 3: Install and Configure – Rev B


Copyright © 2006 VMware, Inc. All rights reserved. 8-61

S-ar putea să vă placă și