VMware Cloud Community
goppi
Enthusiast
Enthusiast

Shrink thin vmdk

HI.

Is there any way to shink a thin provisioned vmdk?

We have some machines (Linux ext3 and Windows NTFS) where disk space was temporarily being used for a migration process and now the vmdk's are rather big although the temp files have been deleted. I assume doing a vmkfstools -i is not enough but there also must something being done on the guest OS level.

Thanks for any suggestions.

Cheers.

goppi

0 Kudos
11 Replies
dnetz
Hot Shot
Hot Shot

You can use sysinternals sdelete program to write zeroes to deleted files in windows: http://communities.vmware.com/message/537387

For linux the best options seems to be to "dd" zeroes to fill up all available space and then remove the file, example: http://communities.vmware.com/message/219433

Hope it helps!

goppi
Enthusiast
Enthusiast

Thanks for your answer.

I will report back after I've tried (and assign points of course Smiley Happy)

0 Kudos
depping
Leadership
Leadership

Zero-out by itself is not enough. You will also need to storage vmotion the VM after the zero-out to shrink the VMDK.

Duncan

VMware Communities User Moderator | VCP | VCDX

-


Now available: Paper - vSphere 4.0 Quick Start Guide: Shortcuts down the path of Virtualization | PDF

Blogging: | Twitter:

0 Kudos
goppi
Enthusiast
Enthusiast

I suspect that vmkfstools -i instead of storage vmotion will also do the job?

0 Kudos
AWo
Immortal
Immortal

But with vMotion you doesn't need to shutdown the guest...


AWo

\[: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
goppi
Enthusiast
Enthusiast

@dnetz:

The tip for Windows was a good one. It did the trick.

The linux one however wasn't optimal.

On one box it reduced the size from 18 GB to 6 GB on another one it increased the size from 4 to 6 whereas only 2 GB were used by the filesystem.

So the question remaining is:

Is there anything to optimize the result for linux machines?

Thanks.

Regards.

0 Kudos
AWo
Immortal
Immortal

Have you tried the shrink option from the VMWare Tools, already? You need to have X running for Linux to start the VMware Tools toolbox.

That writes zeroes in the unused space and clones that into a new disk leaving the zeroed areas (renamin etc. is all done automatically). So from the VMware perspective it seems that "some" kind of disk cloning is needed as the VMware Tools themself work this way.


AWo

\[: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
goppi
Enthusiast
Enthusiast

@AWo:

Thanks for that tip. However all servers we are running don't have X installed. Is there any way to trigger this from the command line? Come on we are on linux :smileylaugh:

Cheers,

goppi.

0 Kudos
AWo
Immortal
Immortal

No 8275_8275.gif , except....................................................................................................

.......................................................................................................................

.......................................................................................................................

Storage VMotion. That works even without the VMware Tools.

Why don't you use that? 8276_8276.gif

AWo

\[: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
goppi
Enthusiast
Enthusiast

@AWo:

Storage VMotion is not an option for that customer because of licensing reasons.

Still misterious why shrinking NTFS works quite well compared to ext.

Thanks anyway.

Regards,

goppi.

0 Kudos
stimko
Contributor
Contributor

must be a better way to do this...

will the zero filling max out my thin vmdk file (and fill my datastore)?

0 Kudos