cover

Windows Server® 2012 Hyper-V® Installation and Configuration Guide

Aidan Finn

Patrick Lownds

Michel Luescher

Damian Flynn

titlepage

Acquisitions Editor: Mariann Barsolo

Development Editor: David Clark

Technical Editor: Hans Vredevoort

Production Editor: Eric Charbonneau

Copy Editor: Sharon Wilkey

Editorial Manager: Pete Gaughan

Production Manager: Tim Tate

Vice President and Executive Group Publisher: Richard Swadley

Vice President and Publisher: Neil Edde

Book Designers: Judy Fung and Maureen Forys, Happenstance Type-O-Rama

Compositor: Cody Gates, Happenstance Type-O-Rama

Proofreader: Rebecca Rider

Indexer: Ted Laux

Project Coordinator, Cover: Katherine Crocker

Cover Designer: Ryan Sneed

Cover Image: © Michael Knight / iStockphoto

Dear Reader,

Thank you for choosing Windows Server 2012 Hyper-V Installation and Configuration Guide. This book is part of a family of premium-quality Sybex books, all of which are written by outstanding authors who combine practical experience with a gift for teaching.

Sybex was founded in 1976. More than 30 years later, we’re still committed to producing consistently exceptional books. With each of our titles, we’re working hard to set a new standard for the industry. From the paper we print on to the authors we work with, our goal is to bring you the best books available.

I hope you see all that reflected in these pages. I’d be very interested to hear your comments and get your feedback on how we’re doing. Feel free to let me know what you think about this or any other Sybex book by sending me an email at nedde@wiley.com. If you think you’ve found a technical error in this book, please visit http://sybex.custhelp.com. Customer feedback is critical to our efforts at Sybex.

Best regards,

edde_sig.tif

Neil Edde

Vice President and Publisher

Sybex, an Imprint of Wiley

To my family and friends, who have made this possible by helping and supporting me over the years. —Aidan Finn

I would like to dedicate this book to my family, friends, colleagues, and most of all to my wife, Lisa, and our precious children. —Patrick Lownds

For my family, friends, and colleagues who have been supporting and inspiring me all the time. —Michel Luescher

This book is dedicated to my brilliant and beautiful wife, Breege. She has been my inspiration, my motivation, and my rock. —Damian Flynn

Acknowledgments

When I first thought about writing this book back in 2011, I thought it might be something that I could do alone over a short period. But then we started to learn how much had changed in Windows Server 2012, and how much bigger Hyper-V had become. I knew that I would need a team of experts to work with on this project. Patrick Lownds, Michel Luescher, Damian Flynn, and Hans Vredevoort were the best people for the job. Luckily, they were willing to sign up for the months of hard work that would be required to learn this new version of Windows Server 2012 and Hyper-V, do the research, annoy the Microsoft project managers, and reach out to other members of the community. Thank you to my coauthors, Patrick, Michel, and Damian, for the hard work that you have done over the past few months; I have learned a lot from each of you during this endeavor. When it came to picking a technical reviewer, there was one unanimous choice, and that was Hans, a respected expert in Hyper-V and System Center. Hans’ name might not be on the cover, but his input can be found in every chapter. Thank you (again) Hans, for taking the time to minimize our mistakes.

Patrick, Damian, and Hans are Microsoft Most Valuable Professionals (MVPs) like myself. The MVP program is a network of experts in various technologies. There are many benefits to achieving this award from Microsoft, but one of the best is the opportunity to meet those experts. Many of these people helped with this project and you’ll see just some of their names in these acknowledgments.

