Posts Tagged ‘VMware 3.5’

postheadericon Howto extend the VMDK and the Windows disk

I see a lot of environments where the Virtual Machine (VM) disk space must be extended.

Prior ESX 3.5 the way to extend a VDMK was to use the vmkfstools command with the -X parameter from the VMware ESX server console. With the coming of ESX 3.5 it is possible to extend the VMDK file when the VM was shutdown. Now  with VMware ESX 3.5 Update 2 it is possible to online (hot) extend the VMDK file.

In the Virtual Infrastructure Client (VIC) go to the VM and edit the settings, click on the disk there is a property New Size (figure 1).

image

Figure 1. The VM disk extend function

The first step is to see if there is enough free space on the LUN (datastore). You can check the disk space (realtime) by using the command vdf -h on the ESX server console or in a SSH session. Keep in mind to have a average of 10% free on the LUN for snapshots and swap files etc. 

If the disk space on the LUN is okay you can extend the disk. In this example we extend the 16GB disk to 20GB.

image 

 Figure 2. The VM disk extend function

When the VMDK is extended the disk space must be added to the Windows volume.  In the Windows Disk manager when using VMware ESX 3.5 Update 2,  use the “Rescan Disks” function to discover the new added space when you use the hot extend function. The new added space is seen as Unallocated

image

 Figure 3. Windows disk manager

To extend the volume by using diskpart use the following commands:

  • Start – run – type diskpart
  • type list volume
  • type select volume 1
  • type extend

When trying to extend the C partition with diskpart you got the following message “The volume you have selected may not be extended”

image

 Figure 4. Diskpart tool

It is not possible to extend the system- and bootvolume by using  the diskpart built-in command.  There are other options you can use:

- Add the system- and bootdisk volume to the other Virtuele Machine (VM) as disk.  Start the other VM and use the diskpart command to extend this disk or use an 3e party partition tool. I like the open-source Gparted tool. You can download the ISO file from http://gparted.sourceforge.net/. After the download upload the ISO file to your DAS or shared Storage and connect the ISO the to the VM.

image

 Figure 5. Connect the ISO file to the VM

Start the VM, the ISO gets started

image

 Figure 6. Start the Gparted tool 

- Press Enter

image

 Figure 7. Keymap choice 

- Press OK

image

 Figure 8. Keyboard layout 

- Select your keyboard layout

 image

 Figure 10. X-windows graphical warning

- Press Enter

  image

 Figure 11. GParted Parition tool

- The partition layout is displayed. Select the disk the extend and press Resize/Move

image

 Figure 12. Partition resize window 

- Enter the new size or drag the bar the the right and press the Resize/ Move button

image

 Figure 13. Partition resize

- Click the Apply button

image

 Figure 14. Partition resize warning 

- Press Apply

imageur

 Figure 15. Partition resize process 

- If the extending process completes and is successfully, restart the system and disconnect the ISO from the VM and restart the VM.

image

 Figure 16. Windows Disk Manager 

- After the restart open the Windows disk manager and you see the new space is added to the volume.