Microsoft Official
Course
Module 3
Creating and Managing Virtual
Hard Disks, Virtual Machines,
and Checkpoints
Module Overview
Creating and Configuring Virtual Hard Disks
Creating and Configuring Virtual Machines
Installing and Importing Virtual Machines
Managing Virtual Machine Checkpoints
Monitoring Hyper-V
Designing Virtual Machines for Server Roles
and Services
Lesson 1: Creating and Configuring
Virtual Hard Disks
What Are the Storage Options for Virtual
Machines?
Overview of the Hyper-V Virtual Hard Disk
Formats
Fixed-Size and Dynamically Expanding Virtual
Hard Disks
Differencing Virtual Hard Disks
Demonstration: Creating a Virtual Hard Disk
Directly Attached Disks
Virtual Hard Disk Sharing
What Are the Storage Options for Virtual
Machines?
Virtual hard disk and directly attached disks
Support two storage controller types:
IDE
SCSI
Only for Generation 1 virtual
machines
For Generation 1 and
Generation 2 virtual machines
Two controllerstwo devices
per IDE controller
Four controllers64 devices per
SCSI controller
Virtual machine starts from IDE
Only Generation 2 starts from
SCSI
Cannot modify devices while
virtual machine is running
Can modify devices when
virtual machine is running
Fixed size, dynamically expanding, or differencing
disk files
Directly attached diskslocal, or on iSCSI or Fibre
Overview of the Hyper-V Virtual Hard Disk
Formats
.vhd
Up to 2,040 GB in size
.vhdx
Up to 64 TB in size
Internal log for enhanced resiliency
User-defined metadata
Large disk sector support
Larger sector size (improved performance)
Default format in Windows Server 2012 R2
Can convert between both formats
.vhdx recommended if not used in older versions
of Hyper-V
Fixed-Size and Dynamically Expanding
Virtual Hard Disks
Fixed-size
Dynamically expanding
Allocates all storage
Larger initial size
Creation takes time
without Windows
Offloaded Data
Transfers
Allocates space as needed
Smaller initial size
Created faster
Minimize fragmentation
Can cause fragmentation
Cannot overcommit
Can overcommit
Better performance (older Comparable performance
Hyper-V)
(Windows Server 2012)
Use in production
Use in testing and
development
Differencing Virtual Hard Disks
Stores changes from the parent disk
The parent disk should not be changed
The differencing disk isolates changes
Multiple differencing disks can use the same parent
Increases overhead (lower performance)
Can use for standardized base images
Should avoid in production environments
Read
Modify Create
Delete
1234
xxxx
3
1 234
1 23 4
File A
File B
File
C
1 2 34
File D
Gro
w
ReadOnly
Demonstration: Creating a Virtual Hard
Disk
In this demonstration, you will see how to
create a virtual hard disk
Directly Attached Disks
Virtual machine directly accesses physical
disk
Internal or LUN attached to Hyper-V server
Disk must be offline before it can be used
LUN on iSCSI or Fibre Channel SAN
Directly attached disk considerations
Best performance
Unlimited size, lowest CPU utilization
No checkpoints or differencing virtual hard disks
No portability and encapsulation
Not included in Hyper-V backup
Virtual Hard Disk Sharing
Provides shared storage for virtual machines
Used as shared Serial Attached SCSI disk by
virtual machines
Virtual hard disk must be using .vhdx format
Must be connected to a virtual SCSI controller
Must be stored on a failover cluster
CSV
Scale-out file server with SMB 3.0
Separation between infrastructure and virtual
machines
Quality of Service Management
Storage QoS restricts disk throughput
Configured per virtual hard disk
Dynamically configurable while a virtual machine is
running
Hyper-V Considerations for Virtual Hard Disk
Storage
Virtual hard disks consume large amounts
of space
Can increase over time; implement monitoring
Use multiple physical disks for better
throughput
Use redundant storage spaces
SSD dramatically increases performance
SMB 3.0 file share
Use SAN for storing virtual hard disks
Specialized, redundant, fast
Shared storage for failover clustering
Exclude virtual hard disks from antivirus
Demonstration: Managing Virtual Hard
Disks
In this demonstration, you will see how to
manage virtual hard disks
Lesson 2: Creating and Configuring Virtual
Machines
What Are the Components of a Generation 1
Virtual Machine?
Overview of Generation 2 Virtual Machines
Demonstration: Creating Virtual Machines
Configuring Virtual Machine Settings
What Is Dynamic Memory?
What Is Smart Paging?
Overview of Integration Services
Demonstration: Configuring Integration
Services
What Are the Components of a Generation
1 Virtual Machine?
Virtual machine has virtual hardware devices
Only devices that Hyper-V supports can be
used
Virtual hardware can be:
Emulated available during boot
Synthetic available in supported operating
systems
SR-IOV available in supported operating systems
Prior to Windows Server 2012 R2, only
Generation 1 virtual machines were available
What Are the Components of a Generation
1 Virtual Machine?
Overview of Generation 2 Virtual Machines
Emulated devices are removed
UEFI firmware instead of BIOS
Secure Boot
Boots from SCSI controller
PXE boot uses a standard network adapter
Faster boot and operating system
installation
Can run side by side with Generation 1
Generation 1 must be used for legacy systems
Supported guest operating systems
Windows Server 2012 and Windows Server 2012
R2
64-bit versions of Windows 8 and Windows 8.1
Overview of Generation 2 Virtual Machines
Demonstration: Creating Virtual Machines
In this demonstration, you will see how to
create a virtual machine
Configuring Virtual Machine Settings
Only limited options are available during creation
Many more options are available after the virtual machine
is created
Configuration options depend on the generation of the
virtual machine
Most settings can be configured only if turned off
Adding or removing hardware components
Configuring memory, processor, disk settings
A few settings are configurable while a virtual machine is
running
Connecting a network adapter to a virtual switch
Adding a virtual hard disk to a SCSI controller
Enabling or disabling Integration Services
Use Hyper-V Manager or Windows PowerShell
Set-VM, Add-VMHardDiskDrive, Add-VMNetworkAdapter
Configuring Virtual Machine Settings
What Is Dynamic Memory?
More efficient use of available physical memory
Shared resource that can be reallocated automatically
Demand, available memory, and virtual machine memory
settings
Dynamic memory settings
Startup RAM
Minimum RAM
Can be increased while a virtual machine is running
Memory buffer
Can be decreased while a virtual machine is running
Maximum RAM
Operating system typically requires more memory when
started
Percentage of extra memory to reserve for a virtual machine
Memory weight
What Is Dynamic Memory?
Finance virtual machine
8 GB
Sales virtual machine
Engineering virtual machine
6 GB
4 GB
2 GB
T=0
T = 15
T = 30
Total system memory
Memory in use by virtual machines
Physical memory used
8 GB
3 GB
37.5 %
Virtual Machines
Memory Settings
What Is Dynamic Memory?
Finance virtual machine
Sales virtual machine
Engineering virtual machine
8 GB
6 GB
4 GB
2 GB
T=0
T = 15
T = 30
Total system memory
Memory in use by virtual machines
Physical memory used
8 GB
6 GB
75 %
Virtual Machines
Memory Settings
What Is Dynamic Memory?
Finance virtual machine
8 GB
Sales virtual machine
Engineering virtual machine
Service virtual machine
6 GB
Engineering reaches
max allocation
4 GB
2 GB
T=0
T = 15
T = 30
Total system memory
Memory in use by virtual machines
Physical memory used
8 GB
7.5 GB
94 %
Virtual Machines
Memory Settings
What Is Smart Paging?
A memory management technique that
uses physical disk resources as temporary
memory
Ensures that a virtual machine can always restart
Used during virtual machine restart only if:
Temporarily degrades virtual machine
performance
Hyper-V is low on memory, the virtual machine has more
startup than minimum RAM, and memory cannot be
reclaimed from other virtual machines
Used only for a limited time, and then removed
Not used when a virtual machine is started from
the Off state
Virtual machine operating system paging is always
preferred
What Is Smart Paging?
Finance virtual machine
Sales virtual machine
Engineering virtual machine
Service virtual machine
8 GB
Virtual Machines
Memory Settings
6 GB
4 GB
2 GB
T=0
T = 15
Total System Memory
T = 30
8 GB
Sales virtual machine and Service virtual
machine can be restarted only if Smart
Paging is used
Overview of Integration Services
Makes a guest operating system aware that it is
running on a virtual machine
Many operating systems include integration
services
Install the latest integration services
VMBus and synthetic devices support
Time synchronization, mouse release, VSS
Managed as virtual machine settings
Overview of Integration Services
Without Integration Services
With Integration Services
Demonstration: Configuring Integration
Services
In this demonstration, you will see how to
configure integration services
Using a Virtual Fibre Channel Adapter
Access to Fibre Channel SAN storage from virtual
machine
Hyper-V server has Fibre Channel HBA
Use Virtual SAN Manager to configure a virtual SAN
Virtual Fibre Channel adapter maps to the physical HBAs
Virtual Fibre Channel adapter connects to the virtual SAN
Storage hardware must support N_Port ID
Virtualization
Virtual machine can have four virtual Fibre Channel
Supported
Not supported
adapters
Virtual machine live
migration
Virtual machine failover
cluster
MPIO - multiple paths to
Boot from Fibre Channel
SAN
Checkpoints
Host-based backup
Lab A: Creating and Managing Virtual Hard
Disks and Virtual Machines
Exercise 1: Creating and Managing Virtual
Hard Disks
Exercise 2: Creating and Managing Virtual
Machines
Logon Information
Virtual machines:
20409B-LON-HOSTx
20409B-LON-CLx
20409B-LON-DC1
20409B-LON-SS1
User name:
Adatum\Administrator
Password:
Pa$$w0rd
Estimated Time: 70 minutes
Lab Scenario
A. Datum Corporation is continuing with its
pilot virtualization project. You have
deployed
the virtualization hosts by installing Hyper-V
on Windows Server 2012 R2 in one of the
subsidiaries. The next step is to deploy
virtual machines on these hosts.
Because the virtualization platform is new
to A. Datum, you need to spend some time
familiarizing yourself with the Hyper-V
features and components. To do this, you
decide to deploy and evaluate different
Lab Review
Can you attach a disk directly to a virtual
machine only if that disk is attached locally
to a Hyper-V host?
How can you use a virtual hard disk with the
installed operating system as a template for
new virtual machines?
How can you prevent a virtual machine from
monopolizing disk I/O when a disk-intensive
application is running on a virtual machine?
What are the requirements for virtual
machines to use dynamic memory? Is this
feature available only to virtual machines
Lesson 3: Installing and Importing Virtual
Machines
Virtual Machine Installation Methods
Importing Virtual Machines
Demonstration: Importing a Virtual Machine
Virtualizing a Physical Computer
The Virtual Machine Connection Application
Overview of Enhanced Session Mode
Demonstration: Using Enhanced Session
Mode
Virtual Machine Installation Methods
Install from a bootable CD/DVD
Single virtual machine can only use physical media at one
time
Install from an .iso file
Multiple virtual machines can use a .iso file
Install from a network-based installation server
Generation 1 legacy network adapter required
Copy a virtual hard disk file with an installed
operating system
Similar to computer cloning
Virtual hard disk should first be generalized
Use differencing virtual hard disks
Parent virtual hard disk should first be generalized
Importing Virtual Machines
You can import a virtual machine without first
exporting it
Only virtual machine data files are needed
More than 40 different types of issues detected, such
as:
Missing parent virtual hard disk
Virtual switch not available
Virtual machine has more processors than available
Import process:
Creates a copy of the virtual machine configuration file
Validates hardware configuration settings
Compiles a list of incompatibilities
Displays incompatibilities and asks for new settings
Removes the configuration file copy
Demonstration: Importing a Virtual
Machine
In this demonstration, you will see how to
import a virtual machine
Virtualizing a Physical Computer
Hyper-V does not include P2V conversion
functionality
Hyper-V can copy the content of data disks
Configure a disk in New Virtual Hard Disk Wizard
Copy an entire disk, not a volume or partition
Supported only for data; system disks are not
supported
Disk2vhd
Creates virtual hard disks
Uses VSS
Captured system has the same identity
Add a virtual hard disk to a virtual machine
Virtualizing a Physical Computer
The Virtual Machine Connection
Application
Connects to virtual machines on local and
remote Hyper-V
Port 2179 used (can be modified in the registry)
Connection allowed by Windows Firewall
Installed as part of Hyper-V role or RSAT feature
Single users can connect to virtual machines
Remote Desktop in virtual machines is not used
Hyper-V Administrators can connect to
virtual machines
You can restrict access to virtual machines
Revoke-VMConnectAccess cmdlet
Overview of Enhanced Session Mode
Remote Desktop connection to a virtual
machine
Virtual machine can be without network
connectivity
Devices can be redirected
Printers, drives, smart cards, audio, other PnP devices
Shared Clipboard, enhanced copy
Folder Redirection
RDS component is used
User must sign in to virtual machine
Remote Desktop Users group membership required
Enabled at Hyper-V virtual machine
connection and virtual machine level
Guest operating system support required
Demonstration: Using Enhanced Session
Mode
In this demonstration, you will see how to
use enhanced session mode
Lesson 4: Managing Virtual Machine
Checkpoints
What Are Virtual Machine Checkpoints?
Implementing Hyper-V Checkpoints
Overview of Checkpoints at File Level
Exporting Virtual Machines and Checkpoints
Demonstration: Working with Checkpoints
Issues with Checkpoints in Distributed
Environments
Checkpoints and Virtual Machine Generation
ID
What Are Virtual Machine Checkpoints?
A checkpoint is a point-in-time virtual machine
state
Can be taken if a virtual machine is not in paused state
Contains virtual machine configuration, memory, and disk
state
Does not affect the running state of a virtual machine
Primarily used for testing and development
Can cause issues in distributed production environments
Create differencing disk decrease performance
Cannot be created for directly attached disks
Used by Hyper-V Replica or in VDI deployments
Implementing Hyper-V Checkpoints
When created, a checkpoint cannot be
modified, only viewed, applied, exported,
renamed, or deleted
Checkpoint creation steps:
1.
2.
3.
4.
5.
Pause virtual machine
Create differencing disk for each disk that virtual
machine is using
Create a copy of virtual machine configuration
Resume virtual machine
Copy virtual machine memory to disk
Checkpoint consists of
Configuration file (*.xml)
Saved state file (*.vsv)
Memory content (*.bin)
Overview of Checkpoints at File Level
Checkpoint
.vhd
.avhd
Apply (= create branch)
Apply (= delete Now)
Delete (= merge)
Delete (= delete)
Exporting Virtual Machines and
Checkpoints
Exporting a virtual machine is not required
You can copy virtual machine files
Exporting a virtual machine consolidate its files
If differencing drives are used, the entire hierarchy is
exported
Exporting multiple virtual machines increases total size
When exporting a virtual machine, all its checkpoints are
exported
Exporting a checkpoint exports only a single state
Differencing disks in a checkpoint hierarchy are merged
Live export you can export while a virtual
machine is running
Update integration services after import
Discard memory content and saved state from different
Demonstration: Working with Checkpoints
In this demonstration, you will see how to
work with checkpoints
Issues with Checkpoints in Distributed
Environments
Applying a checkpoint takes a virtual machine back
to a previous state
Can have serious implications and result in
corruption
Vector-clock synchronizations are impacted
Distributed applications depending on increasing logical clock
AD DS, DFS Replication, SQL Server replication
Applying checkpoint rolls back the logical clock
Members of replica set to not converge to the same state
Cryptography - reducing entropy of the random data
Distributed applications using vector clock algorithms
have no awareness of running in a virtual
environment
Removes changes in virtual machine as if they never
happened
Issues with Checkpoints in Distributed
Environments
DC2
DC1
T1
Create
Checkpoint
USN: 100
ID: A
RID Pool: 500 - 1000
+100
users
Only
50
Time
T2
T3
users are replicated to both domain
controllers. Others are either on first or second
USN: 200
domain controller. 100 users (RID 500-599)
ID: A
Replication to DC2: USN >100
RID Pool: 600 - 1000
have duplicated SIDs.
Apply T1
Checkpoint
DC1(A)
@USN =
200
USN: 100
ID: A
RID Pool: 500 - 1000
+150 users
USN: 250
T4
ID: A
RID Pool: 650 - 1000
Replication to DC2: USNs >200
DC1(A)
@USN =
250
Checkpoints and Virtual Machine
Generation ID
Designed to address issues of reverting to a past state
64-bit integer tied to a virtual machine configuration
Generation ID passed to a virtual machine in the BIOS
Application can compare current and previous values
If values differ, then something happened to virtual machine
Hypervisor must support virtual machine Generation ID
Operating system in virtual machine must be
Generation ID-aware
Virtual machine generation ID
change
Does not change
Virtual machine starts from
checkpoint
Virtual machine is livemigrated
Virtual machine restored from
backup
Virtual machine is paused or
resumed
Virtual machine is migrated
Virtual machine is restarted
Checkpoints and Virtual Machine
Generation ID
Checkpoints and Virtual Machine
Generation ID
Checkpoints and Virtual Machine
Generation ID
Lesson 5: Monitoring Hyper-V
Overview of Performance Monitoring
Monitoring a Hyper-V Host
Monitoring Virtual Machines
Demonstration: Using Performance Monitor
to Monitor Hyper-V
Resource Metering in Hyper-V
Overview of Performance Monitoring
Monitors operating systems and
applications that use system resources
Provides up-to-date information on
performance
Health of the IT infrastructure
Planning for future requirements
Compare current activity with the baseline
Whether current performance is sufficient
Identifying issues
Detecting problems
Proactive (real-time) and reactive (historical data)
Windows Server 2012 R2 includes several
tools
Overview of Performance Monitoring
Task Manager provides local, real-time performance
data
Helps identify and resolve performance-related
issues
Overview of Performance Monitoring
Resource Monitor provides in-depth, real-time
performance data
CPU, Memory, Disk, Network
Overview of Performance Monitoring
Event Viewer shows events that relate to server
activity
Collected locally and remotely
Filtering, custom views, attaching tasks to the
events
Overview of Performance Monitoring
Reliability Monitor provides an historical view of
server reliability and associated events
Overview of Performance Monitoring
Performance Monitor provides real-time monitoring
and viewing of historical data gathered by data
collector sets
Additional performance objects added with server
roles
Monitoring a Hyper-V Host
Only Performance Monitor can monitor
Hyper-V
Many Hyper-V performance objects added
Other tools monitor only their virtual environment
Parent partition is also considered a virtual machine
Memory, disk, and network monitored the
same
\Logical Disk(*)\Avg. Disk sec/Read and /Write
\Memory\Available Mbytes
\Network Interface(*)\Bytes Total/sec
Processor utilization based on available
resources
Hyper-V allocates resources to each virtual
Monitoring a Hyper-V Host
Worker
Process
Worker
Process
Virtual
machine
Parent
Partition
Hypervisor
Hyper-V server
Virtual
machine
Monitoring Virtual Machines
Virtual machine tools monitor the virtual
environment
Heavy utilization in a virtual machine does not mean
that a Hyper-V host is heavy utilized, and vice-versa
Available resources are adjusted based on server load
Memory and disk counters are the same as on the
server
Hyper-V performance counters should be used
Hyper-V Hypervisor\Virtual Processors
Hyper-V Hypervisor Logical Processor\% Guest Run
Time
Hyper-V Virtual Network Adapter(*)\Bytes/sec
Limit the processor resources that the virtual
machine can use
Demonstration: Using Performance
Monitor to Monitor Hyper-V
In this demonstration, you will see how to
use Performance Monitor to monitor Hyper-V
Resource Metering in Hyper-V
Track resources used by a virtual machine
or pool
Processor, disk, memory, network
Can be used for chargeback
Resource metering data follows a virtual
machine
Configure by using Windows PowerShell
Enable-VMResourceMetering, Measure-VM
Average CPU usage
Average physical memory usage
Minimum/maximum memory usage
Maximum amount of disk space allocated to a virtual
machine
Total incoming/outgoing network traffic for a network
Lesson 6: Designing Virtual Machines for
Server Roles and Services
Planning Hyper-V Host Management
Planning Virtual Machine Management
Designing Virtual Machines for a Domain
Controller
Designing Virtual Machines for SQL Server
Designing Virtual Machines for Exchange
Server
Planning Hyper-V Host Management
Standardize server platforms
Use the same operating system and Hyper-V host
configuration
Use Windows Server 2012 or newer
Deploy a Server Core installation for Hyper-V hosts
Install only the Hyper-V role
Test and apply updates to the Hyper-V host
Implement shared storage and high availability
Implement Cluster-Aware Updating
Automate and standardize administration
Join Hyper-V host to the domain to simplify administration
Implement remote management
Use Windows PowerShell
Consider implementing VMM
Planning Virtual Machine Management
Standardize the virtual machine
configuration
Use virtual disk templates
Copy generalized virtual hard disks
Use Windows PowerShell to create virtual
machines
Plan virtual machines for specific server
roles by:
Considering performance baseline of the physical
server
Configuring similar hardware as for a physical
server
Implementing best practices for each server role
Designing Virtual Machines for a Domain
Controller
Avoid single points of failure
Multiple domain controllers, running on different Hyper-V
hosts
Hyper-V hosts should be as secure as domain
controllers
If Hyper-V host is domain member, domain admin has full
access
Avoid differencing disks
Including checkpoints
Windows Server 2012 detects when a checkpoint is applied
Disable time synchronization with Hyper-V host
Domain controller has its own algorithm for time
synchronization
Use other integration services
Designing Virtual Machines for SQL Server
Plan for enough resources
Memory and processors are most important
Do not overcommit processors
Minimize background activities and services
Use SQL Server optimization
Use large page allocations to reduce memory
overhead
Consider dynamic memory to reduce I/O
overhead
Use the following formula for SQL Server memory
Memory (1%Memory * (NUMA_nodes)) 3%Memory
1GB
Consider setting SQL Server processor affinity
mask
Designing Virtual Machines for Exchange
Server
All Exchange Server 2013 roles can be virtualized
Do not overcommit processors
Physical-to-logical processor ratio not greater than
2:1
Ratio of 1:1 is recommended
Exchange Server 2013 is not NUMA-aware
Provide enough storage
Fixed-size disk, SCSI directly attached or iSCSI
Differencing and dynamically expanding disks not supported
Fixed-size disks can be stored on SMB 3.0 shares
Dynamic memory is not supported
Exchange Server virtual machine checkpoints are
not supported
Lab B: Creating and Managing Checkpoints
and Monitoring Hyper-V
Exercise 1: Importing Virtual Machines and
Working with Checkpoints
Exercise 2: Monitoring Hyper-V
Logon Information
Virtual machines:
20409B-LON-HOSTx
20409B-LON-CLx
20409B-LON-DC1
User name:
Adatum\Administrator
Password:
Pa$$w0rd
Estimated Time: 60 minutes
Lab Scenario
A. Datum is continuing with its pilot virtualization
project. You have deployed the virtualization hosts
by installing Windows Server 2012 R2 Hyper-V in one
of the subsidiaries. The next step is to deploy virtual
machines on these hosts.
Because the virtualization platform is new to A.
Datum,
you need to spend some time becoming familiar with
Hyper-V features and components, including
checkpoints.
As the pilot project continues, you will need to be
able
to monitor server performance to ensure that virtual
machines are configured properly. For now, you will
familiarize yourself with the monitoring tools that are
Lab Review
Can you use enhanced session mode to
connect to all virtual machines?
Can you export a checkpoint while a virtual
machine is running?
Can you use checkpoints in a production
environment?
Which Windows Server 2012 R2 tool should
you use for monitoring Hyper-V hosts and
virtual machines?
How can you enable resource metering for
virtual machines in Hyper-V Manager?
Module Review and Takeaways
Review Questions