Starting to write a book on a product that is still being developed is quite a challenge. There is little documentation, and the target keeps moving. Many people helped me during this endeavor. Who would think that a person who barely passed lower-grade English when he finished school could go on to have his name on the covers of five technical books? Mark Minasi (MVP) is the man I have to thank (or is it blame?) for getting me into writing books. Mark once again was there to help when I needed some information on BitLocker. Jeff Wouters, a consultant in the Netherlands, loves a PowerShell challenge. Jeff got a nice challenge when a PowerShell “noob” asked for help. Thanks to Jeff, I figured out some things and was able to give the reader some better real-world solutions to common problems. If you’re searching for information on Windows Server 2012 storage, there’s a good chance that you will come across Didier Van Hoye (aka Workinghardinit). Didier is a fellow Virtual Machine (Hyper-V) MVP and has been there to answer quick or complex questions. Brian Ehlert (MVP) is an important contributor on the TechNet Hyper-V forum and is an interesting person to talk to for alternative points of view. Brian helped me see the forest for the trees a number of times. We have a great Hyper-V MVP community in Europe; Carsten Rachfahl found some functionality that we weren’t aware of and helped us understand it. A new guy on the MVP scene is Thomas Maurer, and his blog posts were useful in understanding some features.

Thanks to the MVP program, we gain access to some of the people who make the products we work with and write about. Numerous Microsoft program managers answered questions or explained features to me. Ben Armstrong (aka the Virtual PC Guy) leads the way in Virtual Machine expertise, has answered many questions for us as a group, provides great information on his blog, and has been a huge resource for us. Thanks too to Senthil Rajaram for doing his best to explain 4K sector support to me; any mistakes here are mine! Charley Wen, John Howard, and Don Stanwyck all helped me come to grips with the massive amount of change in Windows Server networking. Joydeep Buragohain also provided me with great information on Windows Server Backup. We Hyper-V folks rely on Failover Clustering, and we also had great help from their program managers, with Rob Hindman and Elden Christensen leading the way. Thanks to all for your patience, and I hope I have reproduced your information correctly.

I would also like to thank MicroWarehouse, my employer, for the flexibility to allow me to work on projects like this book. The opportunity that I have to learn and to share in my job is quite unique. I work with some of the best customer-focused experts around, and I’ve learned quite a bit from them.

Of course, the book wouldn’t be possible at all without the Sybex team. This book kept growing, and there was a lot more work than originally estimated. Pete Gaughan, the acquisitions and developmental editor, David Clark, Eric Charbonneau, and a whole team of editors made this possible. In particular, I want to pay special thanks to Mariann Barsolo, who believed in this project from day 1, and made a huge effort to get things moving.

My family are the ones who made everything possible. Thank you to my mom, dad, and sister for the encouragement and help, in good times and bad. From the first moment, I was encouraged to learn, to question why and how, to think independently, and to eventually become a pain in the backside for some! Without my family, I would not be writing these acknowledgments.

—Aidan Finn

Third time lucky! It takes personal commitment and dedication to write a book, but it takes a lot of support as well. It would not be possible without help from family, friends, and colleagues. I would like to thank my wife, Lisa, for helping to keep everything together, and my children for being especially patient. A special thanks to the editors at Sybex for taking on this book project and for making the dream a reality; my coauthors, Aidan, Damian, and Michel; plus our technical reviewer, Hans. Finally, I would like to thank a number of people for helping me along the way: Ben Armstrong, Patrick Lang, Rob Hindman, Mallikarjun Chadalapaka, Subhasish Bhattacharya, Jose Barreto, and Allison Hope.

—Patrick Lownds

I never thought that I would write a book, as I’m not a big fan of reading books. But when Aidan and Patrick asked me in early 2012 if I would think about providing a few chapters on a Windows Server 2012 Hyper-V book, I couldn’t resist. Working with this excellent team of knowledgeable experts was a great experience that I didn’t want to miss, and it was also an honor to be part of it. Thank you guys for this great opportunity!

It was quite a challenge writing a book on a product that is still under development. Therefore, I would like to express my special thanks to the great people who took time out from their busy schedules to share their experience, discuss features, or give me very good advice for this book. A big thank you goes to the following people: Nigel Cain, Paul Despe, Ronny Frehner, Florian Frommherz, Michael Gray, Asaf Kuper, Thomas Roettinger, Cristian Edwards Sabathe, Jian Yan, and Joel Yoker.

Hans Vredevoort deserves a very special thanks for all the great feedback provided and the interesting discussions we had. Of course I also would like to thank the Sybex team for their support and patience. Even though I squirmed when I received your status mails telling me I missed another deadline, you helped me keep pushing to make this all happen.

And last but certainly not least, thanks a lot, Carmen, for supporting me with all my crazy ideas and projects. This all wouldn’t be possible without you.

—Michel Luescher

During the process of writing my first book, I promised myself that I would never do it again. So, what changed? As the project progressed, and the products continued to be revised through their release milestones, somewhere along the path to publishing the challenge of writing also changed to become enjoyable. When Aidan then suggested the idea for this book while we were walking around Seattle one cold night in February, I was surprised to hear myself agreeing to the idea and feeling the excitement of being involved! It was not many weeks after that when we had the pleasure of meeting our representative from Sybex in Las Vegas to sell the plan; thanks to Aidan we were on a roll.

Collecting, selecting, and validating all the details that goes into the chapters of a technical book clearly requires a lot of input from many different people, especially respected experts and co-authors, Aidan, Patrick, and Michel, with whom it has been an honor working alongside. Our technical editor, Hans, deserves a very special consideration. It was his job to read our work in its earliest format, dissect our content to ensure its accuracy, and create labs to reproduce our implementation guides and recommendations. This was no minor achievement, yet he continued to excel at finding and squashing the bugs, and forcing us to rethink all the time. Thank you Hans.

In addition, a very special thanks to my work colleagues at Lionbridge, especially Oyvind, Steve, Benny, and the “Corp IT” Team for supporting and encouraging me, and my infamous “Lab.” I would also like to acknowledge the fantastic team at Microsoft, who has, over the years, put up with my “constructive” criticism (of products) and helped me out of many complex road blocks, especially Pat Fetty, Nigel Cain, and Travis Wright. The reality is that there are many people who helped along the way, too many to list individually; I offer my sincere appreciation to you all.

I would like to thank my amazing wife for always providing direction to my life; my parents for their enduring support and encouragement; my family—immediate, extended, and acquired by marriage! Their constant support and belief in me are the best gifts they could ever give.

—Damian Flynn

About the Authors

Aidan Finn, MVP, has been working in IT since 1996. He is employed as the Technical Sales Lead by MicroWarehouse, a distributor (and Microsoft Value Added Distributor) in Dublin, Ireland. In this role, he works with Microsoft partners in the Republic of Ireland and Northern Ireland, evangelizing Microsoft products such as Windows Server, Hyper-V, Windows client operating systems, Microsoft System Center, and cloud computing. Previously, Aidan worked as a consultant and administrator for the likes of Amdahl DMR, Fujitsu, Barclays, and Hypo Real Estate Bank International, where he dealt with large and complex IT infrastructures. Aidan has worked in the server hosting and outsourcing industry in Ireland, where he focused on server management, including VMware VI3, Hyper-V, and System Center.

Aidan was given the Microsoft Most Valuable Professional (MVP) award in 2008 in the Configuration Manager expertise. He switched to the Virtual Machine expertise in 2009 and has been renewed annually since then. Aidan has worked closely with Microsoft in Ireland and the United Kingdom, including presentations, road shows, online content, podcasts, and launch events. He has also worked in the community around the world, presenting at conferences and participating in podcasts.

When Aidan isn’t at work, he’s out and about with camera in hand, lying in a ditch, wading through a bog, or sitting in a hide, trying to be a wildlife photographer. Aidan was the lead author of Mastering Hyper-V Deployment (Sybex, 2010). He is one of the contributing authors of Microsoft Private Cloud Computing (Sybex, 2012), Mastering Windows Server 2008 R2 (Sybex, 2009), and Mastering Windows 7 Deployment (Sybex, 2011).

