Tag: VHD

Hyper-V VHDX Format Specification v1.00

Windows Server 2012 Logo

Yesterday I posted a blog post about the new recommendations about Virtual Disks files in Hyper-V called VHD and VHDX.

Today I saw a tweet from Niklas Akerlund who posted a link to the new VHDX Format Specification v1.00.

This specification describes the VHDX virtual hard disk format that provides a disk-in-a-file abstraction.  This specification assumes that you are familiar with hard disk technologies, including how hard disks interface with the operating system or a virtual machine and understand how data is accessed and laid out on the physical medium. This specification is released under the Microsoft Open Source Promise (OSP) initiative to help guide development of VHDX virtual hard disk format implementations that are compatible with those provided by Microsoft.

Download: Hyper-V VHDX Format Specification v1.00

 

VHDX is the new format which is currently supported by Windows 8 and Windows Server 2012.



Windows Server 2012 Hyper-V: Virtual Disk VHD & VHDX recommendations

Windows Server 2012 Logo

In the new released Performance Tuning Guidelines for Windows Server 2012 you can find a lot of tuning information for Windows Server 2012 Hyper-V. One important part is the Virtual Disk chapter which is all about the VHD and the new VHDX format.

The basic key takeaways are:

  • Use VHDX every time
  • Use Dynamic VHDX

The VHDX format:

VHDX is a new virtual hard disk format introduced in Windows Server 2012, which allows you to create resilient high-performance virtual disks up to 64 terabytes. Benefits of this format include:

  • Support for virtual hard disk storage capacity of up to 64 terabytes.
  • Protection against data corruption during power failures by logging updates to the VHDX metadata structures.
  • Ability to store custom metadata about a file, which a user might want to record, such as operating system version or patches applied.

The VHDX format also provides the following performance benefits (each of these is detailed later in this guide):

  • Improved alignment of the virtual hard disk format to work well on large sector disks.
  • Larger block sizes for dynamic and differential disks, which allows these disks to attune to the needs of the workload.
  • 4 KB logical sector virtual disk that allows for increased performance when used by applications and workloads that are designed for 4 KB sectors.
  • Efficiency in representing data, which results in smaller file size and allows the underlying physical storage device to reclaim unused space. (Trim requires trim-compatible hardware.)

When you upgrade to Windows Server 2012, we recommend that you convert all VHD files to the VHDX format due to these benefits. The only scenario where it would make sense to keep the files in the VHD format is when a virtual machine has the potential to be moved to a previous release of the Windows Server operating system that supports Hyper-V.

VHD File Type

The following recommendations should be taken into consideration with regards to selecting a VHD file type:

  • When using the VHD format, we recommend that you use the fixed type because it has better resiliency and performance characteristics compared to the other VHD file types.
  • When using the VHDX format, we recommend that you use the dynamic type because it offers resiliency guarantees in addition to space savings that are associated with allocating space only when there is a need to do so.
  • The fixed type is also recommended, irrespective of the format, when the storage on the hosting volume is not actively monitored to ensure that sufficient disk space is present when expanding the VHD file at run time.
  • Snapshots of a virtual machine create a differencing VHD to store Writes to the disks. Having only a few snapshots can elevate the CPU usage of storage I/Os, but might not noticeably affect performance except in highly I/O-intensive server workloads. However, having a large chain of snapshots can noticeably affect performance because reading from the VHD can require checking for the requested blocks in many differencing VHDs. Keeping snapshot chains short is important for maintaining good disk I/O performance.

For more information checkout the Performance Tuning Guidelines for Windows Server 2012.

And check out my other post about VHD and VHDX for Hyper-V:

Update 1:

My Virtual Machine MVP colleague Carsten Rachfahl just told me that now also IDE devices can use the TRIM function for VHDX files. That means that VHDX on SCSI or IDE controller as well as pass-through disks support TRIM. The only thing which is required is trim-compatible hardware.

Update 2:

Even the GUI in Windows Server 2012 and Windows 8 recommend Fixed size for VHDs and Dynamic expanding for VHDX.

I have now server customer environment running in products for a couple of months and all are using the new Dynamic Expanding VHDX format. No problems and performance issues at all. Dynamic Expanding VHDX disks are even running faster than Fixed Size VHD files.

 



Virtual Machine Servicing Tool 2012 released

VHDX

In July Microsoft released the beta of the Virtual Machine Servicing Tool 2012  and two weeks ago Microsoft released the final of  the Virtual Machine Servicing Tool 2012 (VMST 2012). I already did a post how you can update offline VHDs via Virtual machine Servicing Tool.

