You are on page 1of 20

Ten Essential Skills

for the Next Generation of Hyper-V


Brien M. Posey

Ten Essential Skills for the Next Generation of Hyper-V

Veeam Backup & Replication 6.5 More ways to WOW!


Veeam provides powerful, easy-to-use and affordable backup that fully leverages the virtual environment and eliminates the need foragents. Version 6.5 includes: Free e-discovery anditem recovery for Microsoft Exchange Easy VM recovery from SAN snapshots New hypervisor support: vSphere 5.1 andWindows Server 2012 Hyper-V 50+ other new features and enhancements

On the surface Hyper-V 3.0 really doesnt look all that different from its predecessors. Both Hyper-V 2.0 andHyper-V 3.0 are managed through theHyper-V Manager, which looks basically the same in every version of Hyper-V. Once you get past the management consoles cosmetics however, you begin to discover that Hyper-V 3.0 is indeed very different from previous versions of Microsofts hypervisor. Hyper-V 3.0 offers dozens of new features, and using those features means mastering new skills. As such, the purpose of this white paper is to familiarize you with ten of the most important tasks that you are likely to have to perform when you begin using Hyper-V 3.0.

External Live Migrations


In the previous version of Hyper-V, live migrations were a cluster level feature. A virtual machine could be live migrated from one cluster node to another. Although this ability still exists in Hyper-V 3.0, live migrations are no longer confined to a cluster. In fact, Hyper-V 3.0 lets you perform the following types of live migrations: cluster node to cluster node standalone hosts to standalone host standalone hosts to cluster node cluster node to standalone host cluster to cluster (this isnt actually listed as an option, but can be achieved using a combination of the options listed above) As you can see, there is a great deal of flexibility with regard to being able to move virtual machines between host servers. You can perform cluster level live migrations, or you can perform live migrations outside of a cluster. The reason why external live migrations are an essential skill to master is that they give you the ability to move virtual machines into and out of a clustered environment. Some administrators use this capability to establish an easy migration path between production and test environment. For instance, anew virtual machine might be initially deployed in a test cluster and then later migrated to a production cluster once testing on the new virtual machine has been completed. The exact method that you must use to perform an external migration varies depending on the type of migration that you are performing. If for example you want to migrate a virtual machine from a standalone host into a cluster, you can do so by following these steps (assuming that all of the servers belong to the same domain): 1. Open the Hyper-V Manager on the standalone server. Next, right click on the virtual machine and choose the Move command from the shortcut menu. When the Move Wizard opens, click Next to bypass the Welcome screen. On the following screen, select the Move the Virtual Machine option, as shown in Figure 1, and click Next.

Free Download

Ten Essential Skills for the Next Generation of Hyper-V

Figure 1

Choose the Move the Virtual Machine option and click Next.

2. When prompted, enter the name of one of the cluster nodes as thedestination host. Click Next and then choose the Move The Virtual Machines Data to aSingle Location option. 3. Assuming that you have already created a folder for the virtual machine on the cluster node you must enter the destination location folder. The folder must reside beneath the C:\ClusterStorage\ folder, as shown in Figure 2:
Figure 2

The virtual machine must be placed beneath the Cluster Storage folder.

Ten Essential Skills for the Next Generation of Hyper-V

4. If the cluster node does not contain a virtual switch with a name matching thevirtual switch that is currently in use then you will be asked to specify avirtual switch to be used. Make your selection and click Next. Finally, verify the summary information and click Finish. The virtual machine will now be live migrated to the cluster node. Keep in mind that this is just the first of two steps. The second step is to use the Fail Over Cluster Manager to make the virtual machine fault tolerant.

Migrating Virtual Machines from Hyper-V 2.0 to Hyper-V 3.0