Aidan runs a blog at www.aidanfinn.com, where he covers Windows Server, Hyper-V, System Center, desktop management, and associated technologies. Aidan is also on Twitter as @joe_elway.

Patrick Lownds is a senior solution architect at Hewlett Packard’s TS Consulting, EMEA in the Data Center Consulting practice and is based out of London. Patrick is a current Virtual Machine Most Valuable Professional (MVP) and a Microsoft Virtual Technology Solution Professional (v-TSP). Patrick has worked in the IT industry since 1988 and has worked with a number of technologies, including Windows Server Hyper-V and System Center.

In his current role, he works mainly with the most recent versions of Windows Server and System Center and has participated in both the Windows Server 2012 and System Center 2012 SP1 Technology Adoption Programs.

Patrick has also contributed to Mastering Hyper-V Deployment (Sybex 2010) and Microsoft Private Cloud Computing (Sybex, 2012). He blogs and tweets in his spare time and can be found on Twitter as @patricklownds.

Michel Luescher is a senior consultant in the Consulting Services division at Microsoft Switzerland. Primarily, Michel is focused on datacenter architectures and works with Microsoft’s enterprise customers. In this role, he works mainly with the latest versions of Windows Server and System Center to build datacenter solutions, also known as the Microsoft private cloud. He joined Microsoft in January 2009 and has since been working very closely with the different divisions and communities, including several product groups at Microsoft. Michel has worked with Windows Server 2012 since the first release back in September 2011 and is involved in various rapid deployment programs (RDPs) and technology adoption programs (TAPs), helping Microsoft customers with the early adoption of the pre-released software.

Michel is a well-known virtualization and datacenter specialist and regularly presents at events. On his blog at www.server-talk.eu, Michel writes about Microsoft virtualization and private cloud. On Twitter you will find him as @michelluescher.

Damian Flynn, Cloud and Datacenter Management MVP, is an infrastructure architect at Lionbridge Technology, a Microsoft Gold Certified Partner. Damian, based in Ireland, is responsible for incubating new projects, architecting business infrastructure and services, and sharing knowledge, while leveraging his continuous active participation in multiple Microsoft TAPs with over 18 years IT experience. He blogs at www.damianflynn.com and tweets from time to time as @damian_flynn. He has published numerous technical articles, coauthored Microsoft Private Cloud Computing (Sybex, 2012), presented at various conferences including Microsoft TechEd, and contributes code on CodePlex.

Introduction

Windows Server 2012 Hyper-V brings something new to the market. Microsoft marketing materials claim that this release goes “beyond virtualization.” That might seem like hyperbole at first, but take some time to look at how you can change the way IT works by building a private, public, or hybrid cloud with Hyper-V as the engine of the compute cluster. Then you’ll understand how much work Microsoft put into this release.

The original release of Hyper-V was the butt of many jokes in the IT industry. The second release, Windows Server 2008 R2, brought respectability to Hyper-V, and combined with the System Center suite, was a unique offering. It was clear that Microsoft was focusing on service, not servers, recognizing what businesses value, and empowering IT staff to focus on engineering rather than on monotonous mouse-click engineering. Then came the Windows Server 2012 announcements at the Build conference in Anaheim, California, in 2011. Even Microsoft’s rivals were staggered by the scale of the improvements, choosing to believe that the final release would include just a fraction of them.

We now know that Microsoft took an entire year after the release of Windows Server 2008 R2 to talk to customers, gather requirements and desires, and plan the new release. They listened; pain points such as the lack of supported NIC teaming were added, difficulties with backup in Hyper-V clusters were fixed, and little niggles that caused administration annoyance had their corners rounded. More important, Microsoft had a vision: Windows Server 2012 would be “built from the cloud up” (another line from Microsoft’s marketing). This is the first hypervisor designed to be used in a cloud rather than trying to build wrappers around something that focuses on servers first. Many features were added and improved to enable a business to deploy a private cloud, or a service provider to build a flexible, secure, and measured multi-tenant public cloud. Much of this release is ready to go now, but Microsoft built for the future too, with support for emerging technologies and scalability that is not yet achievable in the real world.

