understanding hyperv in windows server 2012

391 312 0
understanding hyperv in windows server 2012

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Hands-on Guide: Understanding  Hyper-V  in Windows Server 2012 Brien Posey Pete Zerger, Chris Henley Understanding Hyper-V in Windows Server 2012 Contents Chapter An Introduction to Hyper-V 3.0 Chapter Failover Clustering 30 Chapter Migrations 84 Chapter Managing Virtual Machine Failover 123 Chapter PowerShell Management 144 Chapter Virtual Machine Management 181 Chapter P2V Conversions 222 Chapter Replication 246 Chapter Hyper-V Management 273 Chapter 10 Networking 293 Chapter 11 Backing up Hyper-V 317 Chapter 12 Automation and Orchestration 336 Share this e-book with your peers Understanding Hyper-V in Windows Server 2012 Chapter An Introduction to Hyper-V 3.0 This chapter is designed to get you started quickly with Hyper-V 3.0 It starts with a discussion of the hardware requirements for Hyper-V 3.0 and then explains a basic Hyper-V–deployment followed by an upgrade from Hyper-V 2.0 to Hyper-V 3.0 The chapter concludes with a demonstration of migrating virtual machines from Hyper-V 2.0 to Hyper-V 3.0 Understanding Hyper-V in Windows Server 2012 Hyper-V 3.0 flavors Before we get started, it is worth noting that like its predecessors, Hyper-V 3.0 comes in two different flavors Microsoft offers a standalone version of Hyper-V, or you can operate Hyper-V as a server role on top of Windows Server 2012 This book deals with Hyper-V exclusively as a server role Hardware requirements According to Microsoft, the minimum hardware required for deploying Windows Server 2012 includes: • A 64-bit processor operating at 1.4 GHz or higher • 512 MB of RAM • 32 GB of hard disk space • A DVD Drive • A monitor and video card with a minimum display resolution of 800 x 600 • Keyboard and mouse (or other compatible pointing device) • Internet access Because Hyper-V is designed to use the server’s hardware to host a number of virtual machines, the minimum system requirements are not suitable for Hyper-V Specifically, you will need more memory and hard disk space, and it’s advisable to have a server with multiple sockets and/or multiple CPU cores The servers used in the development of this book were equipped with the following: • An 8-core, 64-bit CPU • 32 GB of RAM • A 500-GB hard drive used to store the host operating system • Four 1-TB hard drives configured as a RAID array In addition to the hardware requirements listed above, the CPU must support hardware-level virtualization It is worth noting that virtualization has been disabled by default on many servers, so you may need to enable virtualization through the system BIOS, as shown in Figure 1.1 If your server’s BIOS contains a setting for Data Execution Prevention (DEP), you will need to enable that setting as well Understanding Hyper-V in Windows Server 2012 Figure 1.1 You may need to manually enable virtualization in the server’s BIOS Installing Windows Server 2012 and Hyper-V 3.0 Setting up a clean installation of Windows Server 2012 and Hyper-V 3.0 is relatively simple and straightforward First, install Windows Server 2012 by completing these steps: Boot your server from the Windows Server 2012 installation media When the Windows Server 2012 splash screen launches, verify that the language, time and currency format, and keyboard or input methods are correct (Figure 1.2) Figure 1.2 Verify your installation preferences Understanding Hyper-V in Windows Server 2012 Click Next Click Install Now (Figure 1.3) Figure 1.3 Click Install Now Choose the operating system that you want to install (Figure 1.4) It is worth noting that a default Windows Server 2012 does not include the GUI If you want to use the GUI then not choose the Server Core option Although Server Core is Microsoft’s preferred method for deploying Windows Server 2012, it is easier to manage Hyper-V through a GUI Therefore, the instructions found throughout this book will assume that you are using the GUI If you are interested in Server Core deployments, see Chapter for a discussion about managing Hyper-V through Windows PowerShell Figure 1.4 Choose the edition of Windows Server 2012 that you want to install Understanding Hyper-V in Windows Server 2012 Accept the license agreement and click Next (Figure 1.5) Figure 1.5 You must accept Microsoft’s license agreement When prompted for the type of installation you want to perform, choose the option for Custom: Install Windows Only (advanced) (Figure 1.6) Figure 1.6 Choose the option to perform a custom installation Choose the volume on which you want to install Windows and click Next (Figure 1.7) Understanding Hyper-V in Windows Server 2012 Figure 1.7 Select the drive or volume on which you want to install Windows Server 2012 Setup will now begin the installation process (Figure 1.8) After the Windows installation completes , you must work through a separate process to install Hyper-V Figure 1.8 The installation process will now begin Deploying Hyper-V 3.0 After Windows Server 2012 is up and running, the next step is to install the Hyper-V role To so, follow these steps: Open the Server Manager if it is not already open Choose the Add Roles and Features command from the Manage menu (Figure 1.9) Understanding Hyper-V in Windows Server 2012 Figure 1.9 Choose the Add Roles and Features command When the Add Roles and Features Wizard launches, click Next to bypass the wizard’s Welcome screen Click Next Choose the Role-Based or Feature-Based Installation option (Figure 1.10) Figure 1.10 Choose the Role Based or Feature Based Installation option Click Next On the Server Selection screen, make sure that the local server is selected and click Next (Figure 1.11) Understanding Hyper-V in Windows Server 2012 Figure 1.11 Make sure that your local server is selected Select Hyper-V from the list of server roles (Figure 1.12) Figure 1.12 Select the Hyper-V role If you are prompted to install additional features, click the Add Features button 10 Click Next 10 Understanding Hyper-V in Windows Server 2012 Configuring service templates Service templates are authored in the new Service Designer within VMM The VMs are defined within the Service Designer with settings such as tiers, applications, OS settings, networking requirements and Load Balancers, which today include BigIP F5, NetScaler and Windows Server NLB Service templates are not fire-and-forget objects; they are always linked with the deployed service, and the template can be used to update deployed services Typically when you are creating a service template, deployment-specific information like hosts and load balancers is not available—you just know you need a host for the VM or a load balancer for the service While it is outside the scope of this book, it is worth noting that service templates in VMM 2012 SP1 can be configured to deploy the service instance not only to Hyper-V on Windows Server 2012, but also many of the most recent versions of VMware, including vSphere 5.0 and 5.1 A look at the Service Designer The Service Designer presents a simple drag-and-drop interface When a service is first created, the author selects a basic framework (e.g., number of tiers, whether or not a load balancer is required, etc.) for the service The template is then filled in using objects from the library palette The Ribbon at the top provides the list of actions that can be performed in the Designer In the Designer Canvas shown in the next figure, you are looking at the service template for a StockTrader service that has four tiers—Web Tier, two business logic Middle Tiers and SQL Tier All the tiers are connected to a logical network called Redmond The Details pane at the bottom provides the property settings for the selected object in the canvas Figure 12.66 – VMM 2012 Service Designer Interface 377 Understanding Hyper-V in Windows Server 2012 Service template components With System Center 2012 VMM, the service template provides a new way to model a service Service templates contain the definitions for VMs, their connectivity, application definitions, and they are the starting point for a VM or a service Service templates have the following components: Service template: The service template itself, consisting of one or more computer tiers You can configure additional settings, such as deployment order and servicing order (if the template contains multiple computer tiers) to control the order of operations during deployment and VM servicing after deployment Computer tier: A computer tier (also called a machine tier) consists of exactly one VM template There can be one or more computer tiers Computer tiers can also be configured with minimum, maximum and default scale-out settings These determine the minimum, maximum and default number of VMs hosted in the tier for use in deployment and capacity-related scale-out and scale-in operations VM templates: • VM templates contain Hardware Profile, Guest OS Profile and reference to a VHD in the library • In the Guest OS profile, you can define what Roles/Features need to be installed • VM templates have one application profile, which in turn has one or more application deployments – WebDeploy, SQL DAC or Server App-V packages Application deployments always have references to the application bits in the library • VM templates can also contain a SQL profile, for installing a SQL server instance in a VHD that contains a Sysprep instance of SQL 2008 R2 This consists of one or more SQL deployments that can have SQL scripts and library resources for the SQL scripts Generic command executions: Custom EXEs can run during application deployment Examples might be installing a MSI package or enabling firewall rules Load balancer templates: Load balancer templates can be setup for each computer tier that needs to be scaled out Application host template: In an enterprise environment it is typical that SQL databases are deployed to existing physical SQL servers To support this scenario, service templates can contain one or more host profiles for deploying SQL DAC packages to existing physical servers Global settings: Any settings that need to be overridden as a part of service deployment are available at the service template level as service settings 378 Understanding Hyper-V in Windows Server 2012 Creating a service template Creating a basic service template is a relatively simple, wizard-driven process in the VMM Administrator Console Begin by opening the console and selecting the Library workspace Next, right-click the Service Templates node in the navigation (left) pane of the runbook and select Create Service Template as shown in Figure 12.67 to launch the New Service Template wizard Figure 12.67 – Launching the New Service Template wizard On the New Service Template screen, enter a name for your template in the spaces provided This example uses the name ‘WebApp Service’ with a release of 1.0, as shown in Figure 12.68 Figure 12.68 – Choosing a service template pattern Click OK to open the service template in the Service Designer interface described earlier in this chapter and shown in Figure 12.69 379 Understanding Hyper-V in Windows Server 2012 Figure 12.69 – The Service Template Designer interface In the navigation (left) pane, find the VM template you created earlier and drag it onto the machine tier box in the palette of the Service Designer interface (also shown in Figure 12.69) When you select the machine tier in Service Designer, the tier settings will be shown at the bottom of the designer interface, as shown in Figure 12.70 Figure 12.70 – Machine tier settings presented in the Template Designer To configure the advanced settings of the machine tier, double-click on the machine tier to open its Properties, as shown in Figure 12.71 On the General tab, select the checkbox labelled This computer tier can be scaled out Set the Maximum instance count to 380 Understanding Hyper-V in Windows Server 2012 Figure 12.71 – General settings in Tier Properties On the Hardware Configuration tab, make sure that your VM template in the machine tier has network connectivity as shown in Figure 12.72 VM templates within service templates that are not connected cannot be deployed • Also in the network properties, make sure the Dynamic IP or Static IP radio button is configured If you not have a DHCP server in your environment, you will need to configure a static pool of IP Addresses, as described on the Microsoft TechNet site here Figure 12.72 – Hardware Configuration settings in settings in Tier Properties 381 Understanding Hyper-V in Windows Server 2012 On the OS Configuration tab, make any changes to the OS configuration of your VM template (embedded in this service template) Don’t move on to the next tab yet, as there are some additional settings to explore that will enable advanced deployment capabilities available only within service templates Figure 12.73 – OS Configuration settings in Tier Properties While still on the OS Configuration tab, under the Roles and Features heading, select Roles as shown in Figure 12.74 For this example, select the following roles and role services: Web Server (IIS), IIS Management Console, Web Server, Application Deployment (and all children), Common HTTP Features (and all children) and finally, Health and Diagnostics (and all children) Figure 12.74 – Choosing OS Roles for installation in Tier Properties 382 Understanding Hyper-V in Windows Server 2012 Under Roles and Features, next select the Features node as shown in Figure 12.75 Select Background Intelligent Transfer Service (BITS) Figure 12.75 – Choosing OS Features in Tier Properties 10 Moving on to the Application Configuration tab, you will see the area where application first-class deployment and GCEs (remember these?) can be configured Figure 12.76 – Application Configuration settings in Tier Properties 11 On the SQL Server Configuration tab, you can configure the settings for a Sysprep SQL instance inside your VM template In this case you don’t have a Sysprep instance, so leave the defaults and continue to the next tab Figure 12.77 – SQL Server Configuration settings in Tier Properties 383 Understanding Hyper-V in Windows Server 2012 Note: Although the Application Configuration and SQL Server Configuration tabs appear even in VM templates, these additional configuration features are only functional inside service templates! 12 On the Custom Properties tab, you can add custom fields—name/value pairs that can be used to store values for any of your custom automation, integration or reporting needs Accept the defaults and move on to the next tab 13 On the Settings tab, you can configure quota points 14 On the Dependencies tab, you will see listed any components this service template requires (e.g., VM templates, OS, hardware and application profiles) 15 With your service template configuration now complete, click the View Script button to view the PowerShell script (created by this wizard), which will be run to complete the request (if desired), and then click OK 16 Once you’ve configured all the settings in your template, click Save and Validate on the ribbon to ensure the template is configured correctly, as shown in figure 12.78 Figure 12.78 – Save and Validate service template settings If there are any isssues with your service template, the issues will be detailed at the bottom of the Service Designer, as shown in Figure 12.79 If any issues appear, read the explanation provided and make corrections to the settings in your service template as required and click Save and Validate once again Figure 12.79 – Issues detected in validation of service template configuration Congratulations, your service template is complete! Next, you will try to deploy a service instance to your Hyper-V server 384 Understanding Hyper-V in Windows Server 2012 Deploying a service instance Now that you have a service template in place in your VMM instance, it’s time to deploy your first service to Hyper-V After a service template has been created or imported into VMM, it can be deployed either through VMM itself, from Orchestrator (if you create a runbook to so), the VMM Self-Service Portal or some other service (for example, System Center 2012 App Controller or Service Manager) As part of the deployment, you can customize computer names, configure passwords or update other instance-specific settings If the application requires specific settings, for example a SQL connection string, you can supply this at deploy time as well In addition, you can allow the same service template to be deployed into different environments—for example, development and production Simply use the Import and Export wizards in the Library workspace of the VMM Administration Console (see more on importing and exporting service templates here) Service deployment behind-the-scenes: The basic deployment steps carried out by VMM are as follows: • Machine tiers are deployed based on the defined deployment order • VMs are created, powered on, and OS profile settings applied, such as joining the VM to a domain, etc • The VMM Guest agent is installed into the VM—the VMM Guest Agent allows application installation within the VM • Optional pre-installation GCE are run • Applications are installed • Optional post-installation GCE are run • If applicable, the VM is added to a load balancer In the Library workspace, select the Service Templates node and then the service template you created previously Click the Configure Deployment button on the ribbon (Figure 12.80) The Create Service screen opens Figure 12.80 – Configuring deployment of a new service instance In the Create Service window, click the Browse button and select the service template you just created from the window provided, as shown in Figure 12.81 385 Understanding Hyper-V in Windows Server 2012 Provide a descriptive name for your service in the box provided, select the host group containing your Hyper-V server in the Destination drop‑down list and click OK, also shown in Figure 12.81 Figure 12.81 - Assigning Service Name and Deployment Location This opens the Deployment Preview shown in Figure 12.82 Here you can change service settings (e.g., VM name, administrator password) After making any necessary adjustments, click Refresh Preview in the ribbon to refresh recommended placement settings Note: If you have multiple Hyper-V servers, the placement recommendation is made automatically by the Intelligent Placement feature in VMM Read more about this feature on the Microsoft TechNet site here Figure 12.82 – Viewing VMM Hyper-V host placement recommendations Finally, click Deploy Service on the ribbon of the Deployment Preview window to deploy your service 386 Understanding Hyper-V in Windows Server 2012 Figure 12.83 – The Deploy Service button (on the ribbon) You’ll be prompted one last time with a Deploy service pop-up, where you will have the opportunity to view the PowerShell (created by this wizard), which will be used to deploy your service Click Deploy to initiate the service deployment Figure 12.84 – Final deployment confirmation and the View Script button Navigate to the VMs and Services workspace of your VMM Administrator Console, where your service instance should appear almost instantly, reflecting a status of “Deploying” while the deployment is in progress Figure 12.85 – Service instance deployment in progress 387 Understanding Hyper-V in Windows Server 2012 If you would like to view the progress of your service deployment at a more granular level of detail, navigate to the Jobs workspace and look for a job in progress named “Create Service Instance.” Figure 12.86 – Service instance deployment job details Congratulations! When the job completes successfully, you will have successfully deployed your first service While this was just a basic example, it provides you with a base of knowledge that will help you progress to more advanced Hyper-V deployment scenarios Hyper-V self-service deployment While a deep dive into virtualization self-service is beyond the scope of this book, you will no doubt be interested in how to make all of the deployment and servicing capabilities you’ve learned accessible to the end users in your organization Fortunately, Microsoft provides a number of options based on your deployment needs The capabilities, pros and cons of each option are described here VMM 2012 Self-Service Portal The VMM self-service portal has been around in previous versions, but receives little attention in conversations around Windows Server 2012 Hyper-V and System Center 2012 Intended to be a departmental solution for self‑service in test and development environments, VMM lacks the features of some of the other self-service portal options offered by Microsoft, with no support for multi-tenancy, Orchestrator runbooks or visibility into the latest features of VMM templates Orchestrator Web Console The Orchestrator Web Console, which you have you seen in this chapter, does enable deployment of Hyper-V guests via Orchestrator runbooks communicating with VMM 2012, but with a minimal interface There is no validation of user input nor management capability beyond what is provided in runbooks that you author As a result, this interface receives little attention in discussions related to virtualization self-service 388 Understanding Hyper-V in Windows Server 2012 System Center 2012 App Controller App Controller is a Silverlight-based web portal that provides a common self‑service experience that can help you easily configure, deploy and manage VMs and services across private and public clouds App Controller is very lightweight and quick to deploy—just one of the reasons it is a popular self‑service portal for virtualization in private cloud and datacenter scenarios involving Hyper-V and System Center 2012 technologies Other advantages of App Controller include its native support for the new features in VMM, including service template and delegation of access and capacity (clouds and tenants) Additionally, App Controller supports deployment of Hyper-V hosts in Windows Azure, providing access to both private cloud and public cloud resources in a single pane of glass The primary cons to using App Controller for self-service are its lack of extensibility in customizing the portal interface, as well as a lack of integration with service desk solutions, resulting in a change management challenge for some organizations System Center 2012 Service Manager Self-Service Portal System Center 2012 Service Manager (SCSM) is the service desk solution from Microsoft, not only providing integration with VMM, Orchestrator and other System Center components, but also a highly customizable and extensible self‑service portal SCSM supports integration of Orchestrator runbooks into service offerings presented in a central Service Catalog, as well as robust approval and notification workflow capabilities Because SCSM hosts the CMDB, integration with incident, service and change management is automatic For organizations wishing to implement an extensible, enterprise virtualization self-service strategy, SCSM is the most robust option You should now have a better picture of the key components utilized in Hyper-V management and automation in the enterprise Share this e-book with your peers 389 Understanding Hyper-V in Windows Server 2012 About the Author Brien Posey is a freelance technical writer who has received Microsoft's MVP award times for his work with Exchange Server, Windows Server, IIS, and File Systems Storage Brien has written or contributed to about three dozen books, and has written well over 4,000 technical articles and white papers for a variety of printed publications and Web sites In addition to his writing, Brien routinely speaks at IT conferences and is involved in a wide variety of other technology related projects About Veeam Software Veeam® Software develops innovative solutions for VMware backup, Hyper-V backup, and virtualization management Veeam Backup & Replication™ is the #1 VM Backup solution Veeam ONE™ is a single solution for real‑time monitoring, resource optimization, documentation and management reporting for VMware and Hyper-V Veeam extends deep VMware monitoring to Microsoft System Center with Veeam Management Pack™ (MP), and to HP Operations Manager with Veeam Smart Plug-In™ (SPI) Veeam also provides free virtualization tools Learn more by visiting www.veeam.com Share this e-book with your peers 390 Understanding Hyper-V in Windows Server 2012 Modern Data Protection Built for Virtualization Powerful Easy-to-Use Veeam Backup & Replication #1 VM Backup for VMware and Hyper-V Virtualization changes everything – especially backup If you’ve virtualized on VMware or Hyper-V, now is the time to move up to the data protection solution Built for Virtualization: Veeam Backup & Replication Unlike traditional backup that suffers from the “3C” problem (missing capabilities, complexity and cost), Veeam is:  Powerful: Restore an entire virtual machine (VM) or an individual file, email or database record in minutes  Easy-to-Use: It just works!  Affordable: No agents to license or maintain, works with your existing storage, and includes deduplication, VM replication, Microsoft Exchange recovery, and more! Join the 58,000 organizations who have already modernized their data protection with Veeam Download Veeam Backup & Replication today! GOLD AWARD NEW TECHNOLOGY GOLD AWARD NEW TECHNOLOGY To learn more, visit http://www.veeam.com/backup 391 [...]... continuing (Figure 1.20) 16 Understanding Hyper-V in Windows Server 2012 Figure 1.20 You must shut down the virtual machines prior to beginning the upgrade 2 With Windows Server 2008 R2 still running, insert your Windows Server 2012 installation media and run the Setup program 3 When the Windows Server 2012 splash screen appears, click Install Now (Figure 1.21) Figure 1.21 Click the Install Now button 4 When... message indicating that you must restart your computer to apply the new name 6 Click Close 7 When prompted, click Restart Now (Figure 1.19) Figure 1.19 You must restart the server before your changes will take effect 15 Understanding Hyper-V in Windows Server 2012 Join the host to a domain The process of joining a Windows Server 2012 host to a domain is very similar to that used in joining a Windows Server. .. both methods In addition, you will learn how to provision storage using a new Windows Server 2012 feature called Windows Storage Spaces 30 Understanding Hyper-V in Windows Server 2012 Perhaps the most important concept to understand with regard to server virtualization is that of clustering The reason for this is simple: Server virtualization places an increased importance on server hardware In a traditional... assumes that you have installed Windows Server 2012 onto each cluster node, joined the cluster nodes to an Active Directory domain, and provisioned each node with an appropriate computer name and the necessary IP addresses 33 Understanding Hyper-V in Windows Server 2012 Installing the failover clustering feature The first step in the configuration process is to install the Failover Clustering feature onto... cannot perform an in- place upgrade of a full Windows Server deployment (with a GUI) to a server core deployment If you want a server core deployment, you will have to upgrade to the full GUI version of Windows Server 2012 and then uninstall the GUI later The instructions provided in this book assume that you will be working with a full GUI-based installation If you are interested in using Server Core, see... that is not entirely intuitive Microsoft’s preferred method for performing a cluster upgrade involves building an entirely new cluster The basic idea is to create a cluster out of servers that are running Windows Server 2012 If you lack the budget to build a completely new 26 Understanding Hyper-V in Windows Server 2012 cluster, you can start small by building the new cluster with a minimum number of cluster... properties sheet appears, click on the Change Settings link (Figure 1.16) 13 Understanding Hyper-V in Windows Server 2012 Figure 1.16 Click the Change Settings link 3 Verify that the Computer Name tab is selected and then click the Change button (Figure 1.17) Figure 1.17 Click the Change button 14 Understanding Hyper-V in Windows Server 2012 4 Enter a new name for the server and click OK (Figure 1.18) Figure... option to go online to install updates (Figure 1.22) 17 Understanding Hyper-V in Windows Server 2012 Figure 1.22 You should go online to get the latest updates 5 Enter your product key and click Next 6 Select whether you want to perform a server core deployment or a fullserver deployment that includes the GUI (Figure 1.23) It is worth noting that Windows Server 2012 is designed to perform a server core... virtual machines (Figure 1.36) 27 Understanding Hyper-V in Windows Server 2012 Figure 1.36 Enter the name of your Hyper-V 2.0 cluster 4 Select the virtual machines that you plan to migrate and click Next (Figure 1.37) Figure 1.37 Choose the virtual machines that you want to migrate 28 Understanding Hyper-V in Windows Server 2012 5 Choose the Virtual Network Switch that the virtual machines should use... of Windows Server 2012 that you want to install 18 Understanding Hyper-V in Windows Server 2012 7 Click Next 8 When prompted, accept the license agreement and click Next (Figure 1.24) Figure 1.24 You must accept Microsoft’s license agreement 9 Choose the option to Upgrade: Install Windows and keep files, settings, and applications (Figure 1.25) Figure 1.25 Choose the option to upgrade the existing

Ngày đăng: 05/05/2016, 10:53

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan