Windows Server 2016 Hyper-V Cookbook - Second Edition - Patrick Lownds - E-Book

Windows Server 2016 Hyper-V Cookbook - Second Edition E-Book

Patrick Lownds

0,0
50,39 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Title: Windows Server 2016 Hyper-V Cookbook

Edition: Second Edition

Paragraph 1:

Hyper-V 2016 is full of new features and updates. The second of our best-selling Hyper-V books, the Windows Server 2016 Hyper-V Cookbook has it all covered. Brimming with expert solutions and techniques, you'll have everything you need to master virtualization and Hyper-V Manager.

Paragraph 2:

This Hyper-V book is designed to help advanced-level administrators benefit fully from the new Windows Server. With over 80 hands-on recipes, the Hyper-V Cookbook gives you tips, tricks and best practices to deploy, maintain and upgrade your virtual machines.

Bulleted List:

With this book, you'll learn about:

  • Installing and managing Hyper-V Server in Full, Server Core, and Nano Server
  • Migrating and upgrading physical and virtual machines
  • Configuring network, memory, security, and auditing settings for virtual machines
  • High availability and disaster recovery
  • Saving time and money with PowerShell automation
  • The new features around network and nested virtualization, distributed storage QoS, Hyper-V Replica, and much more
  • Monitoring, reporting, and troubleshooting with Hyper-V 2016 best practices
  • Deploying and automating multiple VMs and support Windows Hyper-V 2016 clusters through different installation methods

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 565

