VMware vSphere

 View Only
  • 1.  vmdk does not shrink after deleting files

    Posted Jul 15, 2010 02:46 PM

    I have a Windows 2003 server VM on ESXI 4 that seems to be having a disk space problem.

    The VMDK does not shrink after I delete files from the WIndows disks.

    The VMDK is now about 160GB when I look at it in the datastore.

    vSphere says the used storage is 159GB. This does not change when I click "Refresh Storage Usage" or when I right-click on the datastore and select "Refresh".

    Provisioned storage is 180GB since the disks are thin provisioned.

    I have restarted the VM as well as the whole server.

    When I look at Windows through the console there are 3 disks that are about 30GB, 130GB and 15GB, that have 10GB, 90GB and 13GB free space respectively.

    So by my calculations, I should 20GB + 40GB + 2GB used space, or 62GB total.

    So where is my 100GB?

    CHKDSK shows no problems. The 130GB partision was almost full at one time and after I deleted files, the VMDK never shrunk!

    Any ideas?

    TIA-

    -Michael



  • 2.  RE: vmdk does not shrink after deleting files
    Best Answer

    Posted Jul 15, 2010 02:51 PM

    Even though you have deleted files the disk has been written to and old data still exists on the disk. You need to actually remove the old raw data from the disk (sdelete in Windows) and then shrink the disk.



  • 3.  RE: vmdk does not shrink after deleting files

    Posted Jul 15, 2010 03:43 PM

    OK. Giving me the keywords (thank you) opened up a wealth of information but leads me to a sad conclusion.

    So, in a nutshell, I can run sdelete but I will have to use vmware converter or vmotion (which I don't own) after that to copy the vmdk to a smaller file. I can't do it in place because doh! I have no free disk space on my datastore because doh! my vmdk is bloated.

    This, IMO, pretty much negates all the advantages to thin provisioning. I may as well use thick. The used storage will increase on its own but not shrink.

    Am I understanding this situation correctly?

    Thanks-

    -Michael



  • 4.  RE: vmdk does not shrink after deleting files

    Posted Jul 15, 2010 03:58 PM

    Am I understanding this situation correctly?

    Yes, you are. There are some VMs, or disks in VMs, that just aren't good candidates for thin provisioning. Sounds like this VM might be one of those. The other reality is that even after you sdelete it and clone/move it, the drive could grow right back out to the same size again in short time.



  • 5.  RE: vmdk does not shrink after deleting files

    Posted Jul 15, 2010 05:01 PM

    I know this is getting ito a different area, but is it possible to make the drive that grows (the one that has database files, not the OS) in a different file in the datastore, so that when it gets bloated, I can do a backup, delete it, recreate it and do a restore?

    This may be be an acceptable and quick way to solve my problem in the future.



  • 6.  RE: vmdk does not shrink after deleting files

    Posted Jul 15, 2010 05:07 PM

    Yes, you can, and probably should, have a 1-1 volume to vmdk relationship. This simplifies many things operationally.



  • 7.  RE: vmdk does not shrink after deleting files

    Posted Jul 15, 2010 05:21 PM

    Many thanks, vmroyale. You da big dog! I will try out the 1:1.



  • 8.  RE: vmdk does not shrink after deleting files

    Posted Jul 15, 2010 02:53 PM

    Hello and welcome to the forums.

    There is some good information on this in this discussion.

    Good Luck!