Virtual Machine Servicing Tool 2012 streamlines the process of keeping your offline virtual machines, templates and VHDs up-to-date with the latest operating system and application updates, without introducing vulnerabilities into your IT infrastructure. VMST 2012 helps you effectively manage the workflow of updating your offline virtual machines according to their individual needs.

Using features in VMST 2012, customers can service:

  • Offline virtual machines in a SCVMM library.
  • Stopped and saved state virtual machines on a host.
  • Virtual machine templates.
  • Offline virtual hard disks in a SCVMM library by injecting update packages.

VMST 2012 works seamlessly with other Microsoft technologies.

VMST 2012 is designed to work with Microsoft® System Center 2012 – Virtual Machine Manager (VMM) and with the following technologies:

  • Windows Server Update Services (WSUS) WSUS 3.0 SP2.
  • System Center 2012 Configuration Manager.

You can find the Virtual Machine Servicing Tool 2012 in the Microsoft Download Center.



Windows Server 2012 Hyper-V – How to create a new VHD from a source VHD

Windows Server 2012 RC Logo

Microsoft MVP Aidan Finn posted a interesting blog post about Virtual Hard Disk (VHD) Block Fragmentation. He was reviewing the document about Performance Tuning Guidelines for Windows Server 2012 and found a very important note about VHD performance.

Just as the allocations on a physical disk can be fragmented, the allocation of the blocks on a virtual disk can be fragmented when two virtually adjacent blocks are not allocated together on a virtual disk file.

The fragmentation percentage is reported for disks. If a performance issue noticed on a virtual disk, you should check the fragmentation percentage. When applicable, defragment the virtual disk by creating a new virtual disk with the data from the fragmented disk by using the Create from Source option.

Now first thanks to Aidan Finn for finding this one. But how do I create a new VHD or VHDX from a source? Simple there are two ways of doing that, the first one is over the Hyper-V Manager GUI.

Create a new VHD and give it a new name.

New Defrag VHD

On the Configure Disk window check the Copy the contents of the specified virtual hard disk, and select the path to the source VHD.

Copy the contents of the specified virtual hard disk

Click next and finish and this will create the new VHD with the content from the source VHD.

Creating the new virtual hard disk

The second and my preferred way of doing it, is of course with Windows PowerShell.

Create the new virtual hard disk from Source via PowerShell

 
# Mount the Source VHD
Mount-VHD "C:\VMs\WS2012\Virtual Hard Disks\WS2012.vhdx"
 
# List the Disks
Get-Disk
 
# Create the new VHD (SourceDisk = Disknumber)
New-VHD -Dynamic -Path "C:\VMs\NewDefragVHD2.vhdx" -SourceDisk 1

 

Create the new virtual hard disk via PowerShell

 

 



Updating offline VHDs via Virtual Machine Servicing Tool

VHDX

Some weeks ago Microsoft announced the beta of a solution accelerator called Virtual Machine Servicing Tool 2012. The VMST 2012 allows you to update Virtual Machines in a System Center Virtual Machine Library, update stopped and saved state virtual machine on a Hyper-V host, update SCVMM Virtual Machine templates and to injecting update packages in offline virtual hard disks (VHD) disks stored in a System Center Virtual Machine Manager Library.

This guide should give show a quick insight into the Virtual Machine Servicing Tool.

After you have installed the Virtual Machine Servicing Tool and added the psexec to the bin folder of the tool you have to do a quick configuration of your environment.

First you have to add the servers in your environment. You have to add the SCVMM and the SCCM or WSUS server.

The second configuration step is to choose the Hyper-V hosts which will be used for the maintenance and servicing jobs. You need this if you update an offline virtual machine which is stored in your library. The virtual machine will be deployed on these hosts and will be patched before they will be saved in the SCVMM library again.

The Maintenance host for servicing offline virtual hard disk will be the place where VHD will be attached and the update packages will be injected.

 

After you have done these simple setup steps you can now start patching your offline Virtual Hard Disks (VHDs). In the VMST Console you can create a new Servicing Job.

First you have to choose a name for the servicing job and a update source, this could be a WSUS server or update packages stored in a folder.

Now you have to select the VHD you want to update.

You have to select one of your maintenance hosts

And after the servicing job has been started you can watch the process in your VMST console.

 

This is how simple it is to patch offline virtual machines, you can even schedule servicing tasks, so they run after every patch day.