Veröffentlichungsjahr: 2017

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Windows Server 2016 Hyper-V Cookbook - Second Edition
Credits
About the Authors
Acknowledgments
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Customer Feedback
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Installing and Managing Hyper-V in Full, Server Core, and Nano Server
Introduction
Verifying Hyper-V requirements
Getting ready
How to do it...
How it works...
See also
Enabling the Hyper-V role
Getting ready
How to do it...
How it works...
There's more...
Installing Hyper-V using Windows PowerShell
See also
Installing Windows Server 2016, Microsoft Hyper-V Server 2016, and Nano Server
Getting ready
How to do it...
Create a Nano Server Image using PowerShell
Create a Nano Server image using Nano Server Image Builder
Deploy Nano Server on a physical machine
How it works...
See also
Managing a Server Core installation using sconfig
Getting ready
How to do it...
How it works...
See also
Remotely managing a Nano Server installation
Getting ready
How to do it...
Managing Nano Server using PowerShell
Getting ready
How to do it
How it works
Managing Nano Server using Server Management Tools – SMT
Getting ready
How to do it...
How it works...
See also
Configuring Hyper-V post-installation settings
Getting ready
How to do it...
How it works...
See also
2. Migrating and Upgrading Physical and Virtual Servers
Introduction
Performing an in-place upgrade from Windows Server 2012 R2 to Windows Server 2016
Getting ready
How to do it…
How it works…
Why Windows Update?
See also
Exporting and importing virtual machines
Getting ready
How to do it…
How it works…
See also
Migrating virtual machines and updating their Integration Services
Getting ready
How to do it…
How it works…
There's more…
See also
Migrating virtual machine using Cross Version Shared Nothing Live Migration
Getting ready
How to do it…
How it works…
Configuring constrained delegation to authenticate live migrations
See also
Migrating virtual machine storage using Storage Migration
Getting ready
How to do it…
How it works…
There's more…
Moving all the virtual machines to a new storage location
Converting VHD files to VHDX
Getting ready
How to do it…
How it works…
There's more…
See also
Upgrading the VM configuration version
Getting ready
How to do it…
How it works…
There's more…
See also
Converting physical computers to virtual machines
Getting ready
How to do it…
How it works…
There's more…
Converting physical computers to virtual machines using the command line
3. Managing Disk and Network Settings
Introduction
Creating and adding virtual hard disks
Getting ready
How to do it…
How it works…
There's more…
Online resizing for VHDX virtual hard disk
Adding a pass-through disk for a virtual machine
Creating virtual machines on file servers
See also
Configuring IDE and SCSI controllers
Getting ready
How to do it…
How it works…
There's more…
Configuring the Storage Quality of Service
Getting ready
How to do it…
How it works…
Minimum IOPS
Maximum IOPS
There's more…
See also
Configuring and adding Virtual Fibre Channel storage
Getting ready
How to do it…
How it works…
Creating resource pools
Getting ready
How to do it…
How it works…
There's more…
See also
Enabling and adding NIC teaming
Getting ready
How to do it…
How it works…
There's more…
Creating and managing virtual switches
Getting ready
How to do it…
How it works…
Using legacy network adapters
See also
Using advanced virtual machine network settings
Getting ready
How to do it…
How it works…
There's more…
See also
Adding and removing vmNICs
Getting ready
How to do it…
How it works…
There's more…
4. Saving Time and Cost with Hyper-V Automation
Introduction
Creating virtual machine templates
Getting ready...
How to do it...
How it works...
There's more...
See also
Learning and utilizing basic commands in PowerShell
Getting ready
How to do it...
How it works...
There's more...
See also
Using PowerShell commands for daily tasks
Getting ready
How to do it...
How it works...
There's more...
Using PowerShell ISE for advanced script editing
Enabling scripts to be executed in PowerShell
See also
Enabling and working with remote connection and administration through PowerShell
Getting ready
How to do it...
How it works...
Managing virtual machines with PowerShell Direct
Getting ready
How to do it...
How it works...
There's more...
See also
Hyper-V management and PowerShell improvements
Getting ready
How to do it...
How it works...
See also
5. Hyper-V Best Practices, Tips, and Tricks
Introduction
Using the Hyper-V best practices analyzer
Getting ready
How to do it...
How it works...
There's more...
Using PowerShell to create HTML reports with the BPA results
Optimizing virtual machines' resources
Getting ready
How to do it...
Virtual NUMA
NUMA spanning
Virtual machine settings
How it works...
There's more...
Using PowerShell to manage memory for virtual machines
See also
Enabling nested virtualization
Getting ready
Requirements
Supported scenarios
Unsupported scenarios
How to do it...
Networking option 1 – MAC address spoofing
Networking option 2 – network address translation
How it works...
See also
Graphics virtualization in Windows Server 2016 Hyper-V
Getting ready
How to do it...
RemoteFX vGPU configuration
Prioritizing H.264/AVC 444 Graphics mode for Remote Desktop connections
Configuring H.264/AVC hardware encoding for Remote Desktop Connections
How it works...
There's more...
Installing and configuring anti-virus for the host and virtual machines
Getting ready
How to do it...
How it works...
There's more...
Protecting your virtualized environment with 5nine Cloud Security
6. Security and Delegation of Control
Introduction
Configuring Windows Update for Hyper-V
Getting ready
How to do it...
How it works...
Delegating control in Hyper-V
Getting ready
How to do it...
How it works…
Configuring Port ACLs
Getting ready…
How to do it…
How it works…
See also…
Installing and configuring BitLocker for data protection
Getting ready
How to do it…
How it works…
There's more…
See also
Configuring Hyper-V auditing
Getting ready
How to do it…
How it works
Virtual Machine Secure boot
Getting ready
How to do it…
How it works…
There's more…
See also…
VM protection (vTPM)
Getting ready
How to do it…
How it works…
See also…
Shielded VM
Getting ready…
How to do it…
How it works…
There's more…
See also…
Host Resource Protection
Getting ready
How to do it…
How it works…
See also…
7. Configuring High Availability in Hyper-V
Introduction
Installing and configuring block and file storage in Windows Server 2016
Getting ready
How to do it…
How it works…
See also…
Installing and configuring the Windows Failover Clustering feature
Getting ready
How to do it…
How it works…
Protected Networks
There's more…
See also…
Enabling cluster shared volumes
Getting ready
How to do it…
How it works…
There's more…
Configuring CSV Cache for Hyper-V environments
See also…
Rolling cluster upgrades
Getting ready
How to do it…
How it works…
There's more…
See also…
Configuring Cluster-Aware Updating for cluster nodes
Getting ready
How to do it…
How it works…
There's more…
Using PowerShell to manage Cluster-Aware Updating
Generating reports on past updating runs
See also…
Using Live Migration in a cluster environment
Getting ready
How to do it…
How it works…
There's more…
See also…
Configuring VM Priority for clustered virtual machines
Getting ready
How to do it…
How it works…
There's more…
VM Load Balancing
Getting ready
How to do it…
How it works…
There's more…
VM Compute Resiliency
Getting ready
How to do it…
How it works…
There's more…
Virtual Machine Storage Resiliency
8. Disaster Recovery for Hyper-V
Introduction
Backing up Hyper-V and VMs using Windows Server Backup
Getting ready
How to do it...
How it works...
There's more...
Checking the Windows Server Backup PowerShell commandlets
Backing up Hyper-V VMs using PowerShell
See also
Restoring Hyper-V and VMs using Windows Server Backup
Getting ready
How to do it...
How it works...
See also
Configuring Hyper-V Replica between three Hyper-V hosts using HTTP authentication
Getting ready
How to do it...
Support for Hot Add/Remove of Disks
Hyper-V Replica Rolling Cluster upgrade support
Protection of Multi-VM and Guest Clustered applications support
Protection of Shielded virtual machines
Protection of virtual machines hosted on Nano Server Hyper-V
How it works...
There's more...
Throttling Hyper-V Replica Traffic
Using PowerShell to configure and enable Hyper-V Replica
Advanced Hyper-V Replica Monitoring
See also
Configuring Hyper-V Replica Broker for a Failover Cluster
Getting ready
How to do it...
How it works...
See also
Configuring Hyper-V Replica to use certificate-based authentication using an Enterprise CA
Getting ready
How to do it...
How it works...
There's more...
See also
Using checkpoints in VMs
Getting ready
How to do it...
How it works...
There's more...
See also
9. Azure Site Recovery and Azure Backup for Hyper-V
Introduction
Enabling Hyper-V virtual machines protection to Azure with Azure Site Recovery and Microsoft Azure Backup Server
Getting ready
How to do it...
Step 1: Create an Azure Site Recovery vault
Step 2: Prepare Infrastructure - Protection Goal
Step 2: Prepare Infrastructure – Prepare Source
Step 2: Prepare infrastructure – Prepare Target
Step 2: Prepare infrastructure – replication settings
Step 2: Prepare infrastructure – capacity planning
Step 3: Replicate the application
Step 4: Manage Recovery Plans - Create Recovery Plan
Step 4: Manage Recovery Plans - Customize Recovery Settings
Step 5: Run a test failover
Step 6: Monitoring Azure Site Recovery - Jobs, Alerts and Events
Step 6: Monitoring Azure Site Recovery - General Monitoring
How it works...
There's more...
Using Windows PowerShell to replicate between on-premises Hyper-V VMs and Azure
Backing up to Azure
See also
10. Monitoring, Tuning, and Troubleshooting Hyper-V
Introduction
Using real-time monitoring tools
Getting ready
How to do it…
How it works…
There's more…
See also
Using Perfmon for logged monitoring
Getting ready
How to do it…
How it works…
Hyper-V general:
Physical and virtual processor:
Memory:
Disk:
Network:
See also
Using VM monitoring
Getting ready
How to do it…
How it works…
Monitoring Hyper-V Replica
Getting ready
How to do it…
How it works…
There's more…
See also
Using resource metering
Getting ready
How to do it…
How it works…
Tuning your Hyper-V server
Getting ready
How to do it…
How it works…
See also
Using event viewer for Hyper-V troubleshooting
Getting ready
How to do it…
How it works…
See also
A. Hyper-V Architecture and Components
Understanding Hypervisors
VMM Type 2
VMM Hybrid
VMM Type 1
Hyper-V architecture
Windows before Hyper-V
Windows after Hyper-V
Hyper-V architecture components
Hypervisor
Partitions
Virtualization stack
Enlightened (high performance) versus emulated (low performance)
Backup improvements
Differences between Windows Server 2016 Hyper-V, Nano Server, Hyper-V Server, Hyper-V Client, and VMware
Hyper-V limitations improvements
Windows Server 2016 Hyper-V
Nano Server
Microsoft Hyper-V Server 2016
Hyper-V Client
Windows Server 2016 Hyper-V X VMware vSphere 6.5
Automatic Virtual Machine Activation
Hyper-V comparing technologies
Index

