PerfectDisk Defrag Software

Zero-fill Free Space and Thin-Provisioned Disks

An Intelligent Alternative to the S-Delete Utility:
Zero-fill Free Space and Thin-Provisioned Disks

At a time when virtualization, thin-provisioning and zero-detection SANs are becoming the de facto standards in corporate IT, there is a need for a simple tool that helps recover wasted free space being held in virtual machines.

S-delete Utility

The problem with thin-provisioned disks is that they never get any smaller on their own. If a customer creates a 100GB disk and only uses 20GB there will be a virtual disk on the ESX datastore that uses 20GB.  If that customer subsequently performs an operation that temporarily requires another 40GB the virtual disk on the datastore expands to 60GB. When the temporary 40GB of files are deleted, the user will find that the virtual disk is still 60GB in size.  This means 40GB of space on the datastore is being wasted.

An often suggested solution to this problem is to use Sysinternal’s  S-delete utility to zero fill the free space on the virtual disk.  S-delete is slow and resource intensive, but it does what it advertises. S-delete works by creating a file the size of the total free space on the disk and filling that file with zeros. Needless to say, if an application on the virtual machine needs to write to the disk while S-delete is running there is the possibility of having insufficient free space to complete the write.   If the virtual machine is running SQL Server or Exchange these applications need to be shut down. If the machine is running as a print server then print services need to be shut down.  

When S-delete runs you will see some expansion of the used storage; this is expected since S-delete is creating a file that consumes all the free space. Once S-delete completes you need to run a Storage VMotion on the virtual machine. This needs to be done to move the virtual disk to another datastore in order for the shrink to take place. After the VMotion our sample virtual disk should be back to about 20GB.

PerfectDisk

PerfectDisk offers a fully automated alternative to S-delete with some additional positive benefits. PerfectDisk uses a standard Microsoft installation to install on any Windows guest system. It optimizes all the files on the guest and consolidates the free space into the largest possible contiguous chunk.  PerfectDisk optionally zero-fills the consolidated free space offering several advantages over the S-delete utility. First, PerfectDisk does not consume all the free space on the disk so applications can remain in use while it is running. Second, the zero-fill process can be scheduled to run standalone or after an optimization pass. The scheduling is just a few clicks in the Scheduling wizard; no scripting or messing with Task Scheduler is needed. 

There may be some growth on the thin-provisioned disk when PerfectDisk optimizes, but if the disk is identified as thin-provisioned PerfectDisk will use special algorithms that minimize storage growth. The same VMotion operation is required after the zero-fill operation to recover the free space. As with S-delete, be sure to do the VMotion to another datastore in order for the shrink to take place.

Performance Benefits

Aside from shrinking the virtual disk PerfectDisk offers several additional benefits not available with S-delete.  In any virtualized environment there are several key performance metrics to watch. PerfectDisk can have a significant impact on:

  • total I/O operations (IOPS)
  • disk latency
  • throughput 

File fragmentation increases the number of SCSI commands that need to cross the virtualization storage stack to read a file.  For example:  a file in 10 fragments generates 10 SCSI commands while the same file in one piece generates a single SCSI command.  PerfectDisk reduces the number of IOPS processed by the virtualization layer and lowers the associated resource demand for CPU and memory.

Each SCSI command requires one or more physical accesses to the disk. Since defragmentation reduces IOPS this means the IOPS it does produce are larger. Fewer and larger IOPS means fewer physical accesses to the disk. Disk accesses are a factor in disk latency, the time it takes an I/O to complete. Since PerfectDisk reduces the total physical accesses to the disk the latency improves. In testing on a VMware platform the number of I/O taking over 30ms (VMware’s definition of slow I/O) was cut by 50%.

The combination of fewer and larger I/O means less hypervisor overhead and fewer physical disk accesses so more work gets done per unit of time. Testing of software installations showed PerfectDisk improved the elapsed time to install by 25-33% over the fragmented disks.

If a thin-on-thin environment is using a zero-detect SAN, the hardware will be able to recover the free space PerfectDisk zero-fills after the compaction of the virtual machine.

Summary

While thin-provisioning saves labor in the data center it has the potential to waste a great deal of disk space. Up to now the only way to remedy this situation was to use a manual utility that zero-fills the free space when the virtual machine is not in use. This, in combination with a VMotion under VMware, shrinks the disk and recovers unused space.

PerfectDisk provides the thin-provisioned disk user with an automated solution to zero-filling the free space and allows this to happen while the virtual machine is in use. A compound benefit is that a defragmented Windows guest system reduces hypervisor overhead and disk latency while improving system throughput. The zero-fill capability is included with PerfectDisk Server, PerfectDisk Exchange and PerfectDisk vSphere and PerfectDisk Hyper-V.