What is the virtual hard drive type A VM created using the default virtual machine wizard options dynamically expanding?

Try the new Google Books

Check out the new look and enjoy easier access to your favorite features

Creating a new virtual hard disk is almost always included as a step during the creation of the virtual machine that owns it. It’s certainly not the only time or the only way that you can create a VHDX. You don’t necessarily need to attach it to a virtual machine, however, as Hyper-V Manager has a complete management system for virtual hard disks whether or not they have a connection to a virtual machine. You can use it to create both standalone virtual hard disks and disks directly attached to a virtual machine. PowerShell also offers similar functionality.

Use Hyper-V Manager to Create a New Virtual Disk Directly on a Virtual Machine

To get started, open Hyper-V Manager and choose your desired creation method from one of the next two sections.

  1. In Hyper-V Manager’s center pane, right-click a virtual machine and click Settings.

    Access VM Settings

  2. In the left pane of the VM’s Settings dialog, click to select the controller that you wish to connect the new disk to. Remember that you cannot make changing to the disk configuration of an IDE controller while the virtual machine is on, but this is not a restriction for the SCSI controller.
    The following two screen shots show the IDE screen and the SCSI screen, respectively. On either, click the Add button (for an IDE controller, make sure that Hard Drive is highlighted).

    Add VHD on IDE

    Add VHD on SCSI

  3. Whichever you chose, the following screen will appear:

    Disk Connection

    Notice that the connection information for Controller is the controller that you selected in step 2 and the Location is the next available on that controller. You can freely switch either here, with the limitation that you can’t add to an IDE controller while the VM is on and you can’t use a location that already has a disk attached. When ready, click the New button.

  4. This will open the New Virtual Hard Disk Wizard. Jump down to the New Virtual Hard Disk Wizard section below to finish up.

Using Hyper-V Manager to Create a Standalone Virtual Hard Disk

To create a new standalone virtual hard disk, there’s only a single that that you need to do to open the wizard. In Hyper-V Manager, in the Actions pane at the far right, click New then Virtual Hard Disk.

Add New VHD

New Virtual Hard Disk Wizard

Whichever method you chose above, you’ll now be looking at the New Virtual Hard Disk Wizard. Follow the steps below to actually create the virtual hard disk.

  1. The first screen that appears is informational unless it was previously suppressed via the Do not show this page again checkbox. When ready, click Next.
  2. If you aren’t adding the disk to a Generation 2 virtual machine, the first active screen is the Choose Disk Format page. This allows you to choose between the earlier VHD format or the newer VHDX format. Unless you need to use the disk on a pre-2012 version of Hyper-V or share it with a third party hypervisor that can’t understand VHDX, you’ll likely want to choose VHDX. Make your choice and click Next.

    New VHD Format

  3. The next screen is Choose Disk Type. Your options are between fixed size, dynamically expanding, and differencing.

    New VHD Type

  4. Next, you’ll be asked to provide the name and location for your new virtual hard disk.

    New VHD Name and Location

  5. If you are creating a new differencing disk, the next screen will ask you to select the parent virtual hard disk.

    New VHD Parent

  6. If you chose either a fixed size or a dynamically expanding disk, you’ll be brought to the Configure Disk screen.

    New VHD Source

    You have three options:

    1. Create a new blank virtual hard disk does exactly that. You’ll need to supply the size for the disk that you wish to create.
    2. You can also choose to copy an existing physical disk’s contents to the file that you specified in step 4.
    3. The final option is like the second except that the source is an existing VHD file.
  7. The final screen is a summary. Review the settings, click Back if you need to correct anything.

Creating a VHDX in PowerShell

Use the New-VHD cmdlet to create the VHD, then Add-VMHardDiskDrive to attach it.

New-VHD -Path 'C:LocalVMsVirtual Hard Disksnewvdisk.vhdx' -SizeBytes 50gb -Dynamic | Add-VMHardDiskDrive -VMName svtest -ControllerType IDE -ControllerNumber 1 -ControllerLocation 1

New VHD Creation Notes

VHD creation is a fairly easy-to-understand process but there are a few things to be mindful of.

  • If you create a disk using a virtual machine’s Settings page, the wizard will automatically pre-populate with the new disk file when it is finished creating.
  • If you create a new disk from a physical disk or another virtual disk, the new VHD is built up from scratch. If it’s dynamically expanding, any empty blocks in the source will not be duplicated in the new disk. This means that it will likely be smaller than the original.
  • The new disk that you create does not need to be in the same location or on the same storage as any of a virtual machine’s other files.
  • A new differencing disk’s parent cannot be actively in use by any virtual machine, although it can be a parent of other differencing disks.
  • For Linux virtual machines, it is recommended that you specify -BlockSize 1MB for dynamically-expanding virtual hard disks. You can only provide this option with PowerShell’s New-VHD. None of the GUI tools allows for a block size override. Due to the way that common Linux file systems work, this switch will result in more efficient space utilization.

Join thousands of other IT pros and receive a weekly roundup email with the latest content & updates!

  • Article
  • 10/26/2016
  • 5 minutes to read

Applies To: Windows Server 2012 R2

Starting in Windows Server® 2012 R2, Hyper-V provides you with the ability to grow or shrink the size of a virtual hard disk while the virtual machine is still running. This topic creates a virtual hard disk (attached to a SCSI Controller), adds the virtual hard disk to the virtual machine and details the process for expanding and shrinking a virtual hard disk.

Note

The user interface option to shrink a virtual hard disk is only visible for virtual hard disks that have been expanded previously. Online resize is exclusive to SCSI attached VHDX files. For more information about resizing virtual hard disks, see Virtual hard disk resizing.

