VMware Communities
Dryne
Enthusiast
Enthusiast

Fragmentation Questions

My filesystem is primarily ext4, which is a journaling filesystem.  There is generally no need to defragment these.  I do run a few Windows guests that run NTFS.  I am assuming that I should continue to defragment the virtual machines every so often.  I am noticing that VMWare has options to defragment the virtual disk file that resides on ext4.  Why is this here?  Also, am I correct to still defragment the NTFS guests under Windows?

 

Reply
0 Kudos
5 Replies
wila
Immortal
Immortal

Hi,

Why would you not have to defragment a journaling file system? While ext4 is smarter on where to place its new files on a disk, it does not exclude fragmentation. In fact as we are talking about large files and limited disk space, the more your disk is filled, the more risk of fragmentation you have.
At least ext4 has a defragmentation option.

But let's go back, on today's fast disk systems, it does make less sense as the win is not as big. On an NVMe disk, a fragmented disk system does not hamper performance as before (an understatement). On a normal SSD you can actually notice it, but on a spinning disk the difference can be huge. So the answer on your question is that it depends on the disks that you use in your host OS and on the total amount of free space in your disk partition.

There's actually 3 levels that your disk can be fragmented, not including adding snapshots to the list.
The host file system (ext4 in your case), the vmdk file itself and the guest operating file system.
One of VMware's developers explains it really well here: https://superuser.com/questions/1004374/will-fragmentation-of-a-virtual-machines-disk-also-cause-hos...

hope this helps,
--
Wil

 

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
Reply
0 Kudos
Dryne
Enthusiast
Enthusiast

I have been installing lots onto my machine now.  Even after all these installations, my primary ext4 / partition is 50% free.  With this much free space on ext4, fragmentation should not exist or be an issue at all.  If my disk space was near full, then yes -- fragmentation would be higher.  I run hard drives and not SSDs.  This is the only reason I am even considering defragmentation.

 

Reply
0 Kudos
Dryne
Enthusiast
Enthusiast

Interestingly enough after my Ultradefrag boot defrag completed from my guest, I received a warning from VMWare Workstation about fragmentation and was prompted to defrag the vmdk file.  This file is up to 1.5TB in size now.  I did choose to defrag it, and now it has been running for several hours at just 74% completion.  This second defrag is taking just about the same time as the initial Ultradefrag boot defrag took.

 

Reply
0 Kudos
wila
Immortal
Immortal

Are you using a single file virtual disk instead of split files perhaps? That could explain this huge time to rebuild the disk.
FWIW on desktop virtualisation platforms like VMware Fusion/Workstation I strongly recommend to use the split disk scheme.

The split disk scheme is the default and as usual the recommendation is to always go with the defaults

The virtual disk split file is really the best choice even while it may seem a bit unlogical at first.

With split files you:

  • get a better response, faster results when doing any VMware disk operation such as snapshots, shrink, compact, extend and defragment.
  • have less chance of getting into a "all data lost" scenario when something bad happens such as running out of disk space as the split disk file scenario is much easier to repair than a growing single disk.
  • don't need to have the full virtual disk size on free disk when committing snapshots


There seems to be a notion of "but it will be less performant", but in practice that is just not true.

My recommendation is to not try to consolidate a virtual disk into a single disk file, you are not doing yourself a favor by doing so.

--
Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
Reply
0 Kudos
Dryne
Enthusiast
Enthusiast

Thanks for the suggestion, and I will note this for the future.

 

For now I am going to simply stop defragging ext4 and turn off all the VMWare warnings warning about fragmentation.  Until I see evidence of fragmentation impacting performance under ext4, I consider this false and misleading alerts.

Reply
0 Kudos