Beyond the cloud: Hyper-V and Dynamic Memory “under the hood”

38
PRC301 Beyond the cloud: Hyper-V and Dynamic Memory “under the hood” Bryon Surace Senior Program Manager Windows Server, Hyper-V Microsoft

description

PRC301. Beyond the cloud: Hyper-V and Dynamic Memory “under the hood”. Bryon Surace Senior Program Manager Windows Server, Hyper-V Microsoft. Agenda. History  Hyper-V R2 SP1 Memory & Virtualization Memory Optimization Techniques Hyper-V Dynamic Memory Architecture & Concepts Demo - PowerPoint PPT Presentation

Transcript of Beyond the cloud: Hyper-V and Dynamic Memory “under the hood”

Page 1: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

PRC301

Beyond the cloud:Hyper-V and Dynamic Memory “under the hood”

Bryon SuraceSenior Program ManagerWindows Server, Hyper-VMicrosoft

Page 2: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Agenda

History Hyper-V R2 SP1Memory & Virtualization Memory Optimization TechniquesHyper-V Dynamic Memory

Architecture & ConceptsDemoSystem Impact

Q&A

Page 3: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Microsoft Virtualization - Continuing to Evolve!

2011SP1

Page 4: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

HYPER-V R2 SP1:REMOTE FX

Page 5: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

RemoteFX ClientsTraditional PC

Requires a local IT Pro.

Consumes ~170W.

Cannot meet certain regulatory reqs.

Vulnerable to hardware failures.

Limited to PC form factors.

Windows Server & RemoteFX

Windows Server & RemoteFX

Manageable from anywhere.

Power footprint is shared (~50W/user).

Helps meet regulatory reqs.

Recoverable from hardware failures.

Enables full range of client form factors.

Aero Glass

Adobe Flash

Microsoft Silverlight

DirectX Apps

Windows Media

Traditional Productivity AppsTraditional PC

Powerful

Flexible

Diverse

Versatile

Portable

MICROSOFTREMOTEFX

Page 6: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Deployment ConsiderationsSimple integration with inbox tools

Server ManagerHyper-V Manager – shows up as a 3D video adapterWMI, Power shell support

Performance and ScaleWill have performance whitepaper, planning and deployment guides before SP1 RTM

MigrationRemoteFX for VDI is targeted at new deployments

New HW requirements require new server deploymentsCan have a mix of RemoteFX enabled and non-RemoteFX VMs on the same serverSupports Live Migration across servers – requires identical GPUs

Page 7: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

HYPER-V R2 SP1:VIRTUALIZATION & MEMORY

Page 8: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Virtualization & MemoryHow much memory does a server actually need?

IIS Server?Print server?File server?Branch Cache?Direct Access?

How much will performance be affected if you halved the amount of memory in a VM?

Page 9: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

No one wants to size VMs Memory“New virtual machines get 1GB of RAM [no matter what the VM is running]. I only give people more memory if they complain about performance”

“All VMs get 4GB of RAM [I have no idea what is happening with that memory] and no one complains”

“I take the minimum system requirements and add (insert one: 50%, 100%, 150%)”

“A vendor tells me their app needs 4GB of RAM. I do not have the time to test this to find out if it is true or not”

Page 10: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Virtualization & MemoryMemory

Key Factor to the number of running VMsThe most utilized asset in the system, but also a more expensive asset

Statistics on resource utilization of workloads CPU 10%Memory 40%Network I/O <5%Disk I/O <5%

Customer RequirementsMaximum density, without sacrificing performanceMaintain consistent performanceDon’t provide a feature that’s unsuitable for production use

Page 11: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Dynamic Memory GoalsHigher VM consolidation ratios with minimal performance impact

Dependent on:How much variation in memory utilization the workloads haveHow good a job you did of sizing the systems in the first place

Work well for both server and desktop workloadsAdd minimal overhead to the system

Page 12: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Understanding philosophical differencesHost and Guest Collaborate

Understands what guest information to useTrying to get the “best bang for buck” in virtual memory management

Host works in IsolationDoes not trust guest information

Building a “black box” solution

Page 13: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Dynamic Memory, not OvercommitOverloaded Term

Over-subscription vs. Over-committment

No one wants to overcommit their resourceYou don’t overcommit other resources (really – you do not)VMware does not want you to overcommit memory (really)

Dynamic Memory treat memory like we treat CPU resources

Dynamically schedulable resource

Page 14: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

MEMORY MANAGEMENT & OPTIMIZATION TECHNIQUES

Page 15: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

BallooningHow it works:

Increasing the size of the balloon forces the guest to react to memory pressure by releasing unused pagesDecreasing the size makes more memory available to the guest

VMMemory

Host Computer

BalloonDisk

VM

Host Computer

MemoryBalloon

DiskInflate

Swap Out

Ballloon

Deflate

VM

Host Computer

Memory

Disk

Swap In

Balloon

Deflate

Page 16: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Second Level PagingHow it works:

Paging at the virtualization layer by swapping VMs memory out to disk

