crescendas
Enthusiast
Enthusiast

How to recover space free from thin provisioning?

One of our VMs which hold plenty of temporary SQL backups is currently using maximum storage of 300GB despite on a thin provisioning volume where there is only 30GB of data. How do we proceed to free up that 270GB that thin provisioning grab for temp files and does not release back to the storage?

We have already run sdelete in Windows and have tried the shrink function found in the

vmtools, but the 300GB usage remains.

btw, is there a way to copy VM with thin provisioning to external storage as backup without having it converted to FAT automatically?

0 Kudos
9 Replies
a_p_
Leadership
Leadership

How do we proceed to free up that 270GB that thin provisioning grab for temp files and does not release back to the storage?

Take a look at VMware ESX 4 Reclaiming Thin Provisioned disk Unused Space and make sure you also read the comments if you don't have SVmotion available.

btw, is there a way to copy VM with thin provisioning to external storage as backup without having it converted to FAT automatically?

There are several options for backing up VM's. Depending on the ESXi license you could use commercial solutions like Veeam or Vizioncore's vRanger. As a free alternative, take a look at ghettoVCB or you can just shutdown the VM and use e.g. Veeam's free FastSCP and copy the files to you backup disk.

André

0 Kudos
AWo
Immortal
Immortal

The shrink function of the VMware Tools does not work with ESX(i) and thin provisioned disks. You need to sVMotion the disk to another datastore, using "thin" as the target format.


AWo

VCP 3 & 4

\[:o]===\[o:]

=Would you like to have this posting as a ringtone on your cell phone?=

=Send "Posting" to 911 for only $999999,99!=

vExpert 2009/10/11 [:o]===[o:] [: ]o=o[ :] = Save forests! rent firewood! =
0 Kudos
crescendas
Enthusiast
Enthusiast

Hi, we do not have vMotion, not to mention storage vMotion. Base on the comments, migrating to another storage is not possible as we only have 1 storage. What I can think of is to clone the VM using thin provisioning and delete the original VM.

For backing up, I have tried a few. Unfortunately none of them is able to copy the VMs without converting to FAT provisioning, including Veeam's free FastSCP.

0 Kudos
a_p_
Leadership
Leadership

Hi, we do not have vMotion, not to mention storage vMotion. Base on the comments, migrating to another storage is not possible as we only have 1 storage. What I can think of is to clone the VM using thin provisioning and delete the original VM.

Worth trying. You only need to clone the vmdk and detach/attach it in the VM's settings.

- vmkfstools -i /vmfs/volumes/datastore/YourVM/YourVM.vmdk -d thin /vmfs/volumes/datastore/YourVM/YourVM-C.vmdk

If using snapshots, make sure to specify the latest snapshot vmdk as the source.

For backing up, I have tried a few. Unfortunately none of them is able to copy the VMs without converting to FAT provisioning, including Veeam's free FastSCP.

In the early days of ESX 4.0 I had an equal challenge. In the end I temporarily renamed the vmdk files to e.g. ..vmdk.xxx. This way they were not recognized as valid vmdk files anymore and treated as normal files during download, thus not inflating to thick format. Not sure if this still works.

André

AWo
Immortal
Immortal

Hi, we do not have vMotion, not to mention storage vMotion. Base on the comments, migrating to another storage is not possible as we only have 1 storage. What I can think of is to clone the VM using thin provisioning and delete the original VM.

Yes, that'll work. It even works while the guest is online, but you may don't want to do that as you may get different contents on the disk.

Haven't tested that yet.


AWo

VCP 3 & 4

\[:o]===\[o:]

=Would you like to have this posting as a ringtone on your cell phone?=

=Send "Posting" to 911 for only $999999,99!=

vExpert 2009/10/11 [:o]===[o:] [: ]o=o[ :] = Save forests! rent firewood! =
0 Kudos
crescendas
Enthusiast
Enthusiast

I'm not sure what is vmware intention for purposefully disabling thin provisioning whenever vmdk is copied out of it's storage, but rename vmdk extension to trick it from converting to FAT is a really good idea. Unfortunately when I attempt to do this, vSphere Client shows this:

"At the moment, vSphere Client does not support the renaming of virtual disks as the machines that use this disk may loose access to the disk."

I'm quite surprise that vmware, while given us thin provisioning functionality, forget to provide us with a proper tool to manage it. Shrinking thin provisioning should be an essential feature of a vCenter unless thin provisioning does not come with it.

In order to run vmkfstools on ESXi 4.0, does this mean that I have to do it on the unsupported technical support mode? Anyway, I have tried vmkfstools on the free ESXi for testing purpose and the cloned vmdk file only shrink about 5% despite having more than 50% free space in the volume. Why is this so?

btw, I have mark your reply as helpful. Thanks a.p.!

0 Kudos
a_p_
Leadership
Leadership

"At the moment, vSphere Client does not support the renaming of virtual disks as the machines that use this disk may loose access to the disk."

You have to do the rename on the CLI, this will not work in the datastore browser (as you already found out).

In order to run vmkfstools on ESXi 4.0, does this mean that I have to do it on the unsupported technical support mode?

Yes. (BTW in v4.1 this is not unsupported anymore.)

Anyway, I have tried vmkfstools on the free ESXi for testing purpose and the cloned vmdk file only shrink about 5% despite having more than 50% free space in the volume. Why is this so?

Did you follow the link in my previous post and use sdelete to zero out unused space before cloning the disk?.

André

0 Kudos
crescendas
Enthusiast
Enthusiast

Hi André,

My apologise. I ran sdelete on another VM. It does shrink from 20GB to 14GB after cloning the drive I ran sdelete.

However, when I attempt to rename vmdk file to tmp, the 14GB size automatically become 20GB until I rename it back to vmdk where it reported 14GB again. So I guess renaming wouldn't work in my case?

btw, there are 2 vmdk files where one seems to be alias/shortcut pointing to the flat file which is the actual vmdk content. I tried on both.

0 Kudos
crescendas
Enthusiast
Enthusiast

I think my problem is not resolved yet because I realize that deleting or migration VMs away from a thin provisioned SAN storage does not return the storage back to the SAN until I zero fill the VMDK files first before deleting. But I can't possibly zero fill the VMDK files I want to migrate to another storage right? Please advise.

0 Kudos