Extending virtual disks in ESX Server 3.01

Below is the procedure on how to extend the disk of a Windows 2003 virtual server.

Before starting please note the following:

  • Microsoft's diskpart utility can only be used to extend dynamic disks. Before using this utility you will need to convert your disks to dynamic using the Disk Management utility in the Computer Management console.
  • System or boot volumes cannot be extended using diskpart.
  • GParted cannot manage dynamic disks. If you are resizing a system or boot disk, configure it as a dynamic disk after it has been resized. If you convert to dynamic first, you may not be able to convert it back to a basic disk.
  • Before making any changes ensure you have a backup of your server, or at the least a snapshot of your VM.

1. Power down your VM gracefully
2. SSH to the ESX Server hosting the VM
3. cd to the directory containing your .vmdk disk file (you can check the name and location on the Hardware tab of your VM in Virtual Infrastructure Manager). e.g.

cd /vmfs/volumes/vmStore

4. Use vmkfstools to extend the disk using the following syntax: (Please use a double dash, not a single dash. Wordpress automatically reformats this from a double to single dash)

vmkfstools --extendvirtualdisk [size] [vmdk filename]

Size can be in Mb, for example 5000m, or in Gb, for example 5g. e.g.

vmkfstools --extendvirtualdisk 11g S05010094.vmdk

If you are resizing your C: drive or system/boot partition, continue at step 9. Otherwise, continue below:

5. Power up your VM
6. In Computer Management � Disk Management you should now see the unallocated space on the disk.
7. Open a command prompt window and use the diskpart utility to extend the partition.

Diskpart
List volume
Select volume z
Extend size=x disk=y

Where z = the volume number, x= the size in MB and y= the disk number in Disk Management

8. Your server may need a restart for the changes to take effect.

If you are resizing your C: drive , follow steps 1-4 above. Then:

9. Obtain a copy of the GParted live CD iso, copy it to your ESX server and configure it as your CD ROM drive on your VM.

Note: GParted will only recognize your disks if your VM's SCSI Controller is configured to emulate a BUS Logic SCSI controller. Changing type from LSI Logic to BUS Logic is dangerous. Make sure you know what you are doing or you could make your disk inaccessible to Windows.

10. Change SCSI Controller type from BUS Logic to LSI Logic.
11. Boot your VM from the ISO image.
12. Use GParted to delete the extra space and extend your volume into the unallocated space.
13. Power down VM. Change SCSI Controller type from LSI Logic to BUS Logic. Configure VM to boot from hard disk.
14. Power on VM, chkdsk should run as part of the startup proces and your disk should then be extended.

4 Responses to “Extending virtual disks in ESX Server 3.01”


  1. 1 jemkey

    For extending the C: partition, I find it easier to use this method (plus it avoids changing between LSI & BUS scsi controllers).

    1) Create a standard Windows 2003 VM to use as the helper VM.
    2) Power down VM to be extended
    3) Clone/Backup the VM
    4) Log into ESX as root and do the vmkfstools -X as you mentioned to increase the size
    5) Attach this C: Drive VM to the W2K3 Helper Machine as a secondary disk
    6) Power on the Helper Machine
    7) Cmd Prompt run Diskpart
    8) Run List Disk to see Disks and esure there is free space
    9) Run Select Disk for that Disk
    10) Run List Volume to see Volume
    11) Run Select Volume to Select Volume
    12 Type Extend and got Success Message
    13) Power Down Helper VM
    14) Power up orignal VM

  2. 2 Ben Stokes

    Excellent, thanks for this!

  3. 3 Ricky Boone

    I'm using gparted-livecd-0.3.4-7.iso, and it is able to access either SCSI bus (BUS Logic or LSI Logic).

  4. 4 Mats

    Thanks. Our file server is getting full and I need to extend it.

Leave a Reply