Many problems:Swapping Guest Kernel ResourcesDouble PagingDisks are slow

But it always works…

Page 17: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

External Page SharingHow it works:

Eliminate redundant copies of memory pages common to more than one virtual machine1. Hash all memory and store it in a table…2. Identify the common hashes and then…3. Perform a bit by bit comparison

ProblemsPage Sharing not dynamicCan take hours to share pagesThe largest benefit are zero pagesDoesn’t work with large pages

Page 18: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

HYPER-V R2 SP1DYNAMIC MEMORY ARCHITECTURE & CONCEPTS

Page 19: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

System Requirements

Parent Requirements:Windows Server 2008 R2 SP1Microsoft Hyper-V Server 2008 R2 SP1

Guest Requirements:Windows Server 2003, 2008 & 2008 R2

32-bit & 64-bit versionsWindows Vista and Windows 7

Enterprise and Ultimate Editions only32-bit & 64-bit versions

Page 20: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Adding/Removing Memory

Adding MemoryEnlightened fashion

Synthetic Memory Driver (VSP/VSC Pair)No hardware emulationLight weight

Removing MemoryBallooning is more efficient

Messes up task manager in the guest OS

Page 21: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Adding/Removing Memory

Active Memory additionMemory is added immediately when VM needs it

Passive Memory reclamationMemory is not removed when there is no immediate needUnutilized memory is collected every 5 minutes

Page 22: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Startup & Max

Startup: amount of memory to boot VMBIOS does not know about DMGuest OS may not know about DMDefault: 512MB

Max: don’t let the VM above this amountDefault: 64GB

Page 23: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Memory Buffer & Priority

Buffer: How much “free” memory should we try and keep in the VM?

Allows for responsiveness to bursty workloadsCan be used for file cache

“I like to configure my virtual machines so that they have ~20% free memory”Priority: which VM gets the memory first

1-10,000: default is 5,000The higher the priority, the higher the availability

Page 24: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Demo

Dynamic Memory in action

Page 25: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

SYSTEM IMPACT

Page 26: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

VM Reserve

Changes to Root ReserveHyper-V has always had the concept of a reserve of memory that is kept for the parent partition

Host Reserve - Auto-calculated based on:If the machine SLAT capabilityTotal size of host RAMNUMA architecture

Host Reserve VM Overhead Memory utilized by VMs

Page 27: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Changes to Root Reserve

DM allows VMs to push up against the reserve consistentlyNew behavior to better protect the parent partition from rampaging virtual machines

New registry key in placeAllows you to reserve static memory for the parent partition

May result in less memory being available for VMs

Page 28: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Changes to NUMA management…Wait – what is NUMA?Why do I care?How does this work today?

Page 29: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

What is “NUMA”?A traditional computer:

Computer

CPU CPU CPU CPU

BUS

Memory

VM VM VM VM

VM VM VM VM

Page 30: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

What is “NUMA”?A NUMA computer:

Computer

CPU CPU CPU CPU

BUS

Memory

VM VM VM VM

VM VM VM VM

Back Channel

Memory

BUS

Node 1 Node 2

Page 31: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Why do I care?VM memory should come from the “local NUMA node”

Computer

CPU CPU CPU CPU

BUS

Memory

VM VM VM VM

VM VM VM VM

Back Channel

Memory

BUS

Node 1 Node 2

Good!

Page 32: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Why do I care?Ideally VM memory should come from the “local NUMA node”

Computer

CPU CPU CPU CPU

BUS

Memory

VM VM VM VM

VM VM VM VM

Back Channel

Memory

BUS

Node 1 Node 2

Bad

Page 33: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

How does this work today?Hyper-V tries to get all memory for a virtual machine from a single NUMA nodeWhen it cannot – the virtual machine “spans” NUMA nodesUsers can set preferred NUMA nodes for virtual machines in order to get the best distribution

Page 34: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Changes to NUMA managementDynamic memory can result in more virtual machines spanning NUMA nodes

A virtual machine might start all on one node – but added memory might come from another node

New option to disable NUMA node spanning

Page 35: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Disabling NUMA SpanningMakes the system behave like multiple small computers

Computer

CPU CPU CPU CPU

BUS

Memory

VM VM VM VM

VM VM VM VM

Back Channel

Memory

BUS

Node 1 Node 2

Page 36: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

What next?

Try Dynamic Memory out – for both server and desktop environments!

Windows Server 2008 R2 SP1 (Trial)Hyper-V Server 2008 R2 SP1 (Free)

Page 37: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Feedback

Dear attendees!Your feedback is appreciated!In notepad that can be found in attendee’s infopack, you will find a feedback formPlease, rate the session and pass the feedback form to the moderator on exitTo take part in a lottery, please do not forget to mark the feedback form with the number of your badgeThank you!

Page 38: Beyond the cloud: Hyper-V  and Dynamic Memory  “under the hood”

Questions?

PRC301Bryon Surace

Sr. Program Manager, Windows Server [email protected]

You can ask your questions at Microsoft zone in Hall 17 within an hour after end of this session