If you are upgrading from Hyper-V 2.0 to Hyper-V 3.0 then you will need a way to move virtual machines from your existing virtualization infrastructure to theHyper-V 3.0 environment. If Hyper-V is running on top of Windows Server then you can perform an in place upgrade, which would theoretically keep you from having to worry about migrating individual virtual machines. However, things are often more complicated than they might seem. One of the big problems with performing an in place upgrade is that doing so causes the virtual machines that are running on the host that is being upgraded to be taken off-line until the upgrade is complete. Needless to say, the resulting downtime makes an in place upgrade impractical for many organizations. Another problem with performing an in place upgrade is that you cant perform an in place upgrade of a Hyper-V cluster. Instead, you will have to create abrand-new cluster and then migrate the virtual machines from theHyper-V 2.0 cluster to the Hyper-V 3.0 cluster. Obviously building an entirely new cluster can be expensive. One way to minimize the costs is to build a Hyper-V 3.0 cluster using low-end hardware and a minimal number of cluster nodes. After migrating all of the virtual machines from the old cluster to the new cluster you can remove host servers from the old cluster, install Windows Server 2012 and Hyper-V 3.0, and then join thehost servers to the new cluster. Once all of the host servers have been moved from the old cluster to the new cluster, you can remove thelowend hardware from the new cluster so that the cluster is running solely on production grade hardware. There are a lot of different options for migrating the virtual machines from aHyper-V 2.0 server to a Hyper-V 3.0 server. There are a number of third-party tools that can help with the migration process. Another technique that you can use is to back up your virtual machines and then restore them to the new cluster. Of course Microsoft also includes native tools in the Hyper-V manager for migrating virtual machines. Migrating virtual machines using native tools involves exporting the virtual machines from your Hyper-V 2.0 server and then importing them into your Hyper-V 3.0 server. You can export the virtual machines to either a network share or to removable media.

Ten Essential Skills for the Next Generation of Hyper-V

1. To export the virtual machines, open the Hyper-V Manager on theHyper-V 2.0 Server, select the virtual machines that you want to export, and then click on the Export link, as shown in Figure 3. Next, specify a path to write the exported content and then click theExportbutton.
Figure 3

Select the VMs that you want to export and then click the Export link.

2. When you are ready to import the virtual machines into the Hyper-V 3.0 server, open the Hyper-V Manager and then right click on the name of your Hyper-V host and select the Import Virtual Machine command from the resulting shortcut menu, as shown in Figure 4:
Figure 4

Right click on your host server and choose the Import Virtual Machine command from theshortcut menu.

Ten Essential Skills for the Next Generation of Hyper-V

3. When the Import Virtual Machine wizard appears, click Next to bypass thewizards Welcome screen. Click the Browse button and then navigate to the folder containing the virtual machine that you want to import and click theSelect Folder button. Choose the virtual machine that you want to import and then click Next. 4. At this point, Hyper-V will ask you to choose an import type. Unless you have a compelling reason to choose one of the other options, it is usually best to choose the Copy the Virtual Machine (Create a New Unique ID) option. This allows the exported VM to be re-imported in the future should the need everarise. 5. The next screen that you will see asks if you want to store any of thevirtual machine components in a different location. Generally it is safe to accept the defaults. Click Next and the wizard will now ask you where you want to store the imported virtual hard disks. Select a folder on anappropriate volume and click Next. Finally, verify the summary information screen andclick Finish.

Failover Prioritization
One of the fundamental truths about server virtualization is that a host server can only accommodate a finite number of virtual machines. The total number of virtual machines that can be running at any given moment is normally limited by the underlying physical hardware. The simple truth can lead to big problems for organizations that use failover clustering. When a host server fails the virtual machines that were previously running on the failed host are failed over to another host within the cluster. The problem is that the secondary cluster node may already be running virtual machines of its own. When the failure occurs the remaining cluster node may have to run its own workload plus the full workload of the failed server (depending on how many nodes are in the cluster). If the functional cluster node does not have sufficient hardware resources then not all of the virtual machines will be able to continue running. In most organizations there are some virtual machines that are more important than others. For example, you might have redundant virtualized domain controllers that are relatively unimportant. That being the case, Hyper-V 3.0 allows you to prioritize your virtual machines as a way of making sure that the most important virtual machines always receive the resources that they need in a failover situation. To set a virtual machines priority, open the Server Manager and then choose the Failover Cluster Manager command from the Tools menu. When theFailover Cluster Manager starts, select the Roles container. Right click on the virtual machine that you want to prioritize and then choose the Change Startup Priority command from the resulting shortcut menu, as shown in Figure 5. Now, simply specify the virtual machines priority.

Ten Essential Skills for the Next Generation of Hyper-V

Figure 5