Usually with a Microsoft release, you’ll hear headlines that make you think that the product is designed just for massive enterprises with hundreds of thousands of employees. Windows Server 2012 Hyper-V includes features that honestly are intended for the upper end of the market, but some of the headline features, such as SMB3.0 storage or Hyper-V Replica, were designed to deal with the complexities that small/medium enterprises have to deal with too.

This book is intended to be your reference for all things Windows Server 2012 Hyper-V. The book was written by three MVPs and a Microsoft consultant who give you their insight on this product. Every chapter aims to give you as much information as possible. Starting from the basics, each chapter will bring you through concepts, showing you how to use and configure features, and lead you to the most complex designs. Most chapters include scenarios that show you how to use Windows Server 2012 Hyper-V in production, in customer sites or your own.

PowerShell was added in Windows Server 2012, and you’ll find lots of PowerShell examples in this book. This was a deliberate strategy. Most IT pros who have not used PowerShell are scared of this administration and scripting language, because it is different from how they normally work. Pardon the pun, but it is powerful, enabling simple tasks to be completed more quickly, and enabling complex tasks (such as building a cluster) to be done with a mouse click. You don’t need to be a programmer to get to a point where you use PowerShell. None of this book’s authors are programmers, and we use the language to make our jobs easier. If you read this book, you will find yourself wanting to use and understand the examples, and hopefully you’ll start writing and sharing some scripts of your own.

The book starts with the basics, such as explaining why virtualization exists. It then moves through the foundations of Hyper-V that are common to small or large enterprises; gets into the fun, deep, technical complexities; and returns to common solutions once again, such as disaster recovery, backup, and virtual desktop infrastructure.

Who Should Read This Book

We are making certain assumptions regarding the reader here. You are

  • Experienced in working with IT
  • Familiar with terminology such as VLAN, LAN, and so on
  • Comfortable with installing Windows Server

This book is not intended to be read by a person starting out in the IT industry. You should be comfortable with the basics of server administration and engineering concepts.

The intended audience includes administrators, engineers, and consultants who are working, or starting to work, with virtualization. If you are a Hyper-V veteran, you should know that this release includes more new functionality than was in previous releases combined. If you have experience with another virtualization product, don’t assume that your knowledge transfers directly across; every hypervisor does things differently, and Windows Server 2012 Hyper-V includes functionality not yet seen in any of its rivals.

You don’t have to work for a Fortune 500 company to get value from this book. Let’s face it; that would be a rather small market for a publisher to sell to! This book is aimed at people working in all parts of the market. Whether you are a field engineer providing managed services to small businesses or an architect working for a huge corporation, we have something for you here. We’ll teach you the theory and then show you different ways to apply that knowledge.

What’s Inside

Here is a glance at what’s in each chapter:

  1. Chapter 1: Introducing Windows Server 2012 Hyper-V presents you with the newest version of Microsoft’s hypervisor. The chapter starts with a brief history of the evolution of IT, up to the present with virtualization, and introduces you to where businesses are going with cloud computing. The chapter also deals with the thorny issues of licensing Windows Server 2012 and licensing for various virtualization scenarios.
  2. Chapter 2: Deploying Hyper-V Hosts is where you will learn how to get Hyper-V up and running. This is the starting point for all deployments, large or small. The chapter also covers the host settings of Hyper-V.
  3. Chapter 3: Managing Virtual Machines is a long chapter where you will learn how to deploy and configure virtual machines by using the wizards and PowerShell. This chapter also discusses how Dynamic Memory works in Windows Server 2012 and the all new and bigger Live Migration.
  4. Chapter 4: Networking is the chapter that discusses how to connect the services in your virtual machines to a network. The chapter starts with the basics, such as how to create virtual switches, and understanding extensibility, and moves on to more-advanced topics such as supporting hardware offloads/enhancements, Quality of Service (QoS), and converged fabric design. This is also the chapter where you will find NIC teaming.
  5. Chapter 5: Cloud Computing is a logical extension of the Networking chapter, building on many of the concepts there to create clouds. You will learn about private VLANs (PVLANs), network virtualization, resource pools, and resource metering, which will give you all the components to start building the computer cluster of your very own cloud.
  6. Chapter 6: Microsoft iSCSI Software Targetwill be a popular subject for many readers. Windows Server 2012 has a built-in iSCSI target, allowing you to provide storage over the known and trusted storage protocol. Whether you are a small business that wants iSCSI storage on a budget, or you are building a lab where you need to simulate a SAN, this chapter will give you the material you need.
  7. Chapter 7: Using File Servers Storing your virtual machines on file shares is now supported. This is made possible thanks to technologies such as SMB Multichannel and SMB Direct, which, when combined, can match or even beat legacy storage protocols. You’ll learn how to use this new tier of storage, as well as how to build the new scalable and continuously available Scale-Out File Server architecture.
  8. Chapter 8: Building Hyper-V Clusters gives you the knowledge of how to build highly available Hyper-V virtualization or cloud infrastructures. You’ll learn about the architecture, the roles of the networks, and best practices for building these clusters. Other subjects include host maintenance and Cluster-Aware Updating.
  9. Chapter 9: Virtual SAN Storage and Guest Clustering reminds us that high availability is not limited to just hosts. The reason we have IT is to have services, and those services often require high availability. This chapter shows you how to build guest clusters, as well as how to take advantage of the new ability to virtualize Fibre Channel SANs.
  10. Chapter 10: Backup and Recovery covers this critical task for IT in any business. Virtualization should make this easier. This chapter discusses how the Volume Shadow Copy Service (VSS) works with Hyper-V virtual machines, and how Windows Server 2012 has improved to support better backup of highly available virtual machines, as well as virtual machines that are stored on SMB3 file shares. This chapter also shows you how small businesses and lab environments can use Windows Server Backup to back up running virtual machines with application consistency.
  11. Chapter 11: Disaster Recovery has great value to businesses. Being able to keep the business operating in the face of a disaster is something that all IT pros and businesses know should be done, but often has proven to be too difficult or expensive. This chapter discusses the theory of disaster recovery (DR) and business continuity planning (BCP), and how Hyper-V can make this achievable.
  12. Chapter 12: Hyper-V Replica is a feature that has gotten a lot of attention since it was first announced; this is built-in disaster recovery replication that is designed to scale for large clouds and to deal with the complexities of the small business. This chapter explains how Hyper-V Replica works, how to deploy it, how to survive a disaster, and how to get your business back to a production site afterward.
  13. Chapter 13: Using Hyper-V for Virtual Desktop Infrastructure gives you a free and scalable solution. Here you will learn how to engineer Hyper-V in this scenario and see how to deal with the unique demands of virtual machines that replace PCs instead of servers.

How to Contact the Authors

We welcome feedback from you about this book or about books you’d like to see from us in the future.

Aidan Finn can be reached by writing to blog@aidanfinn.com. For more information about his work, visit his website at www.aidanfinn.com. You can also follow Aidan on Twitter at @joe_elway.

Patrick Lownds can be contacted via email at Patrick_Lownds@hotmail.com, you can also follow him on Twitter at @PatrickLownds.

Michel can be contacted by mail at michel@server-talk.eu, on Twitter at @michelluescher. And for more information, read his blog at www.server-talk.eu.

Damian Flynn can be reached via email at hyperv@damianflynn.com, you can follow him on Twitter at @damian_flynn, and you can read his technology blog at www.damianflynn.com.

Sybex strives to keep you supplied with the latest tools and information you need for your work. Please check their website at www.sybex.com/go/winserver2012hypervguide, where we’ll post additional content and updates that supplement this book should the need arise.

Part 1
The Basics