Physically Manage Virtual Disks
A three-part look at VMware command-line tools. First up: vdiskmanager.exe
- By Greg Shields
If you’re a fan of VMware, then you’re used to its familiar GUI tools. However, you may never have checked out the contents of the C:\Program Files\VMware Workstation folder after installing the product. Native with the VMware install is an executable titled vmware-vdiskmanager.exe that enables some command-line disk manipulation capabilities handy for managing your VM’s disks.
Virtual Disk Manager’s functionality can be classified into three major groups: creating and converting disks, shrinking and expanding disks and defragging them.
The first group builds new or reformats old .VMDK files. You can select one of four types of disk file formats: A single, virtual disk -- also called a monolithic disk -- or one split into 2 GB files. Either type can be configured to start small and grow as needed or start fully preallocated at their maximum size.
Shrinking and expanding disks changes the size of the virtual disk exposed to the virtual machine. This does not necessarily change the partition size on the disk. To modify partition size, use a repartitioning tool like DISKPART found in the Windows Resource Kit. Any shrinking or expanding can be dangerous operation, so make a copy of the disk first.
Defragging your virtual disks can improve their speed. Since running a virtual machine is all about manipulating information within a file, a fragmented file can have a huge performance impact. To get the most bang for the buck, use Virtual Disk Manager to defragment the data inside your virtual disk. Then, use a host-based defragger like Diskkeeper to ensure that your virtual disk is laid out contiguously on your host’s physical drive.
Greg Shields is Author Evangelist with PluralSight, and is a globally-recognized expert on systems management, virtualization, and cloud technologies. A multiple-year recipient of the Microsoft MVP, VMware vExpert, and Citrix CTP awards, Greg is a contributing editor for Redmond Magazine and Virtualization Review Magazine, and is a frequent speaker at IT conferences worldwide. Reach him on Twitter at @concentratedgreg.