VM startup priority is configured through the Failover Cluster Manager.

Monitoring Replication Health


Hyper-V 3.0 contains a new feature called replication. Replication can best be thought of as a low-budget alternative to clustering. Although replication does not offer all of the same capabilities as clustering, it does copy a virtual machine and any designated virtual hard drives to a replica server. The replica serves as a backup copy of the virtual machine. Virtual machine replicas can also be used to keep a virtualized workload online and available even if theserver hosting the primary copy of the virtual machine needs to be taken off-line for maintenance. For the most part the replication feature works really well. However, replicas can sometimes fall out of sync, so it is important to periodically verify thereplication health.

Ten Essential Skills for the Next Generation of Hyper-V

You can see a quick replication health summary by opening the Hyper-V Manager, selecting a virtual machine, and then looking at the Replication tab at the bottom of the screen, as shown in Figure 6:
Figure 6

The Replication tab provides a brief replication health summary.

If you need more detailed replication health information then right click on the virtual machine and choose the Replication | Replication Health commands from the shortcut menus, as shown in Figure 7. When you do, Hyper-V will display a comprehensive replication health report. You can view this report on screen or you can export the report as a CSV file using the Save As button.
Figure 7

The View Replication Health option provides a more comprehensive health report.

Ten Essential Skills for the Next Generation of Hyper-V

The most important thing to know about monitoring replication health is that regardless of which method you use to view the replication status, theinformation presented may be inconsistent from one replica to the next. The only way to get an accurate health assessment is to check the health status on each individual replica.

Fixing Replication Errors


As I mentioned in the previous section, the replication feature tends to work well but replicas can sometimes fall out of sync. Checking the replication health can help you to determine whether or not your virtual machine replicas are being properly synchronized, but a health check alone will not fix replication problems. If you are planning on using the Hyper-V replica feature then it is critically important for you to know how to correct synchronization problems when they occur. If you suspect a replication problem the first thing that you should do is to click the Reset Statistics button on the Replication Health dialog box that was discussed in the previous section. Hyper-V has a bad habit of displaying outdated errors and warning messages, so it is important to verify that theinformation that you are seeing is current. If after checking the most recent health information, you determine that replication has stopped then try right clicking on the virtual machine andchoosing the Replication | Resume Replication commands from theshortcut menus, as shown in Figure 8. This will restart the replication process and will usually fix the replication problem.
Figure 8

Manually resuming replication will usually correct the replication problem.

If using the Resume Replication command does not fix the problem then check to make sure that your servers have plenty of free disk space and that network connectivity still exists between the servers. Its also a good idea to check the servers event logs for any errors.

Ten Essential Skills for the Next Generation of Hyper-V

Creating a Virtual Machine Through PowerShell


The Hyper-V Manager is the primary tool for managing Hyper-V 3.0. It allows you to perform all but the most obscure management tasks through aneasy-to-use graphical user interface. Even so, Microsoft has publicly stated that Windows PowerShell is the preferred management tool for Windows Server 2012. That being the case, Hyper-V 3.0 can be fully managed through PowerShell. One of the most common management tasks then you might consider performing through PowerShell is that of creating a new virtual machine. Although virtual machines can be created using the Hyper-V Manager, PowerShell gives you far more flexibility. Using PowerShell scripts you can create multiple virtual machines simultaneously, and you can even create virtual machines on remote Hyper-V servers. Anyone who has ever worked with PowerShell knows that performing server management tasks any command line environment takes a little bit of getting used to. One of the best ways to get your feet wet is to start out by learning how to create a simple virtual machine. Creating a new virtual machine through PowerShell involves using the NewVM cmdlet. At a minimum you will need to specify the name for the new virtual machine, the virtual machine path, and the name of the host on which thevirtual machine will reside. For example, suppose that you wanted to create avirtual machine named PowerShellVM in the C:\VMs folder on a host named Lab1 (Figure 9). You could do so by entering the following command: New-VM Name PowerShellVM Path C:\VMs ComputerName Lab1 This command creates a virtual machine with the following specs: 512 MB of memory DVD drive No virtual hard disk No network connection 1 virtual processor You can see what the virtual machine creation process looks like in Figure 9:
Figure 9

New virtual machines can be created using the New-VM command.

10

