Upload
navneetmishra
View
8
Download
0
Embed Size (px)
DESCRIPTION
Hyper-V Generation 2 Virtual Machines – Part 3
Citation preview
Hyper-V generation 2 virtual machines part 36John Howard MSFT 28 Oct 2013 11:35 AM
Part 1: Introduction to generation 2 virtual machines Part 2: Networking and boot order Part 3: Storage Part 4: Keyboard for Windows 8 & Windows Server 2012 Part 5: Kernel debugging Part 6: Secure Boot Part 7: FAQ Part 8: Manually migrating generation 1 virtual machines to generation 2 Part 9: Installing from ISO Part 10: Utility for converting generation 1 virtual machines to generation 2 ConvertVMGeneration
In the previous part, I explained about management as it relates to network in generation 2 VMs and also talked about the bootorder settings. In this part, Im going to follow a similar theme, but apply it to storage. And introduce a longasked for featurewhich is new to HyperV in Windows 8.1 & Windows Server 2012 R2
Boot from SCSI
Recapping slightly, as mentioned in part one, the emulated IDE controller is no longer present in a generation 2 VM. To boot fromdisk, we have made it possible in a generation 2 VM to boot from a SCSI controller more specifically VHDXs or ISOs added to aSCSI controller.
Note the ability to boot from SCSI is a feature in our UEFI firmware, not the SCSI controller itself. In other words, even thoughgeneration 1 VMs also support SCSI controllers and VHDXs but not DVDs being attached to them, you cannot boot ageneration 1 VM from a device attached to a SCSI controller.
It is not possible to boot a generation 2 or generation 1 virtual machine from storage attached to a virtual fibre channel adapter.
VHD vs VHDX
Generation 2 VMs only support VHDXs they do not support VHDs. However, you can convert a VHD to a VHDX using theConvertVHD cmdlet. This will work for data disks if you are migrating existing VMs to generation 2 VMs. However, it will not workas expected for boot disks. The boot disk will convert fine in terms of the VHD/VHDX file format, but will not boot afterconversion in a generation 2 VM as the partition layout and boot configuration will not be correct for UEFI. I will talk more aboutmigration in a later part, but you will need to clean install the guest operating system to move to a generation 2 VM.
IDE Controller overhead
The IDE controller in a generation 1 virtual machine supports 48bit LBA, and switches to that mode if the VHD is larger thanapproximately 137GB. Regardless of mode, what this means is that during a guest operating system boot, each I/O involves 6 9 if48bit LBA round trips through the hypervisor, the parent partition kernel mode, parent partition user mode and deviceemulation inside the worker process to complete. This is actually quite a significant overhead in terms of compute cycles, and alsocauses the guest VPs to be paused during this emulation path. Once the guest operating system has got sufficiently far throughboot, our fast path filter for the I/O path comes online at which point we switch to software based I/O over VMBus which is farmore efficient.
With native support for VMBus in our UEFI firmware in a generation 2 VM, no emulation is necessary to boot a VM from a VHDXor ISO attached to a virtual SCSI controller. Hence initial boot performance is far more efficient.
Disk layouts
In a generation 1 VM, the boot disk must have an MBR partition table. This is a requirement of our PCAT BIOS. Data disks in ageneration 1 VM can be GPT. Technically, the boot disk for a generation 2 VM or EFI machine can be MBR or GPT, as long asthere is an EFI system partition present with a boot loader. However, it is strongly recommended that you use GPT on a UEFIbased machine. The Windows ADK has information on the recommended disk partitioning structure.
When you run setup installing Windows, it will lay out the partitions on the boot disk appropriately, automatically using GPT in thecase of a generation 2 VM. What does this mean in reality? Well not a lot to most users as the disk layout will largely be irrelevant.However, there is a difference in terms of maximum size of the boot volume. For a generation 1 VM, the boot volume can be amaximum of 2TB in size assuming you are using VHDX as VHD is limited to 2040GB. If the VHDX is greater than 2TB, anyremaining space can still optionally be used as a data volume for generation 1. For a generation 2 VM, the boot volume can be amaximum of 64TB in size, which is also the maximum disk size supported by a VHDX.
Hot or online expand
While this next point isnt strictly directly related to generation 2 VMs, because of supporting SCSI boot, generation 2 VMs can bea little more dynamic in nature, reducing downtime. New to Windows 8.1/Windows Server 2012 R2 HyperV is the ability toexpand a VHDX while it is use. This means that is it possible to expand not just a data disk, but the boot volume too. This ispotentially useful in a private/public cloud scenario as it eliminates downtime for customer requests for more storage.
Online expand is found through the Edit Disk Wizard in HyperV Manager or the ResizeVHD PowerShell cmdlet. Note that afterexpanding a VHDX, it will be necessary to use diskmgmt.msc inside the guest operating system to extend the file system to usethe extra space.
Hot Add/Remove Disks
Im including this more as an end user be beware of this feature as it applies to generation 2 VMs. We have supported hot addand remove of disks to SCSI controllers for a while. However, the downside is that it is possible to remove the system disk from arunning VM at run time. In the case of Windows, this has the potential for a VM to crash should it, for example, attempt to accessthe page file and hit an I/O error. This is something we hope to look at addressing in the future. Its actually not as trivial as itsounds to get right, hence it did not make it into this release.
DVD
Moving on to another aspect of storage relating to generation 2 VMs, lets talk about the DVD device. This is a brand newsoftwarebased DVD device which can only be used on a SCSI controller. Someone will ask, so worth mentioning: Even though ageneration 1 VM supports a SCSI controller, you cannot use the SCSI DVD on a generation 1 VM.
There are a few differences between DVD support between generation 1 and generation 2 VMs
Generation 1 has a DVD device attached to the IDE controller 1 by default. Unless you specify to install from a bootable ISOin the new virtual machine wizard, generation 2 VMs do not have a DVD device added by default. This was a consciousdesign decision.The DVD device in a generation 1 VM cannot be removed although media can be removed from the device while the VMis powered on. The DVD device in a generation 2 VM can be hotadded and hotremoved.The DVD device in a generation 2 VM does not support physical drive passthrough. Again, this was a conscious designdecision driven primarily by user data which indicated that very few people used physical media. Further, physical mediadoes not survive live migration.There is a limit of 4 DVD devices possible in a generation 1 VM two on each IDE controller. For generation 2, the limit is256 4 SCSI Controllers x 64 drives. Bonus points if someone can come up with a valid/uncontrived end user scenario thatactually requires this though. It was simply a case of being more work to validate limiting the maximum number of devicesrather than just let it ride.
In the next part, Ill talk about the keyboard device. Advance warning to those following along, install the ADK now link is above;
Cheers, John.
Comments
L. 29 Oct 2013 7:33 PM
Can you summarize when TRIM commands are passed down to the physical storage, in the different scenarios: gen1vsgen2, vhdxvspassthroughto a partition?