Currently, three major operations are supported by VMware Converter:
- Expanding
- Thinning
- Shrinking
Warning: An effective backup strategy should always be used before performing permanent changes to existing virtual disks.
- Cloning, importing, and converting virtual disks should leave the source files unmodified.
- In addition to the cloning, importing, and converting of a virtual disk, related source-disk snapshot files will be committed to the destination disk when cloning, importing, or converting. However, the original virtual disk and associated snapshots remains unmodified in the original directory.
- Do not alter the base disk in any way without committing all snapshots first or they will be invalidated.
- Changes cannot be made to a disk in use or locked.
- Use VMware Converter, as it streamlines and simplifies the process, further, eliminating some areas where user error can occur.
Note: When using the VMware Converter wizard, you can perform operations on running virtual machines by treating them as physical machines. For more information, see the vCenter Converter Standalone Documentation .
Expanding Virtual Disk
- Select a VM in the inventory and make sure VM doesn't have a snapshot
- SSH into ESXi server
- change the Directory to Virtual Machine directory
Example: cd /vmfs/volumes/VM-DIRECTORY/VIRTUAL-MACHINE
- Virtual disks can be expanded using this ESXi command:
vmkfstools -X <new size> <virtual disk>.vmdk
For example, use this command to grow the virtual disk to 25GB in size:
vmkfstools -X 25g /vmfs/volumes/xxxx/vmname/vmname.vmdk
-
Changes are made to the disk and are almost instant
-
Partitions residing within the virtual disks will not resize and there will be unallocated space at the end of the disk. Third-party partitioning tools are required at this point to resize the primary partition to take advantage of the additional space
-
VMware Converter allows you to specify a new disk size in its conversion wizard. It will also take care of partition resizing for you.
Notes:
Thinning
-
Virtual disks can be thinned so they consume only as much space as there is data residing in the .vmdk.
-
-
In the event that a thinned virtual disk continues to use more space than the operating system residing within it reports, old data in the volume still needs to be zeroed or removed.
- Deletion of files in most file systems will not completely remove them; merely file tables will be altered. Use of freeware secure file deletion utilities are useful, such as Eraser or SDelete to zero out the space to 'zero' the free space on the volume, effectively clearing the free space of data. It is then, that the disk can be properly thinned. You can then use the vmkfstools -K command (ESXi/ESX 4.1 and later) to complete the block reclaim or use Storage vMotion to migrate the virtual machine to a datastore with different VMFS block size.
For process limitations and details, see Storage vMotion to thin disk does not reclaim null blocks.
Shrinking
- Virtual disk shrinking is supported when using VMware Converter converting source virtual machine as a machine source (not as virtual to virtual).
Note: You cannot shrink virtual disks using vmkfstools in ESXi as the hypervisor is not aware of the file system layout and cannot ensure a safe shrink operation.
Before shrinking
- Migrate the data away from the end of the disk consume to ensure the data is not lost (because the disk area is effectively removed). For example, in Windows GuestOS use Disk Management tool.
- Shrink the partition residing within a disk before reducing the size of a virtual disk.
- Non operating system disks users can also add a new smaller VMDK to the virtual machine and copy the data between the larger and new smaller disk using tools within the guest such as Robocopy.