Prerequisites

Before you attempt to edit the size of your virtual hard disk, make sure that you have the following:

  • A computer running Windows Server® 2012 R2 or later with the Hyper-V role installed.

  • A user account that is a member of the local Hyper-V Administrators group, or the Administrators group.

To create a virtual hard disk for a virtual machine

Create a virtual hard disk (attached to a SCSI controller) for a virtual machine using the following procedure:

  1. On the Windows Start screen, click the Server Manager tile.

  2. On the Tools menu, click Hyper-V Manager.

  3. Under Virtual Machines, select the virtual machine.

  4. In the Actions pane, click Settings.

  5. Click SCSI Controller. On the right pane, under SCSI Controller, click Hard Drive.

  6. Click Add.

  7. On the right pane, under Hard Drive, click New.

  8. On the Before You Begin page, click Next.

  9. On the Choose Disk Format page, choose VHDX and click Next.

  10. On the Specify Name and Location page, type the name of the new virtual hard disk. If required, type the location of the virtual hard disk. Click Next.

  11. On the Configure Disk page, type disk size and click Next.

  12. On the Completing the New Virtual Hard Disk Wizard page, click Finish.

Adding a virtual hard disk to the virtual machine

After adding a virtual hard disk, it is necessary to configure your virtual machine so that the operating system within the virtual machine can see the additional disk capacity. The disk must be brought online, initialized and formatted.

These instructions assume a virtual hard disk has been created for a Windows Server® 2012 R2virtual machine.

  1. On the Windows Start screen, click the Server Manager tile.

  2. On the Tools menu, click Hyper-V Manager.

  3. Under Virtual Machines, double click to connect to the virtual machine.

  4. Enter credentials and login to the virtual machine.

  5. To start Disk Manager, start the Server Manager.

  6. On the Tools menu, click Computer Management.

  7. Under Storage, click Disk Management.

  8. On the middle pane, locate the new hard disk. Right click the disk and click Online.

  9. On the middle pane, locate the new hard disk. Right click the disk and click Initialize.

  10. On the Initialize Disk page, click OK.

  11. On the middle pane, right click the unallocated volume and click New Simple Volume.

  12. In the New Simple Volume Wizard, click Next.

  13. On the Specify Volume Size page, click Next.

  14. On the Assign Drive Letteror Path page, click Next.

    On the Format Partition page, click Next.

    On the Completing the New Simple Volume page, click Finish.

The new virtual hard disk will now be visible to the virtual machines operating system.

To expand the size of a virtual hard disk

You can expand the storage capacity of the virtual hard disk using the following procedure:

  1. On the Windows Start screen, click the Server Manager tile.

  2. On the Tools menu, click Hyper-V Manager.

  3. Under Virtual Machines, select the virtual machine with the virtual hard disk that you want to expand.

  4. In the Actions pane, click Edit Disk to start the Edit Virtual Hard Disk Wizard.

  5. On the Before you Begin page, click Next.

  6. On the Locate Virtual Hard Disk page, click Browse.

  7. Navigate to your virtual hard disk. Select your virtual hard disk. Click Open.

  8. Click Next.

  9. On the Expand Virtual Disk page, enter the new virtual hard disk size. The size is specified in gigabytes with a maximum size of 64TB for any virtual hard disk.

  10. Click Next.

  11. On the Completing the Edit Virtual Hard Disk Wizard page, click Finish.

Expand the volume of a virtual hard disk connected to a virtual machine

After expanding a virtual hard disk, it is necessary to configure the disk management within your virtual machine operating system so that it can see the new disk space. This space is currently residing as an unallocated volume created in the virtual disk.

These instructions assume a virtual hard disk has been expanded and that it is connected to a Windows Server® 2012 R2virtual machine.

  1. On the Windows Start screen, click the Server Manager tile.

  2. On the Tools menu, click Hyper-V Manager.

  3. Under Virtual Machines, double click the virtual machine.

  4. Enter credentials and login to the virtual machine.

  5. To start Disk Manager, start the Server Manager.

  6. On the Tools menu, click Computer Management.

  7. Under Storage, click Disk Management.

  8. On the middle pane, locate the existing volume in use by the virtual machine.

  9. Right click the disk and click Extend Volume.

  10. On the Welcome to the Extended Volume Wizard, click Next.

  11. On the Select Disk page, click Next.

  12. On the Completing the Extended Volume page, click Finish.

The operating system within the virtual machine will now see the expanded disk capacity.

To shrink the size of a virtual hard disk

You can shrink the size of a virtual hard disk. However, you cannot shrink the size of the virtual hard disk below the size of the disk volume that is in use within the operating system of the virtual machine.

Reduce the storage capacity of the virtual hard disk using the following procedure:

  1. On the Windows Start screen, click the Server Manager tile.

  2. On the Tools menu, click Hyper-V Manager.

  3. Under Virtual Machines, select the virtual machine with the virtual hard disk that you want to shrink.

  4. In the Actions pane, click Edit Disk to start the Edit Virtual Hard Disk Wizard.

  5. On the Before you Begin page, click Next.

  6. On the Locate Virtual Hard Disk page, click Browse.

  7. Navigate to your virtual hard disk. Select your virtual hard disk. Click Open.

  8. Click Next.

  9. On the Choose Action page, click Shrink. Click Next.

  10. On the Expand Virtual Disk page, enter the new virtual hard disk size. The size is specified in gigabytes.

  11. Click Next.

  12. On the Completing the Edit Virtual Hard Disk Wizard page, click Finish.

Última postagem

Tag