Using vmware-virtualdiskmanager to Convert Vmware Disks

I have a virtual machine with a single “monolithic” vmdk disk that I’ve been running for some time. Recently I changed backup routines and started using an external disk.

Since my Vmware vmdk was 14GB in size it would not fit on the external fat32 disk.

After a bit of research I discovered the following article which mentions the “vmware-virtualdiskmanager” utility.

A quick “vmware-virtualdiskmanager –help” revealed a full array of commands shown below which allows you to defragment, shrink, and convert your vmdk files among other things.

VMware Virtual Disk Manager - build 56528.
Usage: vmware-vdiskmanager OPTIONS diskName
Offline disk manipulation utility
Options:
-c : create disk; need to specify other create options
-d : defragment the specified virtual disk
-n source-disk : rename the specified virtual disk; need to
specify destination disk-name
-q : do not log messages
-r source-disk : convert the specified disk; need to specify
destination disk-type
-x new-capacity : expand the disk to the specified capacity


Additional options for create and convert:
-a adapter : (for use with -c only) adapter type (ide, buslogic or lsilogic)
-s size : capacity of the virtual disk
-t disk-type : disk type id


Disk types:
0 : single growable virtual disk
1 : growable virtual disk split in 2Gb files
2 : preallocated virtual disk
3 : preallocated virtual disk split in 2Gb files

The capacity can be specified in sectors, Kb, Mb or Gb.
The acceptable ranges:
ide adapter : [100.0Mb, 950.0Gb]
scsi adapter: [100.0Mb, 950.0Gb]
ex 1: vmware-vdiskmanager -c -s 850Mb -a ide -t 0 myIdeDisk.vmdk
ex 2: vmware-vdiskmanager -d myDisk.vmdk
ex 3: vmware-vdiskmanager -r sourceDisk.vmdk -t 0 destinationDisk.vmdk
ex 4: vmware-vdiskmanager -x 36Gb myDisk.vmdk
ex 5: vmware-vdiskmanager -n sourceName.vmdk destinationName.vmdk

After a quick backup of the machine I issued the command:

“vmware-vdiskmanager -r olddisk.vmdk -t 1 newdisk.vmdk”

The system immediatly began processing giving me a percentage of the process which took about 30 min. Once complete I booted the new disk to ensure it converted all my data successfully and then deleted the old disk.

Comments