Quantcast
Channel: VMware ESXi – The Wiert Corner – irregular stream of stuff
Viewing all articles
Browse latest Browse all 250

ESXi: shrinking a thin provisioned disk by first exploding it with zero content

$
0
0

In addition to ESXi: shrinking a Windows disk, you can shrink any ESXi thin provisioned disk by first exploding it with zero content, then shrinking it like described by [WayBack] How to Shrink a Thin VMDK on ESXi 5.0 | Boerlowie’s Blog.

It comes down to using this command:

 vmkfstools --punchzero myVirtualMachineDisk.vmdk

You can replace --punchzero with -K if you like more cryptic arguments.

This works because thin provisioned vmdk disk files are sparse files where zero content can be non-allocated.

The trick requires all empty space to be zeroed out (which usually comes down using a tool like sdelete on Windows or shred on Linux), hence the “exploding” in the post title.

For a good explanation on thin, versus thick versus eagerlyZeroedThick, read [WayBackThin Provisioning – What’s the scoop? – VMware vSphere Blog.

A few remarks:

  • this only works within datastores, so when you transfer your file out, then the file will be the thick size
  • an OVF exported virtual machine will benefit from thin provisioned disks
  • the du command will show the actual storage size (including the savings from think provisioned disks)
  • the ls command will show then “virtual” storage size (excluding any thin provisioning gains)
  • the difference between ls and du output is the thin provisioning gain

–jeroen


Viewing all articles
Browse latest Browse all 250

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>