Ten Essential Skills for the Next Generation of Hyper-V

Of course there are numerous PowerShell commands that you can use to gain total control over the virtual machine creation process. You can use PowerShell scripts to create virtual machines that meet your exact specifications.

Converting From VHD to VHDX


If you have ever worked with one of the previous versions of Hyper-V then you are no doubt familiar with the VHD virtual hard disk format. Although Hyper-V 3.0 does support the use of VHD-based virtual hard disks, Microsoft has introduced a new virtual hard disk format called VHDX. VHD based virtual hard disks have a maximum capacity of 2 TB, whereas VHDX based virtual hard disks can be up to 64 TB in size. The new virtual hard disk format doesnt just make it possible to create larger virtual hard disks, it also includes a number of new safeguards what work behind the scenes to protect the integrity of the virtual hard disks contents. VHD files could sometimes be corrupted by power failures. VHDX files are specifically designed to avoid thisproblem. If you are creating a brand new virtual machine on a Hyper-V 3.0 server then you should definitely use VHDX based virtual hard disks. However, if you are migrating to Hyper-V 3.0 from a previous version of Hyper-V then you probably have legacy virtual machines that use VHD based virtual hard disks. After completing such a migration, it is a good idea to convert the virtual machines virtual hard disks from VHD format to VHDX format. Converting a virtual hard disk to VHDX format is a simple process. Begin by opening the Hyper-V Manager, selecting a virtual machine, and then clicking the Edit Disk link. This will cause Windows to launch the Edit Virtual Hard Disk Wizard. Click Next to bypass the wizards Welcome screen and you will see a screen asking you to locate a virtual hard disk. Use the Browse button to locate thedisk that you want to convert and then click Next.

11

Ten Essential Skills for the Next Generation of Hyper-V

You will now see a screen that asks you what type of action you want to perform. Choose the Convert option and click Next. You will now see a screen that asks you to choose a disk format. Choose the VHDX option, as shown in Figure 10, and click Next:
Figure 10

You can convert a VHD based virtual hard disk to VHDX.

The following screen asks you if you want the VHDX disk to be of a fixed size orif you would prefer to create a dynamically expanding disk. Make your selection and click Next. Finally, provide a name and location for the new virtual hard disk and click Finish.

Storage Provisioning
Hyper-V is very flexible when it comes to storage provisioning. Larger organizations typically use SAN storage, but that is certainly not the only storage option. Smaller organizations for instance might opt to use local storage (direct attached storage) or even an SMB 3.0 file share. If you plan to use Direct Attached Storage or a USB 3.0 file share (residing on a server running Windows Server 2012) you will need to provision the storage before it can be used. In previous versions of Windows, this was accomplished using the Disk Management Console. Although the Disk Management Console still exists in Windows Server 2012, it is there solely for backward compatibility purposes. The preferred mechanism for provisioning storage is a new feature called Windows Storage Spaces.

12

Ten Essential Skills for the Next Generation of Hyper-V

The basic idea behind Windows Storage Spaces is that physical storage can be abstracted from logical storage by creating storage pools. A storage pool is acollection of physical disks. Virtual disks are created on top of storage pools, and Hyper-V can be configured to use these virtual disks. There are a couple of advantages to using this type of provisioning. For one thing, the virtual disks can be thinly provisioned. Physical disk space is only consumed as the virtual disks accumulate data. This is helpful because it is easier to create excessively large virtual hard disks up front than to initially create a small virtual hard disk and then try to expand it later on. If you later begin to run low on physical disk space, you can simply add additional disks to the storage pool. The first step in the process of configuring Windows Storage Spaces is to create a storage pool, which you can see in Figure 11:
Figure 11

A storage pool is a collection of physical disks.

A storage pool is a collection of physical disks that act as a pool of storage resources. You can create a storage pool by completing these steps: 1. Open the Server Manager and then click on the File and Storage Services option, found in the console tree. Next, click on the Storage Pools container and choose the New Storage Pool option from theTask list. When the New Storage Pool Wizard begins, click Next to bypass thewizards Welcome screen. When prompted, enter a name andanoptional description of the storage pool that you are creating. Click Next and then choose the disks that you wish to include within thestorage pool. You can use the Allocation drop down for each disk to control whether the disk should be allocated as a data store, a hot spare, or a manual allocation. After making your selections, click Next, followed by Create to create the storage pool.

