It's very easy to extend volumes on VMs running on ESX server. with 3.5 U2 this task can be done while the machine is powered on.
The tricky part comes when you want to extend the boot volume, in regards to Windows Guest OS.
There's no problem in extending the .vmdk file for the VM, but getting Windows 2000/2003/XP (2008 / Vista can extend directly through disk manager) to see the changes is not possible without using 3rd party tools.
There is a free alternative to using for example Acronis Disk Director (others tools might do the same, its the only one i know of) and its called winPE.
winPE comes with the Windows Automated Installation Kit (WAIK)
Its a massive 1.3GB download, but includes all the tools you need for making automated Vista and Server 2008 installations. There are loads of guides on using those tools out there, this post just shows how you can create a winPE bootable ISO for use with extending volumes.
After you download and install the WAIK package (Newest version 1.1, which includes winPE 2.1) browse to C:\Program Files\Windows AIK\Tools\PETools (or where you installed WAIK)
Run the following commands from a command prompt:
Create a PE folder structure (the target folder must not exist in advance)
copype.cmd x86 c:\winpex86
to make some modifications mount the image: (imagex.exe is located in the \tools\x86 folder under WAIK installation)
imagex.exe /MOUNTRW c:\winpex86\winpe.wim 1 c:\winpex86\mount
Change input locale to danish: (or any other language code)
intlcfg.exe -INPUTLOCALE:da-DK -IMAGE:c:\winpex86\mount
Change timezone (Changes to GMT+1)
peimg.exe /timezone:"Romance Standard Time" c:\winpex86\mount
Prepare the image:
peimg.exe /prep c:\winpex86\mount
Unmount and commit changes:
imagex.exe /UNMOUNT /COMMIT c:\winpex86\mount
The image is now ready to be used as either a bootable ISO og for booting using USB. For guidance on how to create USB bootable device, see the included WinPE.chm "Walkthrough: Create a Bootable Windows PE RAM Disk on UFD".
Create a bootable ISO file:
oscdimg -n -bc:\winpex86\etfsboot.com c:\winpex86\ISO c:\winpex86\winpex86.iso
Now its time to upload the ISO file to your virtual environment (ESX, Hyper-V, Xen and so on, this should work for all of these platforms, i have only used on ESX)
First expand your virtual machines OS disk, and boot on the ISO afterwards.
The tool you need to use is the good old diskpart. After you have booted the VM on the ISO, run diskpart:
diskpart
To view if the expanding has been recognized by the OS type:
list disk
You should get an output similar to the picture below.
Disk ### Status Size Free Dyn Gpt
-------- ---------- ------- ------- --- ---
Disk 0 Online 16 GB 6150 MB
Note that the Free says 6150, this means that the disk has available capacity and that you can extend.
To know which disk and volume to target, run the following commands before you use select
list disk
list volume
After running your select tasks, run list again to verify you have selected the correct disk/volume. The selection is marked with a *.
Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
* Volume 1 C NTFS Partition 10 GB Healthy System
When you have the correct target, just type:
extend
Woila! disk capacity on the boot volume is now extended. When you reboot the host (jyst type exit in the cmd prompt) Windows prompts that is has found and installed new hardware. Just accept the reboot, and you should be ready to go.
This is not supported in any way by Microsoft! I have done this on 100+ servers, and never had any issues - but usage is at your own risk.
This method can also be used to initially create the installation partition with the correct alignment, does not matter if the server is virtual or physical.
over and out.