VMware Cloud Community
olegarr
Enthusiast
Enthusiast
Jump to solution

Defragmentation VM take a lot of disk space

Hello:

I have a question about Defragmentation of VMs.

When I am doing defragmentation of VM it eats a lot of space from my datastore and creates files Vmname-0001-delta.vmdk & Vmname-0001.vmdk which take a lot of space (GBs). Looks like I cannot delete those files (VM will crashes).

Why? Does it mean that I cannot do defragmentation at all?

I am using built in Windows “Disk Defragmenter”; may be I should use a different tool, like “Disk Keeper” or something else?

Thank you very much in advance,

olegarr

Reply
0 Kudos
1 Solution

Accepted Solutions
sbeaver
Leadership
Leadership
Jump to solution

If you have no snapshots then things will not grow and everything will stay in the current vmdk file

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**

View solution in original post

Reply
0 Kudos
6 Replies
sbeaver
Leadership
Leadership
Jump to solution

What mode is your disk in and do you have any snapshots? I think you have a snapshot and when you defrag it really adds to the delta fiile quick

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
mcwill
Expert
Expert
Jump to solution

It sounds as though you have an active snapshot of the VM you are attempting to defragment.

At a simple level....

Snapshots work by freezing the Virtual hard drive file and then creating a delta file that is a list of the changes made to the hard drive since the snapshot was taken.

If the snapshot is thrown away then the delta is combined into the original vmdk and the file is unfrozen.

If the VM is reverted back to the snapshot then the delta file is discarded and the original vmdk is unfrozen.

This method of snapshotting is very efficient as it effectively allows you to take a copy of a hard drive very quickly and uses very little additional disk space. Unless you make a large change to the disk drive of the VM, such as defragmenting it.

Another disadvantage of having an active snapshot on a VM which is then defragged is that if you later elect to discard the snapshot, it will take a long time to combine the changes held in the delta file into the original hard drive file of the VM.

olegarr
Enthusiast
Enthusiast
Jump to solution

sbeaver,

thanks for your replay.

My disk is in persistant mode and yes, I do have 1 snapshot.

So, do you think that if I will remove my snapshot the used space will not grow? Or the main *.vmdk file will grow instead of *delta.vmdk?

Is there any way to do defragmentation of VM without lose some space?

thanks

Reply
0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

If you have no snapshots then things will not grow and everything will stay in the current vmdk file

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
Reply
0 Kudos
olegarr
Enthusiast
Enthusiast
Jump to solution

Thanks for your help

Reply
0 Kudos
Gabrie1
Commander
Commander
Jump to solution

VMware just released a performance whitepaper for Workstation 6. In it they write about defragmenting a VMDK with active snapshot. In short, its like you've read above, the delta will grow and performance will NOT improve \!!!

Gabrie

http://www.GabesVirtualWorld.com
Reply
0 Kudos