13

Ten Essential Skills for the Next Generation of Hyper-V

2. After the storage pool is created then the next step is to create a virtual disk. You can create the virtual disk by clicking on the Create a Virtual Disk link. When you do, Windows will launch the New Virtual Disk Wizard. When the wizard starts, click Next to bypass the Welcome screen. Select your storage pool from the list and click Next. 3. Now, enter a name and an optional description for the virtual disk andclick Next. Choose whether you want to configure a simple virtual disk or if you want to virtual disk to be mirrored or to use parity, as shown in Figure 12, and click Next. At this point you must decide whether you want to create a fixed length disk or a thinly provisioned disk. Click Next and enter a size for the virtual disk. Finally, click Create to create the virtual hard disk.
Figure 12

Virtual disks can be made fault tolerant.

NIC Teaming
In the past, managing network connectivity for virtual machines was challenging in Hyper-V environments. Hyper-V creates a virtual switch for each physical network adapter that the administrator allows to be used by Hyper-V. You can connect as many virtual machines as you want to a virtual switch (within reason), but those virtual machines will all share a single physical network adapter. Even a ten gigabit NIC may not be able to deliver adequate bandwidth to efficiently support all of a servers virtual machines. In the past there were three solutions to this problem. One solution was to limit the number of virtual machines running on a host, so as not to overwhelm thephysical network adapter.

14

Ten Essential Skills for the Next Generation of Hyper-V

A second solution was to install multiple network adapters and create aseparate virtual switch for each. Although this technique works, it can be difficult to balance the virtual machine workload evenly among the various virtual switches. The third technique was to use NIC teaming (which is sometimes called NIC bonding). NIC teaming allows multiple physical network adapters to act as asingle, extremely high performance network adapter. For example, three ten gigabit network adapters could be bonded together to act as a logical 30gigabit adapter. The problem with NIC teaming was that it was not directly supported by Windows or Hyper-V. If you wanted to use NIC teaming, the NIC team had to be created at the hardware level. This meant that you had to purchase matched NICs that were specifically designed to be grouped into a NIC team on your server hardware. For the first time Windows Server 2012 supports software level NIC teaming. You can receive all of the benefits of NIC teaming using commodity hardware. The NICs dont even have to be matched. A NIC team can contain mix matched NICs from multiple vendors. Before you create a NIC team, it is important to realize that any static IP address assignments that have been made to the individual network adapters that will be included in the team will be lost. Static IP addresses must be later assigned to the team as a whole, rather than to individual NICs within the team. To create a NIC team, open Server Manager and click on the Local Server option. Click on the Disabled link next to the NIC Teaming option to enable NICteaming. The Server Manager will now display a NIC Teaming dialog box. Click the Tasks link found in the Teams section and then choose the New Team option. When prompted, enter a name for the new NIC team and then select the network adapters that you want to include in the team, as shown in Figure 13:
Figure 13

You must give the teamed NIC a name and choose the adapters that will make up the team.

15

Ten Essential Skills for the Next Generation of Hyper-V

Now, click the Additional Properties link and then select the Teaming Mode that you want to use. The preferred teaming mode is usually Switch Independent. Next, specify your preferred load balancing mode and optionally specify a NIC to be used as a standby adapter. Click OK to create the team. TheNIC team will be displayed in the Control Panel as a teamed NIC, as shown in Figure 14:
Figure 14

The teamed NIC is accessible through the Control Panel.

Cluster Patching
Although there was nothing overly difficult about patch management in Windows Server 2008 R2, patching a Hyper-V cluster was a tedious and time consuming process. If you wanted to patch the servers within the cluster using only native tools then you had to manually live migrate the virtual machines off of a cluster node, patch and reboot the node, and then repeat the process for each remaining cluster node. That isnt to say that there werent some options for automating the process. Cluster level patch management could be automated using System Center Orchestrator or System Center 2012 Virtual Machine Manager. The problem was that there are licensing costs associated with these tools and setting up automated patch management could be complicated. Windows Server 2012 offers a brand new feature called Cluster Aware Updating. This feature allows you to patch the nodes in a Hyper-V cluster without having to manually patch each node or resort to using external tools.

