torsdag 15. april 2010

Extend'ing disks in WMware

http://www.penguinpunk.net/blog/?p=12

If you’re working in a VMware ESX environment, you should normally be able to use SAN-based disk expansion technologies, combined with diskpart in Windows, or vmkfstools in VMware ESX, to achieve the desired result.

In Windows, run the following commands to extend a basic volume:

diskpart

list volume

select volume x (where x is the number of the volume you wish to extend)

extend

exit

In VMware ESX, run the following command to extend a vmdk disk file:

vmkfstools -X 50G disk.vmdk

Note that the 50G value is the new size of the disk, not the extra space you require.

If you find yourself needing to extend a boot volume in Windows Server 2003, diskpart won’t be any help. Before you reach for the gparted ISO file, think about combining vmkfstools with another (test) Virtual Machine. Here are the required steps:

1. Backup your VM (VM1).
2. Shutdown VM1 and run vmkfstools against VM1’s disk file.
3. Attach the disk to a second guest (VM2).
4. Run diskpart on the volume (in this case it will probably be D: or something similar).
5. Once the volume is extended, shutdown VM2 and remove (but don’t delete) the disk from VM2’s config.
6. Attach the newly expanded volume to VM1.
7. Boot VM1.
8. Profit.

I hope that’s provided a starting point for further investigation into basic and dynamic disks. Remember, before converting every volume in sight to Dynamic, think very carefully about the ramifications of doing this.