Posey's Tips & Tricks

A Better Use for Passthrough Disks

A passthrough disk feature can offer practical alternative use cases, like simplifying file transfers between isolated virtual machines.

Microsoft introduced Hyper-V's passthrough disk feature quite some time ago, and to be perfectly honest with you, it's one of those features that I have never used in a production environment. Sure, I have played around with passthrough disks in lab settings, but never in production. Don't get me wrong, pass through disks have their place. In fact, they were designed to act as workarounds for some common virtualization related problems, though these problems are far less of an issue today than they once were. Recently however, I found a perfect use case for passthrough disks.

Before I tell you what I did, let me take a moment to talk about passthrough disks for the benefit of anyone who might not be familiar with them. Passthrough disks allow you to dedicate a physical disk to a virtual machine. That way, the virtual machine can use the disk natively as opposed to you having to create a virtual disk on the physical disk.

This of course raises the question of why Microsoft created the disk passthrough feature in the first place. Historically, there have been three main reasons for using passthrough disks.

First, pass through disks can be an option in situations in which a Hyper-V virtual machine needs the best possible storage performance. After all, if a virtual machine is able to access storage directly then the VM will not incur the IO overhead that's associated with communicating with virtual disks.

The second reason why Microsoft created the disk passthrough feature is because at the time when Hyper-V was created way back in Windows Server 2008, virtual machines were still somewhat of a rarity. As such, there were some applications at the time that would not play nice with a virtual machine. This was especially true of certain database applications that required direct control of the underlying storage. Passthrough disks made it possible to run such applications on a virtual machine without running into storage compatibility issues.

One more reason why Microsoft gave us the option of using passthrough disks was that when Hyper-V was first introduced, virtual hard disks had an extremely limited capacity. As you might recall, Hyper-V virtual hard disks originally used VHD files, as opposed to the VHDX files that are used today. These VHD-based virtual hard disks had a maximum capacity of 2 TB. In contrast, a modern VHDX-based virtual hard disk can store up to 64 TB of data.

The passthrough disk feature gave organizations a way of overcoming the 2 TB limit. Those who needed to create volumes larger than 2 TB could attach a physical disk (or disk array) and access it directly, rather than being limited to creating volumes of 2 TB or less.

It's also possible that placing larger volumes on passthrough disks may have helped with stability. Not long after Hyper-V was released, I tried migrating one of my production machines to Hyper-V. This particular VM had a volume that contained roughly about a terabyte of data. That VM suffered from constant problems (again, Hyper-V was brand new at the time). When I reached out to friends at Microsoft, none of them really offered any helpful advice. Instead, the answer that I kept getting was something along the lines of,"wow, that's a lot of data to put on a virtual machine." I began to get the impression that even though a VHD file could technically store up to 2 TB of data, maybe using a large capacity VHD wasn't such a great idea.

Today of course the factors that I have discussed are much less of an issue. Multi-terabyte virtual hard disks have become the norm. I have virtual hard disks in my production environment that contain dozens of terabytes of data. Additionally, modern database applications are designed to work with virtual machines and modern storage hardware has all but eliminated the IO penalty associated with using virtual hard disks.

So does all of this mean that pass through disks are completely obsolete? Perhaps not. I recently stumbled onto a real world use case for pass through disks.

It's kind of a long story, but I was setting up a bunch of virtual machines for a project that I am working on and I needed to copy a collection of large files to those virtual machines. Normally, I would just set up a network share and copy the files across the network. In this case however, some of the virtual machines were on isolated network segments and it would have been a pain to create temporary networks just for the sake of copying a few files.

What I did instead was to copy the files to a USB hard disk and then plug the hard disk directly into my Hyper-V host. From there, I configured the virtual machines (one at a time) to treat this USB hard disk as a pass through disk. That way, I was able to access the disk directly and to copy its contents to the virtual machine. When I was done, I simply released the pass through disk and connected it to the next virtual machine.

Admittedly, I could have connected the USB hard disk to my desktop computer and then made it available to the virtual machines through an enhanced RDP session. That certainly would have worked, and it is a technique that I have used on occasion in the past. In this case however, I already had a couple of USB disks connected to my desktop because of an unrelated project and so it was just easier to copy the files from a passthrough disk.

About the Author

Brien Posey is a 22-time Microsoft MVP with decades of IT experience. As a freelance writer, Posey has written thousands of articles and contributed to several dozen books on a wide variety of IT topics. Prior to going freelance, Posey was a CIO for a national chain of hospitals and health care facilities. He has also served as a network administrator for some of the country's largest insurance companies and for the Department of Defense at Fort Knox. In addition to his continued work in IT, Posey has spent the last several years actively training as a commercial scientist-astronaut candidate in preparation to fly on a mission to study polar mesospheric clouds from space. You can follow his spaceflight training on his Web site.

Featured

comments powered by Disqus

Subscribe on YouTube