Vmkfstools Windows 10

After you create a virtual machine, you can use the vmkfstools command to extend the size of a disk allocated to the virtual machine. Train sim world csx heavy haul download.

The newSize parameter defines the entire new size, not just the increment you add to the disk. For example, to extend a 4-g virtual disk by 1 g, enter: vmkfstools -X 5g disk name. You can extend the virtual disk to the eagerzeroedthick format by using the -d eagerzeroedthick option. When you use the -X option, the following considerations apply. This can be resolved by resizing the volume using vmkfstools from the ESX command line:vmkfstools -X g Once the copy completes, proceed to the Cleanup section of this article to continue. When the transfer completes, access your vSphere environment.

Vmkfstools

Specify the newSize parameter adding an appropriate unit suffix. The unit type is not case-sensitive. vmkfstools interprets either k or K to mean kilobytes. If you do not specify the unit type, vmkfstools defaults to kilobytes.

Vmkfstools

The newSize parameter defines the entire new size, not just the increment you add to the disk.

This gives us a 36 GB size (while the VM itself actually uses about 10 GB). Issue the command vmkfstools –punchzero VM.vmdk. This will take a while so be patient (and oh yes, you VM must be powered off). On a 40 GB VMDK it took me about 10 minutes, but this will depend mostly on your SAN speed.

Vmkfstools Windows 10

Windows

Vmkfstools Windows 10 Download

Vmkfstools

For example, to extend a 4-g virtual disk by 1 g, enter: vmkfstools -X 5gdisk name.

Vmkfstools windows 10

You can extend the virtual disk to the eagerzeroedthick format by using the -d eagerzeroedthick option.

When you use the -X option, the following considerations apply:

  • Do not extend the base disk of a virtual machine that has snapshots associated with it. If you do, you can no longer commit the snapshot or revert the base disk to its original size.
  • After you extend the disk, you might need to update the file system on the disk. As a result, the guest operating system recognizes the new size of the disk and can use it.

Sometimes you need to shrink a thin provisioned VMDK file after a lot of data has been removed as we all find out the hard way that thin provisioning is great for allowing a disk to grow as data fills it up but with the caveat that the disk will not shrink again automatically when data is removed. Hopefully this quick guide will help you to achieve just that.

Please note this will just reduce the VMDK’s size on the datastore, it will NOT change the provisioned size of a thin disk.

To shrink a VMDK we can use an ESX command line tool vmkfstools, but first you have to zero out any free space on your thin provisioned disk. On Windows guests we can use the sysinternals tool SDelete (replace the [DRIVE:] with the relevant Windows drive letter) you must use v1.6 or later!:

This will fill any unused space on the drive specified with zero-blocks.

Vmkfstools Windows 10 64-bit

Caution: This operation will expand your thin-disk to its maximum size, ensure your datastore has the capacity to do this before you run this operation.

As of v1.6 -c and -z have changed meanings, many instructions say -c zeros free space, this is no longer the case, it zeros the space then fills with random data in accordance with DOD spec: DOD 5220.22-M, the trigger to zero space with 0x00 has changed to -z! On linux guests use:

Again, replace [PATH] with the relevant path to a location on the target storage device. Next we will shut down the guest OS and SSH into the ESX shell, once in the shell we need to navigate to the VMDK’s datastore -> directory and we’ll check the VM’s actual size:

Vmkfstools Windows 10 Pro

Punch all zeroed blocks out of the VMDK:

Check the size again (should now be less):

Make sure to replace [DISKNAME] with your VMDK’s actual name. That's it, all the free space should now be reclaimed.