Table Of ContentPro
Microsof t
Hyper-V 2019
Practical Guidance and Hands-On Labs
—
Andy Syrewicze
Richard Siddaway
Pro Microsoft
Hyper-V 2019
Practical Guidance and
Hands-On Labs
Andy Syrewicze
Richard Siddaway
Pro Microsoft Hyper-V 2019: Practical Guidance and Hands-On Labs
Andy Syrewicze Richard Siddaway
Jenison, MI, USA Baston, Lincolnshire, UK
ISBN-13 (pbk): 978-1-4842-4115-8 ISBN-13 (electronic): 978-1-4842-4116-5
https://doi.org/10.1007/978-1-4842-4116-5
Library of Congress Control Number: 2018961411
Copyright © 2018 by Andy Syrewicze, Richard Siddaway
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image, we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Joan Murray
Development Editor: Laura Berendson
Coordinating Editor: Jill Balzano
Cover image designed by Ryan McGuire
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street,
6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-
sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member
(owner) is Springer Science+Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a
Delaware corporation.
For information on translations, please e-mail rights@apress.com, or visit www.apress.com/
rights-permissions.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the authors in this book is available to
readers on GitHub via the book’s product page, located at www.apress.com/9781484241158. For more
detailed information, please visit www.apress.com/source-code.
Printed on acid-free paper
To my wife, Crystal, and my son, Evan, for their continued love,
their support of my IT community work, and, more generally,
for always putting up with my shenanigans and tomfoolery.
—Andy
To the ladies of my family—June, Ann,
Sarah, and my granddaughters Lauren and Hannah
Thank you for being a treasured part of my life.
—Richard
Table of Contents
About the Authors ����������������������������������������������������������������������������������������������������xv
Acknowledgments �������������������������������������������������������������������������������������������������xvii
Introduction ������������������������������������������������������������������������������������������������������������xix
Chapter 1: Introduction to Hyper-V ���������������������������������������������������������������������������1
What Is Hyper-V? ���������������������������������������������������������������������������������������������������������������������������2
The Business Benefits of Hyper-V �������������������������������������������������������������������������������������������������3
Setting the Stage ���������������������������������������������������������������������������������������������������������������������3
The Physical Computing Model �����������������������������������������������������������������������������������������������4
Making the Change to Virtualized Computing �������������������������������������������������������������������������5
The Virtualized Computing Model ��������������������������������������������������������������������������������������������8
Hyper-V Architecture ���������������������������������������������������������������������������������������������������������������������9
Hardware Layer ���������������������������������������������������������������������������������������������������������������������10
Hypervisor Layer ��������������������������������������������������������������������������������������������������������������������11
VMBus �����������������������������������������������������������������������������������������������������������������������������������11
Parent Partition ����������������������������������������������������������������������������������������������������������������������11
Virtualization Service Provider (VSP) �������������������������������������������������������������������������������������11
Virtual Machine Worker Process (VMWP) ������������������������������������������������������������������������������11
Virtual Machine Management Service (VMMS) ���������������������������������������������������������������������12
Child Partition ������������������������������������������������������������������������������������������������������������������������12
Virtualization Service Client (VSC) �����������������������������������������������������������������������������������������12
Integration Components (ICs) ������������������������������������������������������������������������������������������������12
Windows Server Versions �����������������������������������������������������������������������������������������������������������13
Nano Server ���������������������������������������������������������������������������������������������������������������������������15
Hyper-V Server ����������������������������������������������������������������������������������������������������������������������15
Windows 10 ���������������������������������������������������������������������������������������������������������������������������16
Lab Work �������������������������������������������������������������������������������������������������������������������������������������16
v
Table of ConTenTs
Chapter 2: Configuring Hyper-V Host Settings ��������������������������������������������������������17
In This Chapter ����������������������������������������������������������������������������������������������������������������������������17
What Is Hyper-V Manager? ���������������������������������������������������������������������������������������������������������18
Hyper-V Manager �������������������������������������������������������������������������������������������������������������������18
Failover Cluster Manager ������������������������������������������������������������������������������������������������������18
System Center Virtual Machine Manager ������������������������������������������������������������������������������18
PowerShell ����������������������������������������������������������������������������������������������������������������������������19
Windows Admin Center ���������������������������������������������������������������������������������������������������������19
Connecting to Hyper-V Hosts ������������������������������������������������������������������������������������������������������20
Navigating the Hyper-V Manager UI ��������������������������������������������������������������������������������������������22
Configuring Hyper-V Host Settings ����������������������������������������������������������������������������������������������24
Virtual Hard Disks ������������������������������������������������������������������������������������������������������������������26
Virtual Machines ��������������������������������������������������������������������������������������������������������������������26
Physical GPUs ������������������������������������������������������������������������������������������������������������������������26
NUMA Spanning ���������������������������������������������������������������������������������������������������������������������26
Live Migrations ����������������������������������������������������������������������������������������������������������������������27
Storage Migrations ����������������������������������������������������������������������������������������������������������������27
Enhanced Session Mode Policy ���������������������������������������������������������������������������������������������27
Replication Configuration ������������������������������������������������������������������������������������������������������27
Configuring Hyper-V Host Settings with PowerShell �������������������������������������������������������������������28
Lab Work �������������������������������������������������������������������������������������������������������������������������������������29
Chapter 3: Creating Your First Hyper-V Virtual Machine ����������������������������������������31
In This Chapter ����������������������������������������������������������������������������������������������������������������������������31
What Components Make a Virtual Machine? ������������������������������������������������������������������������������32
Virtual Machine Config File ����������������������������������������������������������������������������������������������������32
Virtual Machine BIN and VSV Files in 2012 and 2012 R2 ������������������������������������������������������34
VHD and VHDX Files ���������������������������������������������������������������������������������������������������������������35
AVHD Files �����������������������������������������������������������������������������������������������������������������������������35
Creating a New Virtual Machine ��������������������������������������������������������������������������������������������������36
Connecting to Virtual Machines ��������������������������������������������������������������������������������������������������43
vi
Table of ConTenTs
Managing the Virtual Machine Console ���������������������������������������������������������������������������������������45
Installing the Guest OS ����������������������������������������������������������������������������������������������������������������47
Creating a New VM with PowerShell �������������������������������������������������������������������������������������������48
Lab Work �������������������������������������������������������������������������������������������������������������������������������������49
Chapter 4: Configuring Basic Virtual Machine Resources and Settings �����������������51
In This Chapter and Beyond ��������������������������������������������������������������������������������������������������������51
Configuring Virtual Machine CPU Resources �������������������������������������������������������������������������������52
Virtual Machine Reserve (Percentage) ����������������������������������������������������������������������������������56
Percent of Total System Resources ���������������������������������������������������������������������������������������56
Virtual Machine Limit (Percentage) ���������������������������������������������������������������������������������������56
Virtual Machine CPU Compatibility ����������������������������������������������������������������������������������������57
What About NUMA? ���������������������������������������������������������������������������������������������������������������57
Configuring Virtual Machine Memory Resources ������������������������������������������������������������������������58
Dynamic Memory ������������������������������������������������������������������������������������������������������������������60
Configuring Additional Virtual Machine Storage Resources ��������������������������������������������������������62
Other Notable Settings ����������������������������������������������������������������������������������������������������������������64
Lab Work �������������������������������������������������������������������������������������������������������������������������������������66
Chapter 5: Managing and Maintaining Hyper-V Integration Services ��������������������69
In This Chapter and Beyond ��������������������������������������������������������������������������������������������������������69
What Are Integration Services? ���������������������������������������������������������������������������������������������������70
Integration Services Defined �������������������������������������������������������������������������������������������������72
Supported Windows Server Guest Operating Systems ����������������������������������������������������������73
Managing Hyper-V Integration Services ��������������������������������������������������������������������������������������76
Installing Integration Services �����������������������������������������������������������������������������������������������76
Enabling and Disabling Integration Services �������������������������������������������������������������������������78
Transferring Files with Integration Services ��������������������������������������������������������������������������80
Updating Integration Services �����������������������������������������������������������������������������������������������82
Lab Work �������������������������������������������������������������������������������������������������������������������������������������83
vii
Table of ConTenTs
Chapter 6: Managing and Modifying Virtual Machine Files ������������������������������������85
In This Chapter and Beyond ��������������������������������������������������������������������������������������������������������85
File Types and Their Default Locations ����������������������������������������������������������������������������������������86
Locating Virtual Machine Files Using Hyper-V Manager ��������������������������������������������������������87
Locating Virtual Machine Files Using PowerShell ������������������������������������������������������������������90
Moving Virtual Machine Files �������������������������������������������������������������������������������������������������92
Virtual Machine Configuration File ����������������������������������������������������������������������������������������������92
Virtual Hard Disks—VHDs and VHDXs �����������������������������������������������������������������������������������������96
Converting Virtual Hard Disks ������������������������������������������������������������������������������������������������97
Virtual Hard Disk Types ����������������������������������������������������������������������������������������������������������98
Extending and Shrinking Virtual Hard Disks ������������������������������������������������������������������������������100
Lab Work �����������������������������������������������������������������������������������������������������������������������������������106
Chapter 7: Utilizing Hyper-V Checkpoints for Software Upgrades �����������������������107
In This Chapter and Beyond ������������������������������������������������������������������������������������������������������107
What Are Hyper-V Checkpoints �������������������������������������������������������������������������������������������������108
Using Hyper-V Checkpoints via Hyper-V Manager ��������������������������������������������������������������������109
Managing Multiple Checkpoints with Hyper-V Manager �����������������������������������������������������111
Deleting and Merging Checkpoints with Hyper-V Manager �������������������������������������������������113
Using Hyper-V Checkpoints with PowerShell ����������������������������������������������������������������������������116
What Not to Do with Hyper-V Checkpoints ��������������������������������������������������������������������������������119
Hyper-V Checkpoints Are Not a Replacement for a Backup ������������������������������������������������119
Hyper-V Checkpoints Are Not Suitable for Domain Controllers��������������������������������������������119
Hyper-V Checkpoints Are Not Suitable for Live Multitiered Applications �����������������������������120
Do Not Modify Virtual Disk Layout While It Has Active Checkpoints ������������������������������������120
Lab Work �����������������������������������������������������������������������������������������������������������������������������������120
Chapter 8: Connecting Virtual Machines to the Physical Network �����������������������123
In This Chapter and Beyond ������������������������������������������������������������������������������������������������������123
Introduction to the Hyper-V Extensible Switch ��������������������������������������������������������������������������123
Virtual Switch Types in Hyper-V and Their Uses ������������������������������������������������������������������������125
viii
Table of ConTenTs
External Virtual Switch ��������������������������������������������������������������������������������������������������������125
Internal Virtual Switch ���������������������������������������������������������������������������������������������������������125
Private Virtual Switch ����������������������������������������������������������������������������������������������������������126
Creating a Hyper-V Virtual Switch ���������������������������������������������������������������������������������������������127
Attaching Virtual Machines to a vSwitch �����������������������������������������������������������������������������129
Managing vSwitches with PowerShell ��������������������������������������������������������������������������������131
Management Network Considerations ��������������������������������������������������������������������������������������132
NIC Teaming ������������������������������������������������������������������������������������������������������������������������������132
Lab Work �����������������������������������������������������������������������������������������������������������������������������������135
Chapter 9: Connecting Hyper-V Hosts to Storage Infrastructure ��������������������������137
In This Chapter and Beyond ������������������������������������������������������������������������������������������������������137
Direct-Attached Storage in Hyper-V ������������������������������������������������������������������������������������������138
Shared Storage in Hyper-V ��������������������������������������������������������������������������������������������������������142
iSCSI ������������������������������������������������������������������������������������������������������������������������������������142
Deploying a Storage Appliance ��������������������������������������������������������������������������������������������143
The Microsoft iSCSI Initiator ������������������������������������������������������������������������������������������������144
Lab Work �����������������������������������������������������������������������������������������������������������������������������������147
Chapter 10: Providing High Availability for Hyper-V Virtual Machines �����������������149
Introducing Microsoft Failover Clustering ���������������������������������������������������������������������������������151
Cluster Quorum��������������������������������������������������������������������������������������������������������������������153
Cluster Storage ��������������������������������������������������������������������������������������������������������������������154
Clustering Hyper-V Hosts ����������������������������������������������������������������������������������������������������������155
Networking for Hyper-V Clusters �����������������������������������������������������������������������������������������157
Creating a Hyper-V HA Cluster ��������������������������������������������������������������������������������������������������160
Configure Storage ����������������������������������������������������������������������������������������������������������������161
Configure Cluster Nodes ������������������������������������������������������������������������������������������������������165
Create Cluster ����������������������������������������������������������������������������������������������������������������������166
Cluster Configuration ����������������������������������������������������������������������������������������������������������������170
Configure Cluster Networking ���������������������������������������������������������������������������������������������������170
ix
Table of ConTenTs
Configure Networks �������������������������������������������������������������������������������������������������������������170
Change Network Name and Purpose �����������������������������������������������������������������������������������171
Configure Storage Spaces Direct�����������������������������������������������������������������������������������������175
Configure Witness ����������������������������������������������������������������������������������������������������������������177
Lab Work �����������������������������������������������������������������������������������������������������������������������������������178
Chapter 11: Using Failover Cluster Manager to Manage Hyper-V Clusters ����������179
Managing Virtual Machines �������������������������������������������������������������������������������������������������������181
Creating Virtual Machines ����������������������������������������������������������������������������������������������������181
Virtual Machine Administration �������������������������������������������������������������������������������������������187
Managing Storage ���������������������������������������������������������������������������������������������������������������������191
Planning Storage Needs ������������������������������������������������������������������������������������������������������191
Add Storage to Cluster���������������������������������������������������������������������������������������������������������192
Extending a Cluster Shared Volume ������������������������������������������������������������������������������������195
Change a Node That Owns a Disk����������������������������������������������������������������������������������������196
Create Migration Network ���������������������������������������������������������������������������������������������������������197
Managing Cluster Nodes �����������������������������������������������������������������������������������������������������������199
Add a Cluster Node ��������������������������������������������������������������������������������������������������������������199
Remove a Cluster Node �������������������������������������������������������������������������������������������������������201
Lab Work �����������������������������������������������������������������������������������������������������������������������������������202
Chapter 12: Clustering Hyper-V Guests ����������������������������������������������������������������203
Hyper-V Guest Clustering Explained ������������������������������������������������������������������������������������������203
Use Cases for Hyper-V Guest Clustering ������������������������������������������������������������������������������204
Requirements for Hyper-V Guest Clustering ������������������������������������������������������������������������204
Guest Cluster Specification �������������������������������������������������������������������������������������������������������206
Create Cluster Nodes ����������������������������������������������������������������������������������������������������������������208
Create Cluster ���������������������������������������������������������������������������������������������������������������������������209
Create VHD Set ��������������������������������������������������������������������������������������������������������������������������210
Configure iSCSI Storage ������������������������������������������������������������������������������������������������������������213
Create iSCSI Server and Target��������������������������������������������������������������������������������������������214
Present Storage to Cluster Nodes ���������������������������������������������������������������������������������������222
Configure Witness Disk �������������������������������������������������������������������������������������������������������������226
x
Description:Successfully create and manage your Hyper-V environment without any of the marketing fluff. This book's lab-driven, hands-on approach will get you up and running as quickly and efficiently as possible.Virtualization is the cornerstone of today’s data center. As a modern-day IT pro, you are require