16

Ten Essential Skills for the Next Generation of Hyper-V

Cluster Aware Updating takes a round robin approach to patch management. Itstarts by placing a cluster node into maintenance mode. This causes thevirtual machines that are running on the host to be automatically live migrated to the best possible node (as determined by the cluster). It is worth noting that picking the best possible node is based solely on theamount of free memory on each cluster node. This is different from theprocess used by System Center 2012 Virtual Machine Manager, which uses a number of different criteria to determine the best possible cluster node. Once the virtual machines have been live migrated off of the host, the server is patched and rebooted. The update process then takes the node out of maintenance mode, which allows it to host virtual machines once again. Theprocess is repeated for every node in the cluster. There are two ways to use Cluster Aware UpdatingSelf Updating or Remote Updating. Self Updating is the more common of the two methods and involves running the Cluster Aware Update tool directly on a cluster node according to a schedule that you set. Remote updating involves installing the Cluster Update Tool on a computer that is not a cluster node. The computer must be running Windows Server 2012 or Windows 8. The process of setting up self updating for a cluster is relatively simple. Begin the process by opening Server Manager on a failover cluster node and then choose the Cluster Aware Updating option from the Tools menu, as shown in Figure 15:
Figure 15

The Cluster Aware Updating option is accessible through the Server Manager.

17

Ten Essential Skills for the Next Generation of Hyper-V

When the Cluster Aware Updating tool opens, use the Connect to a Failover Cluster drop down list to select a failover cluster and then click the Connect button. Next, click on Configure Cluster Self-Updating Options link, shown in Figure 16:
Figure 16

Connect to the cluster and then click the Configure Cluster Self Updating Options link.

When the Configure Self Updating Options Wizard appears, click Next to bypass the Welcome screen. You should now see an error message telling you that the cluster is not configured with the Cluster Aware Updating clustered role. Select the Add the CAU Clustered Role with Self Updating Mode Enabled to this Cluster check box and click Next. The next step in the process is to configure an update schedule. It is best to run the update process during off-peak hours if possible. Click Next and you will see the Advanced Options screen. This screen gives you the option of setting some custom update parameters, or you can click Next to accept the defaults (which is usually recommended). Finally, choose whether or not you wish to receive recommended updates in the same way as important updates and then click Next, followed by Apply. Verify the success of the operation and then click Close.

Conclusion
As you can see, Hyper-V 3.0 contains a vast array of new features and using these new features means mastering new skills. Although this white paper has outlined ten of the most important techniques that you will need to know how to perform when working in a Hyper-V environment, there are far more. My soon to be released book on Hyper-V explores Hyper-V in granular detail andprovide step-by-step guidance for performing these and many other tasks.

18

Ten Essential Skills for the Next Generation of Hyper-V

About the Author


Brien Posey is a freelance technical writer who has
received Microsoft's MVP award 9 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 andWeb sites. In addition to his writing, Brien routinely speaks at ITconferences and is involved in a wide variety of other technology relatedprojects.

About Veeam Software


Veeam Software develops innovative solutions for VMware backup, Hyper-V backup, and virtualization management. Veeam Backup & Replication is the#1VMBackup solution. Veeam ONE is asingle solution for realtime monitoring, resource optimization, documentation and management reporting for VMware and Hyper-V. Veeam extends deep VMware monitoring to Microsoft SystemCenter with VeeamManagement Pack (MP), and to HP OperationsManager with Veeam Smart Plug-In (SPI). Veeam also provides free virtualizationtools. Learnmore by visiting www.veeam.com.

19

Ten Essential Skills for the Next Generation of Hyper-V

NEW!

Veeam Backup & Replication v6

Extending the lead in VM backup with these new capabilities:


Enterprise scalability: new distributed architecture streamlines deployment and maintenance of remote oce/branch oce (ROBO) and large installations. Advanced replication: accelerates replication by 10x, streamlines failover, and provides real failback with delta sync. Multi-hypervisor support: brings Veeams award-winning data protection to Microsoft Hyper-V and lets you protect all your VMs VMware and Hyper-V from one console. and more!

2010

of the Year

Products

GOLD

To learn more, visit http://www.veeam.com/backup


20

You might also like