Have you ever run out of space on your system c:\ drive? This causes massive machine headaches, and its totally unnecessary if you are running your Windows machine as a guest operating system in a virtual environment. This is how, without purchasing any special licenses (other than Windows and VMware) that you can extend the system drive.
Note that for Windows 2008R2 and Windows 7, the diskpart utility supports extending system and boot drives, so that there is no reason to go through these steps. These steps are applicable to Server 2003, Server 2003 R2, and XP. You can use these steps on Windows 2000 machines, if you download and install diskpart from the Microsoft website.
- First, give the guest a larger physical drive:
- In vCenter, shut down the machine and collapse all vmware snapshots.
- In vCenter, edit server settings and increase disk size.
- In vCenter, using edit server, note where the disk physically rides. You will need this information next.
- Note: if there are snapshots or the machine is running, this will be greyed.
- Then, use a different virtual machine, running the same OS, to extend the NTFS partition:
- Clone the machine (or find another with the exact same OS).
- Attach the disk that needs extending to the clone:
- In vCenter, edit the clone, remove network connections (to prevent network problems on bootup).
- Start the clone (important: if you run steps in the wrong order, 2.3 then 2.2, it does not work!).
- In vCenter, edit the clone, add a second harddrive and point to the c:\ drive that needs extending.
- In the clone, validate the disk and assign it a drive letter:
- Open Administrative Tools | Computer Management | Disk Manager.
- Highlight the second disk, right-click, and assign a drive letter (e.g. F).
- Extend the disk in the clone:
- Open a DOS prompt in the clone. (Run | CMD)
diskpart (works in XP, 2003, 2008, Vista, and 7) - List volume (note: not plural).
==> Figure out which volume # is the drive letter you just assigned (note: the order varies). - Select volume #
- Extend (note: extends to the maximum available space)
- Exit (closes DiskPart).
- Exit (closes the DOS prompt).
- Open a DOS prompt in the clone. (Run | CMD)
- Validate and shutdown clone:
- Look at Disk Manager and see that the volume has been extended.
- Shutdown the clone machine.
- Final steps to clean up after yourself:
- In vCenter, remove the second harddrive settings (do not delete the harddrive!) from the clone.
- Start the original guest machine. The harddrive will be larger!
- To avoid confusion, in vCenter, remove the clone from inventory.
- To save space, using vCenter, you can browse to the datastore, and delete the files associated with the clone.