Posey's Tips & Tricks
What To Do When Hyper-V Runs Low on Disk Space
The obvious solution (add more physical storage) is usually easier said than done. Here are some short-term fixes that can buy you some time -- and reveal some pockets of spare storage you might not know you had.
Today's hard drives are so large and inexpensive that it is sometimes easy to forget that all of that space can be exhausted -- and yet, that's the situation that I recently found myself in.
I work out of my home and have a pair of mirrored Hyper-V servers hosting a virtualized file server. Each of the two Hyper-V servers is directly attached to its own really large, dedicated storage array.
Recently, I have been doing a lot of video work, and last week I found myself with only a few hundred gigabytes remaining. All of my drive bays are filled with the largest drives available, so my only option for adding storage is to purchase some additional storage arrays. Of course, it takes time to research the available products, and I need storage now.
Here are a few tricks that I came up with to help me deal with the problem.
Look for Space that May Not Be in Use
One of the best things that you can do in an emergency situation like the one that I found myself in is to look for space that may not be used.
I'm sure this idea probably sounds ridiculous. After all, if you had unused space, then your server wouldn't be running out of space, right?
This technique doesn't work in every situation, but in my case I was able to gain an extra terabyte of storage.
My virtualized file server uses three thinly provisioned virtual hard disks. I have always been super-paranoid about over-provisioning storage, so when I set the up the virtual machine (VM), my virtual hard disks were set to a maximum size that matched the physical disk space that I had available.
Two years ago, I performed a major hardware upgrade. Although I expanded my virtual hard disks at the time, none of those virtual hard disks needed quite as much physical space as I had available. I knew that one day in the distant future, my three virtual hard disks would fill up and need to be expanded. Since I didn't know which virtual hard disk would run low on space first, I just left some physical storage available on my Hyper-V server. This allowed me to expand one of my virtual hard disks by a terabyte.
Shrink Thinly Provisioned Drives
Another thing that you may be able to do in a pinch is shrink any thinly provisioned drives.
This one seems counterintuitive until you stop and think about the way that Hyper-V's thin provisioning works.
When you create a thinly provisioned (or dynamically expanding, as it is sometimes called) virtual hard disk for a Hyper-V VM, Hyper-V creates a VHD or VHDX file that is less than 1GB in size. As you add data to the virtual hard disk, the virtual hard disk file expands until it reaches the maximum capacity that you specified when you created it.
Although a virtual hard disk file grows as you add data to it, it does not shrink as you remove data. If a significant amount of data has ever been deleted from a thinly provisioned virtual hard disk, then you may be able to reclaim some physical disk space by compacting the virtual hard disk.
Take Advantage of Cheap, Temporary Storage
Another thing that you can do in a pinch is to take advantage of cheap, temporary storage.
Although I managed to gain an extra terabyte of storage space, that 1TB simply wasn't enough to meet my needs. I solved the problem by temporarily offloading some of my "cold data" to an external USB disk, which I then detached from the server and stored for safe-keeping.
Once I have added some additional storage to my Hyper-V infrastructure, then I will move that data back to its original location.
Use Data Reduction
One more thing that you may be able to do is to enable deduplication (if you're not already using it). Deduplication removes redundancy from your storage and can help you to gain a lot of space.
The amount of space that you can reclaim by enabling deduplication varies heavily depending on your data. If you have a lot of media files or compressed archive files (such as ZIP files), then deduplication probably won't help you much.
If, however, you have a lot of text or numerical data, then deduplication can save you a lot of storage space.
When you deplete Hyper-V's available storage, then you will eventually have to either add more physical storage or purge aging data. The techniques mentioned in this column are designed to help you buy some time until you can add more storage.
About the Author
Brien Posey is a 21-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.