Nov 21

Resizing a VMWare Virtual Hard Disk

Published in vmware-vdiskmanagervmwarevmdk by Marcus Walshe
I was asked by a colleague the other days how to expand a virtual machine hard disk, so, here it is.

You can increase the size of the VMware virtual disk that you have a VM running on using the command line tool vmware-vdiskmanager. This tool will allow you to, amongst other things, resize a virtual hard disk.

There are a couple of caveats before you usethis. The machine must be shutdown as the VMDK file must be locked to perform this action against it, and, the virtual machine can not have any snapshots or be in a snapshot chain.

1. Shutdown the VM.
2. Browse to C:\Program Files\VMware\VMware Workstation (or the install location of your VMware software)
3. From the command prompt, run the command "vmware-vdiskmanager -x "

For example, on my machine I wanted to increase the size of the virtual hard disk that my Windows Server 2008 test machine was on from 16Gb to 20Gb. I ran the following command:

vmware-vdiskmanager -x 20Gb -t 3 "C:\Users\Marcus\Documents\Virtual Machines\Windows Server 2008 DC2\
Windows Server 2008 (experimental)-000001-cl1.vmdk"

The eagled eyed my notice that there is an extra parameter in there. The "-t" indicates to the utility the type of file that it is about to attempt to resize, there are four type of virtual disk:


  • 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 output of the command looks like this.

vmdk resize



Comments (0)add comment

Write comment
You must be logged in to a comment. Please register if you do not have an account yet.

busy

Who's Online