Hyper-V vs. VMware vSphere – Storage

Windows Server 2012 RC Logo

This is another post in my series about Hyper-V vs. VMware.

This time it is about storage in terms of virtualization. And as you could read everywhere, Microsoft did also a lot of improvements for the Windows Server 2012 release.

  • New Virtual Disk format (VHDX) – Supports up to 64 TB Virtual Hard Disks
  • Offloaded Data Transfer (ODX) – Offloads storage-intensive tasks to the SAN
  • Data De-duplication
  • Storage Spaces and Storage Pools – Data Advanced Storage Array Features to Windows Server
  • Virtual Machine boot from SAN
  • Live merging of VHDs and Virtual Machine Snapshots
  • Native 4K Disk Support – Take advantage of enhanced density and reliability
  • Virtual Fiber Channel – Connect a Virtual Machine directly to a Fiber Channel SAN
  • Support for File based Storage with SMB 3.0
  • New file system (ReFS)
  • BitLocker encryption support – BitLocker is now available for Cluster Shared Volumes to support encryption in cluster environments

 

CapabilityWindows Server 2012 RC Hyper-VVMware vSphere HypervisorVMware vSphere 5.0 Enterprise Plus
Virtual Fiber ChannelYesYesYes
3rd Party Multipathing (MPIO)YesNoYes (VAMP)
Native 4-KB Disk SupportYesNoNo
Maximum Virtual Disk Size64TB VHDX2TB VMDK2TB VMDK
Maximum Pass Through Disk SizeVariable64TB64TB
Offloaded Data TransferYesNoYes (VAAI)
Storage EncryptionYesNoNo

 

  • The maximum size of a physical disk in attached to a Hyper-V virtual machine is determined by the guest operating system and the chosen file system within the guest
  • vStorage API for Multipathing (VAMP) is only available in Enterprise & Enterprise Plus editions of vSphere 5.0
  • vStorage API for Array Integration (VAAI) is only available in Enterprise & Enterprise Plus editions of vSphere 5.0
  • VMware documentation does not suggests that their respective platforms support 4K Advanced Format Drives

Sources:

Check out my Blog post Hyper-V 2012 – Hey I Just Met You And This Is Crazy for more information about the latest version of Hyper-V.



Windows Server 2012 Hyper-V: Convert VHD to VHDX

VHDX

With Windows Server 2012 Microsoft released a new Virtual Disk Format called VHDX. VHDX improves the Virtual Disk in a lot of way.

Back in October I wrote a blog post on the improvements of the VHDX Format in the Windows Server 8 Developer Preview. Back then VHDX supported a size of 16TB, with the release of the Windows Server 8 Beta (Windows Server 2012 beta) the new Maximum size changed to 64TB.

Some of the VHDX improvements:

  • Support up to 64TB size
  • Supports larger block file size
  • improved performance
  • improved corruption resistance
  • the possibility to add meta data

You can download the VHDX Format Specification.

To use this new features you have to convert your existing VHDs into the new VHDX format. You can this do in two different ways, with the Hyper-V Manager or with Windows PowerShell.

Convert VHD to VHDX via Windows PowerShell

To convert a VHD to a VHDX with Windows PowerShell you can use simple this PowerShell command:

 Convert-VHD TestVHD.vhd -VHDFormat VHDX -DestinationPath C:\temp\VHDs\TestVHDX.vhdx -DeleteSource 

Of course you can convert the VHDX back to a VHD using the following command:

 Convert-VHD TestVHDX.vhdx -VHDFormat VHD -DestinationPath C:\temp\VHDs\TestVHD.vhd -DeleteSource 

Convert VHD to VHDX via PowerShell

Convert VHD to VHDX via Hyper-V Manager

  1. Start the Hyper-V Manager and click on “Edit Disk…
    Hyper-V Manager
  2. Now select the VHD you want to convert
    Edit Virtual Hard Disk
  3. Select “Convert
    Convert Virtual Hard Disk
  4. Select the target format in this case VHDX
    Convert VHD to VHDX
  5. Select the new location for your new VHDX
    Convert VHD to VHDX Location
  6. Check the summary and click finish
    Convert VHD to VHDX Finish

 

Same as with the PowerShell command, you can also convert a VHDX to a VHD. But you have to make sure that the VHDX is not bigger than 2TB.

Aviraj Ajgekar already did a post on this TechNet blog about how you can convert a VHD to VHDX via Hyper-V Manager.