Windows Server 2016 Hyper-V Cookbook - Second Edition

Windows Server 2016 Hyper-V Cookbook - Second Edition

Copyright © 2017 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: November 2012

Second edition: January 2017

Production reference: 1130117

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78588-431-3

www.packtpub.com

Credits

Authors

Patrick Lownds

Charbel Nemnom

Leandro Carvalho

Reviewer

Leandro Carvalho

Commissioning Editor

Kartikey Pandey

Acquisition Editor

Rahul Nair

Content Development Editor

Mehvash Fatima

Technical Editor

Nirant Carvalho

Copy Editor

Sneha Singh

Project Coordinator

Judie Jose

Proofreader

Safis Editing

Indexer

Pratik Shirodkar

Graphics

Jason Monteiro

Production Coordinator

Shantanu N. Zagade

Cover Work

Shantanu N. Zagade

About the Authors

Patrick Lownds is a Master level Solution Architect working for TS Consulting WW, in the Cloud Professional Services practice, for Hewlett-Packard Enterprise, and is based out of London (UK). Patrick is also a current Microsoft Most Valuable Professional (MVP) for Cloud and Datacenter Management (CDM) and has worked in the IT industry since 1988 on various technologies, including Windows Server Hyper-V, System Center, Windows Azure Pack, and Microsoft Azure.

In his current role, he works mainly with the most recent versions of Windows Server, Microsoft Azure Stack, and Microsoft Azure. Although, Patrick's current area of personal interest is Windows Containers and Docker. Patrick has participated in the Windows Server 2016 and System Center 2016 Continuous Customer Engagement Program (CCEP) and Azure Stack Early Adoption Initiative Program.

Patrick has previously contributed to a number of books entitled Mastering Hyper-V Deployment, Microsoft Private Cloud Computing and Windows Server 2012 Hyper-V Installation and Configuration Guide. All of which were published by Wiley and Sybex. He blogs and tweets in his spare time and can be found on Twitter as @patricklownds.

