Hyper-V Dynamic Disk Pros and Cons

http://backupchain.com/i/dynamic-disk-hyper-v-backup-considerations

I was reading the above mentioned article, and it appears to suggest not using dynamic disks if at all possible.  It suggests not using dynamically expanding disks because of reduced performance by increased overhead and fragmentation.

I usually assign the guest VM OS as a fixed disk.  This also applies to virtual disks with databases.  However, for growing company file storage, I usually assign the virtual disk as dynamically expanding with a cap imposed.

I will be installing a new Windows 2016 hyper-v server with two vms.  On one of the two vms I was going to assign the guest os (80Gbs) and a database virtual disk (150Gbs) as fixed virtual disks.  Their company data is currently at 330Gbs, and growing, and I was going assign it as a dynamically expanding disk with a cap of 800Gbs.   As a rough estimate the amount of disk space will probably double within 4 or 5 years.

After reading this article, I may want to consider assigning this virtual disk as fixed (800Gbs), and be done with it.  I understand, a large fixed disk has drawbacks when it comes to moving/restoring the entire drive should that be necessary.  However, fragmentation is just as an important issue over the near/distant future.  Also, I purchased this server with a more than adequate amount of overall disk space to last many years, so disk space is not really an issue.

The article also mentioned the following referencing Dynamically Expanding VHDX:

Use a defragmentation tool once a week (by the way, this can be done while VMs are running) and keep plenty of disk space (over 30%) free to provide plenty of free disk space for growth and as defrag work space.

Not sure if it refers to Windows defrag utility or some sort of third party option.

I am just wondering what your opinions are about this.
cmp119IT ManagerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Cliff GaliherCommented:
Dynamic expanding disks are a good way to get in trouble. If you have any doubt, don't use them.
Lee W, MVPTechnology and Business Process AdvisorCommented:
I cover this in my article Virtual or Physical? - https://www.experts-exchange.com/articles/27799/Virtual-or-Physical.html - see the storage section.  For ease:

There are three ways to configure disks in Hyper-V: A dynamically expanding virtual hard disk, a fixed virtual hard disk, and a pass-through hard disk. Each has its pros and cons.

Dynamically expanding VHD/VHDx drives offer the advantage of using only the space they need. This is not a guarantee however. I have seen dynamic VHDs grow in size well beyond their internally used space and shrinking them is not always possible (it’s not automatic at any point and requires the disk be offline). Assuming the VHDs behave themselves, using dynamic drives provide the advantage of being smaller and thus more easily copied/transferred/replicated to other system. Consider that a 600 GB VHD can take an hour and a half to copy at gigabit speeds – 30-45 minutes at best with USB 3 to an SSD, but if only 95 GB is used and hence the VHD size is only 100 GB, it will go much faster. Dynamic VHDs also allow you to overcommit your disk space. Want to allow 5 servers to each see 1 TB of space available when you only have 3 TB of total physical disk? Use Dynamic VHDs and they will.

You do need to be careful when using Dynamic Disks. If they grow to a point that the physical disks fill, Hyper-V will “Pause-Critical” all the VMs that have disks on that volume. If there was nothing else stored on that volume that you could move or delete, you might find it difficult to restore the VMs to a working state. In addition, Dynamic VHDs can fragment if there are any other files on the drive/partition on which they are located, causing a degradation in performance.

Fixed virtual hard disks will occupy exactly as much space as they are to provide (plus a small bit of extra overhead).  Using fixed drives prevents issues with fragmentation, “Paused-Critical” events with VMs, and slightly improved overall performance. Their very large size though can reduce your ability to rapidly move, copy, or replicate them to another location.

Pass-through disks can be handy for connecting external USB drives. But they can also cause problems if they are removed from the host without being removed from the VM. They also prevent replication and clustering since the disks cannot be replicated in the same way VHDs can. Generally, I recommend the use of pass-through disks only on a temporary basis.

I generally prefer dynamically expanding hard disks. To combat the possible issues with fragmentation, I sometimes partition the VHD storage drive. This can prevent fragmentation while keeping the file small and technically overcommitted in available disk space. In some cases, I’ve used the FSUTIL command to create several large temporary files - fsutil file createnew v:\file1.tmp 10000000000 - that I could delete as necessary, buying time to order and install additional drives to provide the space needed. This can help prevent difficulty in recovering from “Paused-Critical” states due to disk space, though it can also increase the likelihood of having those events.

Finally, NEVER partition your VHDs. There’s no point. Why create a VHD with a C: and D: partition when you can have TWO VHDs which can subsequently be expanded as necessary and easily through the VM’s configuration and internally through disk management. For every partition you want within a VM, create a VHD.
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
Back in the .VHD (2008 era) we used FIXED VHD files because the performance of the dynamic VHD was poor in comparison.

By 2012 RTM any differences between fixed and dynamic VHDX files was negligible.

We do the following:
 + 1: All OS VHDX files get a fixed 75GB or 95GB VHDX
 + 2: All Data VHDX files get a fixed VHDX for 350GB-450GB or less sizes
 + 3: All Data VHDX files that are 500GB+ get a Dynamically expanding VHDX file

In a disaster recovery scenario the dynamic VHDX is easier to move around than one large 2TB VHDX file!

And finally:

SUM GB/TB TOTAL SIZE of all VHDX files <= Total Available Space less 10% on NTFS on physical partition (as a rule)

Where a calculation error is made and the sum of the VHDX files exceeds the available space on the partition all VMs will go Paused Critical requiring manual intervention.

Also, important to note: Snapshots/Checkpoints create a differencing VHDX file. That file is dynamically expanding! Thus, leaving a snapshot/checkpoint in place is certain to cause a Paused Critical state that one needs to be mindful of.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

cmp119IT ManagerAuthor Commented:
I may actually consider changing the existing virtual disks from dynamically expanding to fixed then.  I generally purchase servers with plenty of disk space, so that I do not need to deal with the hassle of juggling disk space with growth spurts over time.  

So, is it a problem switching from an existing dynamic expanding disks to fixed disks without harming the resident data.  If so, do you have the procedures? I just want to make sure if the change is possible that its done right.  Thanks.
Lee W, MVPTechnology and Business Process AdvisorCommented:
Keep in mind your data transfer if you want to move those systems to another host could take much longer with fixed disks since they are "full size"
cmp119IT ManagerAuthor Commented:
I can live with that.  I prefer having virtual disks that are larger, with less overhead, and not have to worry about fragmentation issues.  

So, is it a problem switching from an existing dynamic expanding disks to fixed disks without harming the resident data.  If so, do you have the procedures? I just want to make sure if the change is possible that its done right.  Thanks.
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
The reason we use the above mentioned method is to avoid fragmentation. Though, in today's multi-disk systems fragmentation is not as much of an issue as it used to be.
cmp119IT ManagerAuthor Commented:
I think I will keep everything as is meaning the Guest os drive as fixed, and attached virtual drives as dynamically expanding.  Not sure how much fragmentation will take place within the long term though.  Referencing the new server setup, I may make all disks fixed, even a large 600gb drive for company file storage.
cmp119IT ManagerAuthor Commented:
Thank you for your feedback.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Virtualization

From novice to tech pro — start learning today.