VMware Cloud Community
Wajeeh
Enthusiast
Enthusiast

reduce vmdk which grew during some testing

Dear All,

I've a windows 2008 R2 virtual machine on Esxi 5.0, It have a single drive C:\ partition , which is provisioned as 40GB as thin provision, till today it was using about 20GB of space. There is a reporting utility installed on this machine. Today I was doing some test which quickly added some data to C:\ in windows which also resulted in increased size of vmdk to 38GB now. Now I cleaned the un needed data from C:\ in windows and I got the space but I know this vmdk I can not reduce. But infact 38GB of vmdk is unnecessarily occupying space on my storage because the reporting utility does not need this space.

I am looking for way to have this virtual machine with reduced vmdk as before it was something 20GB vmdk. What choices are available which do not require fresh creation of virtual machine and doing all settings for reporting utility.

I hope my question is clear, if not please let me know.

Waiting for response.

8 Replies
a_p_
Leadership
Leadership

What you can do is to first zero out all unsed disk space within the virtual machine using e.g. sdelete and defrag the disk, then - with the VM poered off - use vmkfstools -K (or --punchzero) <vmname>.vmdk from the ESXi host's command line to reclaim disk space from the zeroed blocks (for a sample see http://www.yellow-bricks.com/2011/07/15/punch-zeros-2/).

André

vNEX
Expert
Expert

Hi,

or you can use VMware Converter its supported and safe way ...

Download:

https://my.vmware.com/group/vmware/info?slug=infrastructure_operations_management/vmware_vcenter_con...

Guide:

VMware Documentation

Regards,

P.

_________________________________________________________________________________________ If you found this or any other answer helpful, please consider to award points. (use Correct or Helpful buttons) Regards, P.
0 Kudos
CedricAnto
VMware Employee
VMware Employee

Have a look at

VMware KB: Storage vMotion to thin disk does not reclaim null blocks

Cedric http://in.linkedin.com/in/cedricrajendran/ http://virtualknightz.com/
0 Kudos
vNEX
Expert
Expert

in addition ... for more details and summary for this topic look at this KB:

VMware KB: Growing, thinning and shrinking virtual disks for VMware ESX and ESXi

Regards,

P.

_________________________________________________________________________________________ If you found this or any other answer helpful, please consider to award points. (use Correct or Helpful buttons) Regards, P.
0 Kudos
Wajeeh
Enthusiast
Enthusiast

Hello,

I don't have facility of storage vMotion because I am using vsphere essentials plus license and this feature is not available, so need to look at other choices people posted here.

thanks,

0 Kudos
CedricAnto
VMware Employee
VMware Employee

Thanks for the update, Also read this excellent blog about Space Efficient Sparse disks by Cormac.

This is currently leveraged for View based linked clone deployments but will have make it to the main branch eventually.

VMDK | CormacHogan.com

Cedric http://in.linkedin.com/in/cedricrajendran/ http://virtualknightz.com/
0 Kudos
vNEX
Expert
Expert

Hi Wajeeh,

have you been successfull  with some of the methods ...vmkfstools/converter _?

Regards,

P.

_________________________________________________________________________________________ If you found this or any other answer helpful, please consider to award points. (use Correct or Helpful buttons) Regards, P.
0 Kudos
Wajeeh
Enthusiast
Enthusiast

Hello vNEX,

I am sorry but still I didn't get chance to work on this, just was reading the information you people contributed in this discussion. Presently I am occupied with many other things, I need some time before I perform this, I hope probably next week. When ever I will do and results surely I will post here for everybody's knowledge.

thanks,

0 Kudos