buy tb500

Expanding Virtual Hard Disks with Hyper-V

One of the most frequent questions I see on forums and newsgroups that deal with virtualization is the age-old question of “I have used all the space inside a VHD hard disk. How do I expand the virtual hard disk to make room for additional data?”. Luckily for us, with Microsoft Hyper-V on Windows Server 2008, this is now possible. Hyper-V now adds the ability to increase the maximum size of a virtual hard disk.  Expanding the disk increases the storage capacity of a dynamically expanding virtual hard disk or a fixed virtual hard disk.

Monitoring Both Physical & Virtual Servers from One Console Are you able to identify precisely which processes are sucking up resources and slowing down your servers? Can you do this equally well over VM guests that VMotion?

OpManager also allows admins to remotely shut down problem-causing processes. With over 500 built-in monitors & 70 deep VMware metrics reported on, OpManager is one of the most comprehensive fault & performance management solutions available today for entire server infrastructure – both physical and virtual.

Start monitoring VMs in minutes! Download 30-day trial here »

Before using the ability to expand the VHD hard disk you must take the following issues into consideration:

  • You must first completely shut down the virtual machine. You cannot expand a virtual hard disk that is associated with a running or saved stated virtual machine.
  • If you expand a virtual hard disk that is associated with a virtual machine that has snapshots, these snapshots will be invalidated. If you need the snapshots, you’d better make sure you plan ahead of time, and/or create new snapshots after performing the expansion of the hard disk.
  • Make sure no snapshots are associated with this VM.

  • After expanding the virtual hard disk there will be an empty space at the end of the virtual hard disk, just like not using the entire disk when you’ve originally created partitions in it.  You will either need to create a new partition to use the new space, or expand an existing partition into the new space.

Note: Expanding or extending partitions on Windows Vista and Windows Server 2008 is easier than on Windows Server 2003 or Windows XP, and is performed by using either the Disk Management snap-in from the Computer Management tool, or by using the DISKPART command. Please read my How to Extend a Disk Partition in Windows Vista and Server 2008 article for more information.

Follow these steps to expand VHD hard disks:

  1. Open the Hyper-V management tool from the Administrative Tools folder (or by typing virtmgmt.msc in the Run command).
  2. Start the Edit Virtual Hard Disk wizard by selecting Edit Disk…
  3. If the Before you begin window appears, click Next.
  4. Select the virtual hard disk you want to expand. Click Open and then Next.
  5. Select Expand on the Choose Action page and then press Next.
  6. Enter the new size of the virtual hard disk that you want and then press Next.
  7. In the final screen, press Finish.
  8. Wait till the operation finishes, which should be quite fast.

Next, after booting the VM, use Disk Management snap-in from the Computer Management tool, or by using the DISKPART command to expand the partition within Windows. While possible in Windows Server 2008 and Windows Vista, unfortunately, in Windows 2000/XP/2003, you cannot use the built-in tools to expand the System Partition (the one the Windows operating system is installed on). For these versions you will need to use of these free partition utilities.


Leave a Reply