Windows Server How-To

How To Expand Your Virtual Machine's Storage Capacity

While the process is somewhat similar when expanding physical capacity, there are a few differences to be aware of.

Like physical servers, you may occasionally find that your Hyper-V virtual machines run low on disk space and need to be provided with extra storage. Assuming that you have physical disk space available, this is a relatively easy thing to do. The trick is to expand the virtual hard disk and to then extend the volume that resides on the virtual hard disk. In this article, I will show you how it's done.

Begin the process by opening the Hyper-V Manager and shutting down the virtual machine. Next, right click on the virtual machine and choose the Settings command from the shortcut menu. Select the virtual hard disk that you want to expand, and then click the Edit button shown in Figure 1. This will cause Hyper-V to launch the Edit Virtual Hard Disk Wizard.

[Click on image for larger view.]  Figure 1. Select the virtual hard disk that you want to expand and click Edit.

Click Next on the wizard's initial screen. When you arrive at the Choose Action screen, choose the Expand option, shown in Figure 2.

[Click on image for larger view.]  Figure 2. Choose the wizard's Expand option.

Click Next and you will be prompted to enter a new size for the virtual hard disk, as shown in Figure 3. The maximum size that you can choose is limited by the virtual hard disk type (VHD or VHDX) and by the physical space that you are willing to commit.

[Click on image for larger view.]  Figure 3. Specify the new size for the virtual hard disk.

Click Next twice, and then click Finish. When you return to the virtual machine's Settings screen, click OK.

Now, go ahead and start the virtual machine and log in. Although you have expanded the virtual hard disks, the new space won't yet be available for use because you haven't done anything to change the volume size. The technique that you will use to change the volume size differs depending on the version of Windows that you are using. For most versions of Windows, you can use the Disk Management Console. This console is accessible by entering the DISKMGMT.MSC command at the virtual machine's Run prompt. Figure 4 shows what this console looks like.

[Click on image for larger view.]  Figure 4. This is the Disk Management Console.

As you look at the figure above, the Disk Management Console displays the existing volumes, as well as the available space on each disk. You can extend a volume by right clicking on the volume and selecting the Extend Volume command from the shortcut menu, as shown in Figure 5.

[Click on image for larger view.]  Figure 5. Right click on the volume and choose the Extend Volume command from the shortcut menu.

Enter the amount of space that you want to use for the volume, and click Next. It is worth noting that you may be limited as to how much you are able to extend the volume. In the figure above for example, you will notice that there is a warning message indicating that you can only extend the volume to the available space shown because the disk cannot be converted to dynamic or because the volume that is being extended is a boot or a system volume.

Even if it is possible to convert a disk into a dynamic disk, doing so is usually a bad idea. Many backup applications require that virtual machines containing dynamic disks be placed into a saved state in order to be backed up. Although I have never seen a firmly stated Microsoft best practice indicating that you shouldn't use dynamic disks within virtual machines, I recommend avoiding the practice.

So what can you do if you are unable to extend a volume as much as you would like? In these types of situations, I typically back up the virtual hard disk contents and then delete the virtual hard disk. After doing so, I create a brand new virtual hard disk (and a corresponding volume of the desired size) and restore the backup to the new virtual hard disk.

About the Author

Brien Posey is a 22-time Microsoft MVP with decades of IT experience. As a freelance writer, Posey has written thousands of articles and contributed to several dozen books on a wide variety of IT topics. Prior to going freelance, Posey was a CIO for a national chain of hospitals and health care facilities. He has also served as a network administrator for some of the country's largest insurance companies and for the Department of Defense at Fort Knox. In addition to his continued work in IT, Posey has spent the last several years actively training as a commercial scientist-astronaut candidate in preparation to fly on a mission to study polar mesospheric clouds from space. You can follow his spaceflight training on his Web site.


comments powered by Disqus

Subscribe on YouTube