When not consulting, speaking, writing or researching, he can be found on a rugby pitch teaching contact rugby to children of various ages.

Acknowledgments

Fourth time lucky! Writing takes quite a bit of personal commitment and dedication, but it also takes a lot of support. Taking up such a project would not be possible without help from family, friends, and colleagues. I would like to thank my wife, Lisa, for her continued help and for simply keeping everything together, and my children for being especially patient while I worked.

A special thanks go to the editors at Packt Publishing (huge thanks goes to Rahul Nair, Mehvash Fatima, Nirant Carvalho, and Narsimha Pai) for taking this project and making it a reality.

My co-author (Charbel Nemnom) for giving me the opportunity to write with him. As part of this book project, I got the opportunity to write about features that I had not had the opportunity to dive deeply into, and so I also got the opportunity to go and develop my own skills as part of the process.

Finally, I would like to thank a number of people for helping me along the way: Ben Armstrong, Rob Hindman, Lars Iwer, Kathy Davies, Catherine Watson, Subhasish Bhattacharya, Patrick Lang, Jim Wooldridge, and Matt McSpirit.

Charbel Nemnom is a Microsoft Most Valuable Professional (MVP) for Cloud and Datacenter Management (CDM) and a Technical Evangelist for 5nine Software and Unidesk Coporation. Charbel has extensive Infrastructure expertise and a vast knowledge of a variety of Microsoft and VMware technologies. He has over fifteen years of professional experience in the Information Technology field and guiding technical teams to optimize the performance of mission-critical enterprise systems. He has worked as a system and network engineer, senior consultant, and as regional technical manager and has a history of successful enterprise projects in the IT, banks, education, and publishing sectors. He works as a Virtualization Consultant and Architect in the MENA region. He authored Getting Started with Windows Nano Server, co-authored Windows Server 2016 Hyper-V Cookbook, Second Edition, and reviewed Hyper-V Best Practices books (Packt Publishing). Charbel also runs his blog at (https://charbelnemnom.com) where he blogs frequently about Software Defined Datacenter and Cloud Computing. Charbel is Microsoft, Cisco, and VMware certified and holds the following credentials: VCA-DCV, MCP, MCSA, MCTS, MCITP, MCS, MCSD, MCSE, CCNP, ITIL®, and PMP®. You can also follow him on Twitter @CharbelNemnom.

Books don't write, edit, and publish themselves. I would like to dedicate a big thank you to my family for their support and patience for being busier than usual the last one year, and for always supporting the crazy things I want to do, who is the reason that I can fulfill my dream and follow my passion.

Of course, the book wouldn't be possible at all without the Packt Publishing team for supporting all the authors and reviewers during this project. I want to say a big thank you to the Acquisition Editors Rahul Nair, Content Development Team Mehvash Fatima, and Technical Editors Nirant Carvalho, Narsimha Pai.

Thanks also to my co-author Patrick Lownds and the reviewers who provided feedback during the book development: Leandro Carvalho, Didier Van Hoye, and Carsten Rachfahl.

Finally, I want to thank Microsoft product group individually and give them the credit they deserve for helping make this book as good as possible (if I've missed anyone, I'm truly sorry): Ben Armstrong, Mathew John, Sarah Cooley, Theo Thomson, Andy Atkinson, Chris Huybregts, Jim Wooldridge, Lars Iwer, Steven Ekren, Claus Joergensen, Cosmos Darwin, Elden Christensen, Subhasish Bhattacharya, Don Stanwyck, Andrew Mason, Anders Ravnholt, Dan Harman, Venkat Yalla, Samuel Li, Rajani Janaki Ram, Rochak Mittal, Aditi Gangwar, Neela Syam Kolli, Shon Shah, Sneha Agrawal, Swapnil Sumbe, Ravi Chivukula, Nirbhay Singh, Ashish Mehndi, and Schumann Ge.

Leandro Carvalho works as Microsoft specialist with products such as Windows Server, Hyper-V, Public and Private Cloud, Office 365, Security, System Center, Exchange, Sharepoint, Project Server and client systems, in addition to helping the community constantly with articles, forums, videos and lectures about his passion: Microsoft Virtualisation and Cloud Computing. He has been speaking in large events such as MMS, Teched Australia, MVP Pro Speaker Series and many others and is the author of the Windows Server 2012 Hyper-V Cookbook. Leandro has been working as Microsoft trainer since 2006 and has obtained the certifications Certified Ethical Hacker/MCP/MCSA+M+S/MCSE+S/MCTS/MCITP/MCT and MVP. In 2009 he received the MCT Awards Latin America Trainer of the year and since 2009 the Microsoft MVP as a Virtualisation Specialist.

I always thought that writing my own book was a distant and almost impossible dream when I realized it could actually become reality when I was invited to write the first edition of this book back in 2012 which was a great success and accomplishment in my professional life. I also thought that would be it and I would never write another one again. So good to be wrong once more. This time I want to thank my wife Juliana and my son Eduardo. I love you both and I dedicate this book to you. Secondly I would like to thank Patrick Lownds and Charbel Nemnom for the amazing work of getting the book updated to the 2016 version. Thank you guys!

www.PacktPub.com

eBooks, discount offers, and more

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

https://www.packtpub.com/mapt

Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career.

Why subscribe?

Fully searchable across every book published by PacktCopy and paste, print, and bookmark contentOn demand and accessible via a web browser

Customer Feedback

Thank you for purchasing this Packt book. We take our commitment to improving our content and products to meet your needs seriously—that's why your feedback is so valuable. Whatever your feelings about your purchase, please consider leaving a review on this book's Amazon page. Not only will this help us, more importantly it will also help others in the community to make an informed decision about the resources that they invest in to learn.

You can also review for us on a regular basis by joining our reviewers' club. If you're interested in joining, or would like to learn more about the benefits we offer, please contact us: <[email protected]>.

 

For Norman Callaghan who is always in my thoughts.

  --Patrick Lownds
 

For Dr. Wayne W. Dyer - The world was, is, and will be a better place just because you have lived. You will be greatly missed.

  --Charbel Nemnom

Preface

Thank you for purchasingWindows Server 2016 Hyper-V Cookbook – Second Edition. The book you are holding is the result of 15 years of experience in the IT world and over 10 years of virtualization experience that started with Microsoft Virtual Server 2005, Virtual PC, and now Hyper-V. Virtualization is the keystone of any modern data center.

Hyper-V is a mature and widely adopted virtualization platform that is designed to work with both Windows and Unix/Linux virtual machines. In addition to being used by many of the largest companies in the world, Hyper-V powers Microsoft Azure public cloud, which is one of the largest cloud services in the world, and it powers Microsoft Azure Stack for on-premises and private cloud deployment including the support for both enterprise and service providers.

Our aim in this book is to provide you with the information you need to be immediately effective in deploying, migrating, and administering Hyper-V environments.

We hope that you'll get as much from reading this book as we did from writing it. Please be sure to post any questions, comments, or suggestions you have about the book in the Author Online forum. Your feedback is important to us in order to develop the best book possible in the future.

Charbel NemnomPatrick Lownds

What this book covers

Chapter 1, Installing and Managing Hyper-V in Full, Server Core, and Nano Server, will provide all the information you need to know to install and manage Hyper-V in Full, Server Core, and Nano Server before, during, and after the installation to make sure that you can save time and solve any problems that you may face.

Chapter 2, Migrating and Upgrading Physical and Virtual Servers, will show you everything you need to know in order to migrate and upgrade any physical and virtual servers to make sure you have an easy and successful upgrade to the new Windows Server 2016 Hyper-V.

Chapter 3, Managing Disk and Network Settings, will go deeper into the various configuration options for virtual machine disks and virtual networks so that you can select the best setting based on the applications you need to deploy.

Chapter 4, Saving Time and Cost with Hyper-V Automation, will show you how easy and user-friendly PowerShell is and how to create simple steps to make sure that your tasks will be done faster and with lesser work. It's very important to work more effectively and be able to automate processes and achieve automation in your day-to-day job.

Chapter 5, Hyper-V Best Practices, Tips, and Tricks, will ensure that you use the correct settings and apply the best configuration for Hyper-V. Best practices are a set of rules and tips created by Microsoft to help you identify problems, misconfiguration issues, and anything else that is generally not recommended. This chapter will also cover Hyper-V nested virtualization and graphics improvement in Windows Server 2016 Hyper-V, so you can virtualize any workload that requires high graphics.

Chapter 6, Security and Delegation of Control, will dive into how to configure Windows Update for Windows Server 2016 Server Core, Windows Server 2016 Server with Desktop Experience and Nano Server installations, access control using Authorization Manager and Simple Authorization, network protection with Port ACLs, virtual machine security with Secure Boot, disk encryption, shielded VMs, and Hyper-V auditing. Security is very important in any infrastructure, and this applies to virtualization and hybrid cloud computing as well.

Chapter 7, Configuring High Availability in Hyper-V, High availability is a key component for any workload you want to virtualize. The good news is that Windows Server 2016 Hyper-V comes with the right tools and high-availability solutions for almost all scenarios. In fact, Hyper-V and Failover Clustering are so deeply integrated in this release to make sure that they can respond appropriately for any transient failure you may encounter in your environment.

Chapter 8, Disaster Recovery for Hyper-V, will walk you through the most important processes to set up disaster recovery on-premises for your virtual machines running on Windows Server 2016 Hyper-V. High availability is not disaster recovery. Natural disasters, fire, flood, viruses, data corruption, human errors, and many other factors can make your entire system unavailable, and not having the proper precautions in place could mean losing it all.

Chapter 9, Azure Site Recovery and Azure Backup for Hyper-V, There are several advantages why you want to. will discuss the advantages of reconsidering your on-premises Disaster Recovery plan and will walk you through the most important processes of protecting your on-premises investment by leveraging Azure Site Recovery (ASR) and Azure Backup, which is a Disaster Recovery as a Service (DRaaS) solutions offered by Microsoft Azure.

Chapter 10, Monitoring, Tuning, and Troubleshooting Hyper-V, will show you how to use the default tools in Windows Server 2016 to monitor your physical and virtual servers, how to troubleshoot, and how to tune your Hyper-V servers, so you can respond faster and start troubleshooting to solve any problems that may arise in your environment.

Appendix: Hyper-V Architecture and Components, will explain the most important Hyper-V architecture components compared with other versions including the Hyper-V client on Windows 10, Nano Server, and VMware vSphere 6.5, as Hyper-V is now a mature and widely adopted virtualization solution. It also includes the backup improvements as well as the new licensing model that has been introduced in Windows Server 2016.

What you need for this book

To follow along on what we have been covered in this book, we strongly believe in learning by doing, and therefore we highly encourage you to try out all of the technologies and principles we covered in this book. You don't need a huge server. For most topics, you could use a single machine with Windows Server 2016 installed and 16GB of memory, and by enabling Hyper-V-nested virtualization, you could enable a few virtual machines to run concurrently. Ideally, though, having at least two physical servers will help with the replication and high-availability concepts. With Windows 10, Hyper-V client is included in the box. So even without any kind of real server, it is possible to explore many of the Hyper-V technologies.

Who this book is for

This book is intended for anyone who wants to learn and master Hyper-V 2016 and take advantage of all exciting new features that Windows Server 2016 Hyper-V has to offer. If you have a basic knowledge of virtualization, it will be helpful, but it's not a requirement. If you are an architect, a consultant, an administrator, or really anyone who just wants better knowledge of Hyper-V, this book is for you as well.

Please note that in some chapters, we go into advanced topics that may seem over your head. In those cases, don't worry. Focus on the preceding elements that you understand better, and implement and practice them to nurture your understanding. Then, when you feel ready, come back to the more advanced topics and read them multiple times. Repetition is the key. The more you repeat, the more you understand better.

Sections

In this book, you will find several headings that appear frequently (Getting ready, How to do it, How it works, There's more, and See also).

To give clear instructions on how to complete a recipe, we use these sections as follows:

Getting ready

This section tells you what to expect in the recipe and describes how to set up any software or any preliminary settings required for the recipe.

How to do it…

This section contains the steps required to follow the recipe.

How it works…

This section usually consists of a detailed explanation of what happened in the previous section.

There's more…

This section consists of additional information about the recipe in order to make the reader more knowledgeable about the recipe.

See also

This section provides helpful links to other useful information for the recipe.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "After the conversion, copy the output vhd file to the Hyper-V server you want to import the virtual machine to."

A block of code is set as follows:

MB";Expression={$_.MemoryDemand/1048576}}, MemoryStatus Write-Output "Updated Memory Demand" $VMMemory } }

Any command-line input or output is written as follows:

Move-VM Win-2012R2-02 HV-Host-P01 –IncludeStorage –DestinationStoragePath D:\VMs

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: " For the Configure Disk option, specify the VHDX file path and click on Finish to start the conversion."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail <[email protected]>, and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

Log in or register to our website using your e-mail address and password.Hover the mouse pointer on the SUPPORT tab at the top.Click on Code Downloads & Errata.Enter the name of the book in the Search box.Select the book for which you're looking to download the code files.Choose from the drop-down menu where you purchased this book from.Click on Code Download.

You can also download the code files by clicking on the Code Files button on the book's webpage at the Packt Publishing website. This page can be accessed by entering the book's name in the Search box. Please note that you need to be logged in to your Packt account.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

WinRAR / 7-Zip for WindowsZipeg / iZip / UnRarX for Mac7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Windows-Server-2016-Hyper-V-Cookbook-Second-Edition. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at <[email protected]>, and we will do our best to address the problem.

Chapter 1. Installing and Managing Hyper-V in Full, Server Core, and Nano Server

In this chapter, we will cover the following recipes:

Verifying Hyper-V requirementsEnabling the Hyper-V roleInstalling Windows Server 2016, Microsoft Hyper-V Server 2016, and Nano ServerManaging a Server Core installation using sconfigRemotely managing a Nano Server installationManaging Nano Server using PowerShellManaging Nano Server using Server Management Tools – SMTConfiguring Hyper-V post-installation settings

Introduction

Microsoft has done a great job with Hyper-V. Since its first version was introduced in 2008, the enterprises realized that it was a very good virtualization solution for a first release. The second version, released with Windows Server 2008 R2 SP1, brought a couple of new features that enabled mobility, such as Live Migration, Dynamic Memory, and RemoteFX support. The version of Windows Server 2016 Hyper-V goes beyond all expectations and brings with it the components that let the enterprises and service providers have everything they need to build the base of their cloud, either private or hybrid.

Almost everything in Hyper-V has been worked upon and improved and it comes with lots of extraordinary features that will transform the way we manage and deploy our data centers today. All workloads can now be virtualized with no exceptions and new features deliver environments beyond virtualization, as we know it. Nano Server, shielded virtual machines, cross-version PowerShell support, PowerShell Direct, Hot add and remove static memory, nested virtualization, SMB 3.1, and the new limits are examples that make Windows Server 2016 Hyper-V a key component with results, such as high availability, low cost, elasticity, reliability, and everything we need for our servers.

The Hyper-V journey starts with its installation. Even though the installation steps are simple, it is important to take care of the server prerequisites and the post-configuration tasks. It is also very important to verify all the hardware prerequisites, the installation, and the administration methods that will be used to manage your server.

Before we move on and start buying the physical hardware and installing Hyper-V, we need to start with planning phase which is one of the most important phases in building a virtual environment. During this phase, you will identify the proper hardware configuration and all the prerequisites based on your needs. By default, Hyper-V in Windows Server 2016 has some processor requirements and that's why these components must be present on every server that runs Hyper-V.

This chapter will provide all the information that you need to know before, during, and after the Hyper-V installation, to make sure that you can save time and solve any problem that you might face.

Verifying Hyper-V requirements

In order to install Hyper-V, you should make sure that your server supports it by verifying the prerequisites. Failing which, the Hyper-V requirements will result in an error while you install it.

Neither Windows nor Hyper-V offers a tool to verify the prerequisites, but processor companies have created tools, such as AMD-V System Compatibility Check and INTEL Processor Identification Utility.

In this recipe, you will learn how to use them and the MachineSLATStatusCheck tool to facilitate the process.

Getting ready

To verify the prerequisites of your processor, you must download Intel Processor Identification Utility. You can download it from the following link:

http://downloadcenter.intel.com/Detail_Desc.aspx?ProductID=1881&DwnldID=7838&lang=eng&i

Based on the server processor, you can also download the AMD Virtualization Technology and Microsoft Hyper-V System Compatibility Check Utility from the following link:

http://download.amd.com/techdownloads/AMD-VwithRVI_Hyper-V_CompatibilityUtility.zip

To identify the processor brand, open the DirectX Diagnostic Tool (dxdiag) and check the processor information.

You also need to download the MachineSLATStatusCheck tool available at https://slatstatuscheck.codeplex.com/ to verify if your processor supports Second-Level Address Translation (SLAT) that is required to install Hyper-V in Windows Server 2016. SLAT was always required since the first version of Hyper-V became available on Windows 8 client OS.

Note

If you are using Coreinfo tool to check your processor advanced features from Sysinternals, https://technet.microsoft.com/en-us/sysinternals/cc835722, please note that Coreinfo must be run on a system without the Hypervisor running for accurate results.

How to do it...

In the following steps, you will learn how to check whether your computer meets the requirements to install Hyper-V on Windows Server 2016 and Windows 10:

After downloading and installing the necessary tools as explained in the Getting ready section, install the utility based on your processor.For AMD processors, the AMD-V System Compatibility Check provides the results for AMD processors, if it supports Hyper-V, as shown in the following screenshot:If you have an Intel processor, after the Intel Processor Identification Utility is installed, you will see three tabs after you run it.Select the first tab named Frequency Test to show the highest frequency and speed that your processor can handle.Select the second tab named CPU Technologies and check whether the results for the technologies is supported by processor models, such as Virtualization technology, Hyper-Threading, and other technologies.Then, select the CPUID Data tab to see information, such as the Processor type, Family model, Cache sizes, and Data Execution Prevention (Execute Disable Bit).For Intel processors, the result will be similar to the following screenshot:

Note

As you can see in preceding screenshot, the Intel® Virtualization Technology support is showing No. Since Hyper-V is already installed on this machine and the hypervisorlaunchtype is set to Auto, Hyper-V will lock VT-x at boot time (The hypervisor loads before the parent/management partition). For that reason, the tool will show No for VT-x with Extended Page tables if Hyper-V is enabled and the system is running.

To verify whether the processor supports Second-Level Address Translation (SLAT) or not, use the free tool called MachineSLATStatusCheck.After it's downloaded, copy it to the chosen directory and then access it through the Windows Explorer and run it.The following screenshot is an example of a computer running a processor with SLAT support:With these steps, you have identified whether the server you want to install Hyper-V on has all its prerequisites satisfied.

How it works...

The mentioned tools simply verify the processor properties to show that it has the necessary features to install Hyper-V. One of these features is the Hardware-assisted virtualization. This functionality allows Hyper-V to run under privileged access through a special layer in the processor. In some cases, this feature must be enabled through the Basic Input-Output System (BIOS).

These tools also check whether the Data Execution Prevention (DEP) is present. Intel calls this feature Intel XD bit (Execute Disable Bit) and for AMD it is AMD NX bit (No Execute Bit). This feature must be enabled through the BIOS.

There is a particular prerequisite called Second Level Address Translation (SLAT) that is shown by the MachineSLATStatusCheck tool. Starting with Windows Server 2016, SLAT has now become necessary for Windows Server installations; as mentioned earlier, SLAT was required for client OS starting with Windows 8 onwards. Hyper-V uses this to perform more VM-memory-management functions and reduce the overhead of translating guest physical addresses to real physical addresses. By doing this, Hypervisor CPU time is significantly reduced and more memory is saved for each VM.

The processor, with SLAT capability, has a Translation Lookaside Buffer (TLB) that supports virtual to physical memory address translation. A TLB is a cache on the processor that contains recently used mappings from the page table. When a virtual to physical address translation is required, the TLB checks its cache to determine whether or not it contains the mapping information. If TLB contains a match, the physical memory address is provided and the data is accessed. If TLB doesn't contain a record, a page error occurs and the Windows checks the page table for the mapping information. If Windows finds a mapping, it is written to the TLB, the address translation takes place and then the data is accessed. However, the Hypervisors overhead gets substantially decreased due to this buffer.

See also

Appendix A, Hyper-V Architecture and Components

Enabling the Hyper-V role

By default, Windows Server does not come with Hyper-V installed. In order to start using the virtual environment, Hyper-V needs to be enabled. Even with its straightforward steps, it is important to understand how it works after the set up and what has changed in the Windows architecture.

Getting ready

There are different methods to install Hyper-V. The most common one is through the graphical interface. To get ready to enable Hyper-V you must be logged on with administrative privileges.

How to do it...

The following steps will demonstrate how to enable the Hyper-V Role for Windows Server and what has changed in the Windows architecture after its installation:

On the Start Screen select Server Manager.In the Server Manager Dashboard, click on Add roles and features.In the Add Roles and Feature Wizard, click on Next thrice.On the next screen, Server Roles page, select Hyper-V, as shown in the next screenshot and click on Next thrice.In the Features window, click on Next.In the Virtual Switches window, select the network adapter you want to use on Hyper-V, as shown in the next screenshot. You can add, remove, and modify the virtual switches after the Hyper-V installation through Hyper-V Manager.On the Virtual Machine Migration page, check the Allow this server to send and receive live migration of virtual machines option if you want to enable live migration requests, as shown in the next screenshot. Do not enable live migration if this server is going to be a part of a Hyper-V cluster; click on Next:The last Hyper-V installation page called Default Stores and specified the default location for virtual disks and virtual machine configuration files. It's very important to change the default path, from C:\ to a dedicated drive as shown in the next screenshot, otherwise your virtual machines will end up being installed on C:\ drive. Click on Next, confirm the installation selections, and then click on Install to start the installation process:Reboot the server after the installation.

How it works...

The process that you have performed to install Hyper-V is quite simple, but it changes the processor architecture by creating a new privileged layer called ring-1 that runs under the normal layers. The setup process, completed in the previous task, installs the Microsoft Hypervisor on this layer to make sure that Hyper-V has more privileges than Windows itself. Basically, the host operating system runs above the Hypervisor together and at the same level as the virtual machines. The host turns into a special virtual machine containing the virtualization stack, responsible for managing all the virtual machines from it. The following diagram illustrates Hyper-V high-level architecture being installed in ring-1 and all the partitions running above it.

After the first reboot, the Windows boot (winload.exe) loads the driver (hvboot.sys) responsible for verifying the processor that is running and if it supports virtualization. Then the Hypervisor image file is loaded. The host OS and the virtual machines are called partitions because they run at the same privileged access above the Hypervisor. The host OS is known as root or parent partition and the virtual machines are known as child partitions.

There's more...

For automation and fast installation, you can enable Hyper-V using command lines. You can do that using the command line ocsetup, Servermanagercmd, or Windows PowerShell.

Installing Hyper-V using Windows PowerShell

For a PowerShell installation, open Windows PowerShell and run the following command:

Install-WindowsFeature Hyper-V -IncludeAllSubFeature -IncludeManagementTools -Restart

See also

The Creating and managing virtual switches recipe in Chapter 3, Managing Disk and Network SettingsAppendix A, Hyper-V Architecture and Components