Lead Image © Alina Pavlova, 123RF.com

Lead Image © Alina Pavlova, 123RF.com

Dealing with VHDX files

Modern Art

Article from ADMIN 17/2013
By
VHDX files introduce some improvements over the legacy virtual hard disk format. In this article, we review some of the interesting features.

Hyper-V virtual hard disk (VHDX) files not only have more capacity than the standard VHD files, they are also far less likely to be corrupted as the result of a server failure or hard reset. VHD files can be destroyed very quickly when the host system encounters problems – but not so with VHDX files. If you use Windows Server 2012, you normally create VHD files as an iSCSI target; Windows Server 2012 already supports VHDX files but can only use them with Hyper-V, not iSCSI, targets.

Now Available for iSCSI

The new Windows Server 2012 R2, however, can use VHDX disks as iSCSI targets. The VHDX hard drives you create also can be managed directly in the System Center products as of Windows Server 2012 R2 and System Center 2012 R2. Windows Server 2012 R2 provides the option of assigning the disk to multiple virtual servers. Shared VHDX technology primarily offers benefits in operations with Hyper-V R2 2012.

Also new in Windows Server 2012 R2 is the option to change the size of virtual hard disks on the fly, but you need to shut down the associated virtual server in Windows Server 2012. Also, you can now export and copy virtual servers on the fly in Windows Server 2012 R2.

Using VHDX Files

To manage virtual hard disks outside of Hyper-V, right-click Disk Management and choose Create VHD , which starts the wizard. In the wizard, you need to decide where you want to save the VHDX file on your hard drive and what size the hard disk should be. At this point, you also determine whether the disk can grow or whether you want to use a fixed size.

If you select Attach VHD , you can connect an existing disk to the computer (Figure 1). You can double-click a VHD(X) file to this, too. After you have created the virtual hard disk, Windows displays it in Disk Management, and you can manage it like any other disk.

Figure 1: Associating VHDX disks directly with the operating system as data storage without Hyper-V.

If you still use VHD files, you can convert these to VHDX files with the Hyper-V Manager or the Convert-VHD PowerShell cmdlet. In Hyper-V Manager, click the Edit Disk action to launch the corresponding wizard. Load the VHD file and start the conversion in the wizard by choosing Convert .

Converting

In the scope of the conversion, you can select the disk format and also change the disk type (i.e., Fixed size or Dynamically expanding ). The Convert-VHD cmdlet is available after installing Hyper-V on Windows 8, as well.

One of the advantages of cmdlets is the ability not just to convert files VHD files to VHDX files but also to convert the opposite direction. Thus, you can benefit from the advantages of the new format but revert in case of emergency (e.g., you need to mount a virtual hard disk on another system some time later). The syntax is very simple:

Convert-VHD -Path <Path to VHD(X) file> -DestinationPath <path to target file>

It is also possible to change the type of hard disk, for example, to a differencing disk:

Convert-VHD -Path <Path to VHD/VHDX file> -DestinationPath <target path and file> -VHDType Differencing -ParentPath <parent disk>

or a dynamic disk:

Convert-VHD -Path hd1.vhd -DestinationPath hd1.vhdx -VHDType Dynamic

You will find all the options for this cmdlet on Microsoft's TechNet site [1]. Besides using PowerShell to convert hard disk formats, you can customize the hard disk size with the Resize-VHD cmdlet:

Resize-VHD -Path c:\vm\owa.vhdx -SizeBytes 1TB

In addition to these special tasks, you can simply use New-VHD to create new disks and Get-VHD to display information about the hard disks. Virtual hard disks can be connected directly to virtual servers in PowerShell with:

Add-VMHardDiskDrive -VMName <VM> -Path <VHDX file>

Of course, you can connect virtual hard drives to the host system. For example, to copy data and integrate it with the virtual server, issue:

Mount-VHD <VHD file>

The Dismount-VHD cmdlet disconnects the virtual disk from the system.

Microsoft helps administrators migrate virtual servers from VMware vSphere to Hyper-V with the free Microsoft Virtual Machine Converter [2]. The current version is already optimized for Windows Server 2012 and Hyper-V Server 2012, but it does not support the new VHDX disk format of Windows Server 2012 as yet.

However, with Hyper-V Manager – or with Convert-VHD – you can convert the VHD file that is created to a VHDX disk. System Center Virtual Machine Manager 2012 with SP1 can convert VHDX hard disks from Hyper-V 3.0 and VHD files to VHDX format.

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Clusters with Windows Server 2012 R2
    With Windows, you can create a highly available cluster at the click of a button. The cluster will even handle fully automated, non-disruptive software upgrades.
  • Hyper-V 3.0 in Windows Server 2012

    In the old Hyper-V hypervisor from Microsoft, many features for professional use were missing. The new version 3.0 has been significantly improved and is slowly catching up to VMware.

  • Hyper-V with the SMB 3 protocol
    Microsoft has introduced several improvements to Windows Server 2012 and Windows Server 2012 R2 with its Server Message Block 3. Hyper-V mainly benefits from faster and more stable access to network storage. In this article, we look at the innovations.
  • System Center 2012 SP1: What's new?
    Service Pack 1 expands System Center 2012 primarily in terms of features for virtualization and cloud computing. We provide the details in this article.
  • Hyper-V containers with Windows Server 2016
    The release of Windows Server 2016 also heralds a new version of Hyper-V, with improved cloud security, flexible virtual hardware, rolling upgrades of Hyper-V clusters, and production checkpoints.
comments powered by Disqus

SysAdmin Day 2017!

  • Happy SysAdmin Day 2017!

    Download a free gift to celebrate SysAdmin Day, a special day dedicated to system administrators around the world. The Linux Professional Institute (LPI) and Linux New Media are partnering to provide a free digital special edition for the tireless and dedicated professionals who keep the networks running: “10 Terrific Tools."

Special Edition

Newsletter

Subscribe to ADMIN Update for IT news and technical tips.

ADMIN Magazine on Twitter

Follow us on twitter