VMware Cloud Community
Brandon7a
Contributor
Contributor
Jump to solution

Defragging a VM

We are using Diskeeper to defrag our virtual servers. Is defragging a VM recommended and what is actually being done when you defrag a VM?

Thanks

0 Kudos
1 Solution

Accepted Solutions
johthi
Enthusiast
Enthusiast
Jump to solution

What physical machine do for defragmentation the same thing is happenning in VM defragmnetaiotn,.

If you get VM slow performance then you have to take one of the solution like defrag....

If this informationis helpful, please mark it CORRECT or HELPFUL

View solution in original post

0 Kudos
10 Replies
johthi
Enthusiast
Enthusiast
Jump to solution

What physical machine do for defragmentation the same thing is happenning in VM defragmnetaiotn,.

If you get VM slow performance then you have to take one of the solution like defrag....

If this informationis helpful, please mark it CORRECT or HELPFUL

0 Kudos
java_cat33
Virtuoso
Virtuoso
Jump to solution

Whatever you do.... DO NOT DEFRAG THE VM WITH AN ACTIVE SNAPSHOT. Because so many blocks on the disk are changed - all these changes will make your snapshot massive.

There is nothing wrong with defragging a disk on a VM however.

VMmatty
Virtuoso
Virtuoso
Jump to solution

I agree with the other posters regarding defrag. You'll do it for the same reason you would in a physical server. One more point to keep in mind is that a defragmentation is a heavy I/O operation. On a physical server this only affects the server being defragmented, but when you run this on a virtual machine you potentially impact the performance of all VMs on that datastore or potentially the entire SAN. Don't run too many at one time and always do it during off hours.

Matt | http://www.thelowercasew.com | @mattliebowitz
Brandon7a
Contributor
Contributor
Jump to solution

I do have auto defrag turned off b/c of our VCB backups. I do not want it defragging while a VCB backup is happening. If I planned to defrag them I would manually run it probably on a weekend.

0 Kudos
TomHowarth
Leadership
Leadership
Jump to solution

Defragging is acceptable in all but the following circumstances, LISTEN IN THIS IS VERY IMPORTANT.

DO NOT UNDER ANY CIRCUMSTANCES DO A DEFRAG IN GUEST THAT ARE

A: Thin Provisioned

B: Contain a Snapshot

C: Are a Linked Clone.

Doing so will immediately increase the size of the VM. in the case of a Thin Provisioned or Linked Clone the VM will suddenly grow to the size of the actual Disk ie, if your "real size" of disk is 30GB and your thin provisioning or LinkedClone are using 5GB for real space. you will have a 30 GB machine.

in the case of a Snapshot your snapshot will suddenly grow to the size of your flat file. again not good.

One other comment is the overhead that a defrag will place on the Virtual Host machine

If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points

Tom Howarth VCP / vExpert

VMware Communities User Moderator

Blog: www.planetvm.net

Contributing author for the upcoming book "[VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment|http://my.safaribooksonline.com/9780136083214]”. Currently available on roughcuts

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
0 Kudos
DiskeeperSuppor
Contributor
Contributor
Jump to solution

Hello Tom,

I looked at your response regarding disk defragmenters. The information you mentioned is true for most defragmenters. However, Diskeeper is

different from most defragmenters and does the following to address the issues you mentioned:

Defragmentation software can cause the drive to fill up when snapshots are enabled. The increased movement of files through the

defragmentation process can cause excessive snapshots to occur and can cause expansion of a guest operating system. Diskeeper is different from other

defragmenters in that Diskeeper has a VSS option within the program that will reduce the number of snapshots created by the operating system. It should be

further noted that the amount of space used by these snapshots can be set\adjusted by the operating system to reduce the amount of space taken up by

these snapshots. In Windows operating systems, the VSSAdmin tool will allow you to set the amount of space used by snapshots.

With regards to the expansion of the guest operating system, defragmenters can expand the size of the guest operating system by moving files

to a location where the defragmenter believes is the end of the disk. Diskeeper is different from these defragmenters in that it will move files to what is

determined as the best location in the guest operating system. In tests performed on Compellent SANs with Thin Provisioning, Compellent noticed

problems with the Windows built-in defragmenter that did not exist when using Diskeeper. Due to this testing, Compellent recommends using our defragmenter

over the Windows built-in defragmenter. I can provide more information on this and the testing performed by Compellent.

I also wanted to mention that we are VMware certified and Diskeeper is listed on the VMware partner page:

At Diskeeper Corporation, we are continuously working on improving our product by designing a defragmentation algorithm that is aware

that thin provisioned volumes can grow unnecessarily.

Please let me know if you would like to test Diskeeper in your environment and I can send you a copy of our software to test with

Best Regards,

Mark Harrer

Sales Engineer

Diskeeper Corporation

0 Kudos
PeteKowalsky
Enthusiast
Enthusiast
Jump to solution

Mark,

Do you have any more recent white papers on this topic -- the one referenced on your partner page is 3 years old, and seems to mostly reference hosted virtualization platforms. I might be interested to read a more recent study / paper on the topic as it relates to a real bare-metal hypervisor.

Regards,

Pete Kowalsky - VCP3, CISSP, CCNP, CCSP, ADHD, blah blah blah

(Points for helpful / correct are appreciated...)

Regards, *Pete Kowalsky - VCP3, VCP4, CISSP, CCNP, CCSP, ADHD, blah blah blah* +(Points for helpful / correct are appreciated...)+
0 Kudos
PeteKowalsky
Enthusiast
Enthusiast
Jump to solution

In looking at your product's most recent documentation, the VSS options are for Volume Shadow Copy Service, which is not 100% related to VMware ESX's .vmdk virtual disk snapshot sizes (though VMware Tools uses VSS to quiese the local filesystem on those Windows guests prior to a snapshot). Also, not trying to be a jerk here, but I suspect two things: 1) Tom will chime in here and set the record straight if necessary, and 2) due to Diskeeper's partnership with Microsoft (re: V-locity), you can probably make these claims more compellingly in the Hyper-V forum(s)... Smiley Wink

Regards,

Pete Kowalsky - VCP3, CISSP, CCNP, CCSP, ADHD, blah blah blah

(Points for helpful / correct are appreciated...)

Regards, *Pete Kowalsky - VCP3, VCP4, CISSP, CCNP, CCSP, ADHD, blah blah blah* +(Points for helpful / correct are appreciated...)+
0 Kudos
DiskeeperSuppor
Contributor
Contributor
Jump to solution

Hi Pete,

I have attached the the latest version of our Virtualization Paper. This white paper does not have information related to the bare-metal hypervisor but I also attached some data on a test that was performed in a customer environment running Diskeeper on guest operating systems on an ESX Host

Even though this test is not an official white paper, the testing performed by our VP of Technical Support demonstrates the advantage of running our product in a guest OS under a bare metal architecture.

Mark Harrer

Sales Engineer - Diskeeper Corporation.

0 Kudos
PeteKowalsky
Enthusiast
Enthusiast
Jump to solution

Thanks Mark -- I'll have a look!

Regards,

Pete Kowalsky - VCP3, CISSP, CCNP, CCSP, ADHD, blah blah blah

(Points for helpful / correct are appreciated...)

Regards, *Pete Kowalsky - VCP3, VCP4, CISSP, CCNP, CCSP, ADHD, blah blah blah* +(Points for helpful / correct are appreciated...)+
0 Kudos