Sunday, June 14, 2015

Upgrade: VHD files to VHDX file format

Background

In a previous article I had migrated a SQL Server that made use of iSCSI targets on Windows Server 2008 R2. The destination server was a brand new Windows Server 2012 R2 box and along with it came the new format of VHDX.

According to the MSDN Overview of VHDX:
The VHDX format provides the following features::
  1. Support for virtual hard disk storage capacity of up to 64 TB.
  2. Protection against data corruption during power failures by logging updates to the VHDX metadata structures.
  3. Improved alignment of the virtual hard disk format to work well on large sector disks.
  4. Larger block sizes for dynamic and differencing disks, which allows these disks to attune to the needs of the workload.
  5. A 4-KB logical sector virtual disk that allows for increased performance when used by applications and workloads that are designed for 4-KB sectors.
  6. The ability to store custom metadata about the file that the user might want to record, such as operating system version or patches applied.
  7. Efficiency in representing data (also known as “trim”), which results in smaller file size and allows the underlying physical storage device to reclaim unused space. (Trim requires physical disks directly attached to a virtual machine or SCSI disks, and trim-compatible hardware.)

Lets look at the ROI

  1. Neutral - Datacenter guys rejoyce! For me in the home lab well I am actually not seeing to much here. Even if I maxed out a standard Dell MD3000i SAN I would at best net 45TB of the 64TB as a single file. 
  2. Positive - This is a bigger win for the smaller labs like mine because not every lab is blessed with an UPS especially one that will meet a SLA[A]. Even with a RAID Controller Battery power outages can still harm buffer caches prior to the write-back cache in Server 2012!
  3. Positive - Every backup software will benefit from this going to mechanical disks.
  4. Neutral Positive - Data Centers and VDI deployments I am sure will love this. At first I put Neutral however it dawned on me that my Developer Hyper-V VMs can take advantage of this feature since they 1) work on 4KV NTFS aligned disks and 2) can make use of differencing disks. If I get enough requests I will do a posting on the differencing disks.
  5. Positive - Pretty much every Hyper-V Guest will benefit from this in the Windows environment. Even in my case the majority of the VHDs I have deployed are VM OS disks as well as Drive Shares.
  6. Neutral - This is for the bigger guys again. SCVMM would be the first thing coming to mind that will gain the primary advantage specific to this feature.
  7. Winner - Biggest ROI right here. The "Trim" the MSDN is referring to is at the hardware level. SSDs, SCSI, iSCSI, to name a few, can now accept the TRIM command directly, pass-through, allowing the hardware to more efficiently keep its resources in order. Double check your hardware for TRIM support.


Problem Space

VHD format itself is deprecated in favor of VHDX. In this instance the VHD files are being used for iSCSI targets that another Hyper-V server leverages. The iSCSI wizard provides no option for using a VHD file so therefore we have no choice but to upgrade.

Solution Space

You have two (2) viable solutions. Before beginning either of them make sure to backup the VHD file to another secure location!

First is to use PowerShell: Convert-VHD cmdlet.
PS C:\> Convert-VHD –Path c:\test\testvhd.vhd –DestinationPath c:\test\testvhdx.vhdx

Second is to use the Hyper-V Disk Wizard. Just follow the green boxes.






Note: I leave the disk sizing strategy to your use case.








Now we wait. When it concludes you can simply delete your disk although I recommend saving the file for seven (7) to fourteen (14) days as a "just-in-case".

Conclusion

Post Mortem

I could have saved time if I would have shrunk the VHD itself prior to conversion.

Fun Facts

[A] Most standard SLA's guarantee an uptime of 8760 hours, 365 days, with only 24 hours of allowed downtime per year. If your UPS is beefy enough to cover the 24 hours of downtime then you can considered your SLA an aggressive policy. You do see these in Data Centers that feature a diesel backup generator that powers Industrial Battery Cells in Series-Parallel configurations. These in turn are connected to the main PoE electric panels in that a UPS will plug into.

1 comment: