What's new

Solved Expanded virtual hard disk but it's still using small size

GregL65

New Member
I have Windows 8 installed on a Hyper-V VM in Windows 8.1. It turned out that the size I originally allocated for the virtual hard disk was too small, so I went into settings for the VM and expanded it.

But Windows 8 in that VM still sees only the smaller hard disk size.

In Hyper-V manager, when I click Inspect for the virtual hard disk, it says that the "Current File Size" is the old, small size, while the "Maximum Disk Size" is the new, larger size.

So, how do I get the OS installed in the VM to see the new, larger, expanded size?


Thanks,

Greg
 

My Computer

System One

  • OS
    Windows 8.1

Kari

Old geek, new tricks
Team Member
VIP Member
Pro User
Your virtual machine's vhd is as it should be, you have no issue. I will try to explain this below.

Hyper-V uses three different types of virtual hard disks:
  1. Fixed size VHD
  2. Dynamically expanding VHD
  3. Differencing VHD

1. Fixed size vhd

A fixed size VHD is when stored on your host always the same size. If your vm has a 100 GB fixed size VHD it takes 100 GB storage space on your host regardless how much data is actually stored on it. A totally empty 100GB fixed size VHD takes 100 GB on host, a fixed size VHD with 60 GB data stored on it takes the same 100 GB storage space on your host.

If you want your virtual machine to use a fixed size VHD you need to create the VHD first, then attach it to a vm as existing VHD. A fixed size VHD can be created in New Virtual Hard Disk Wizard (Hyper-V Manager > New > Hard disk):

2014-10-19_13h39_41.png

In wizard select Fixed size:

2014-10-19_13h40_11.png

Now create a vm with New Virtual Machine Wizard and use your existing fixed size VHD:

2014-10-19_13h42_08.png


2. Dynamically expanding VHD


The default VHD type in Hyper-V is dynamically expanding. A dynamically expanding VHD only uses the storage space on host it needs but is allowed to expand (grow) as the need arises. The host system sees the VHD file size as big as it actually is but the guest sees its size as the set VHD maximum disk space. A 100 GB dynamically expanding VHD with only 10 GB data stored on it is for the host a 10 GB VHD file but the guest sees it as a 100 GB HDD with 90% free space.

An example. I have a Windows 10 Technical Preview vm. When I created it I accepted the default 127 GB VHD size for it and later created another 127 GB VHD attaching it to the same vm. This W10 vm has now two 127 GB virtual hard disks attached to it:

2014-10-19_13h55_28.png

Looking from inside the vm everything is as it should be:

2014-10-19_13h19_25.png

However, if we check these two VHD files from the host, we can see they are only using just under 12 GB and 4 GB storage space on host:

2014-10-19_13h12_43.png

Let's copy a big ISO file to vm and download some additional content on it to see what happens. You can see that the vm sees its hard disks exactly as they were, two 127 GB hard disks, only showing less free space because we have added about 5 GB worth of files:

2014-10-19_13h29_31.png

Looking the same changes on host we can see that the size of the VHD file has been changed because it needed to expand to store the newly added 5 GB:

2014-10-19_14h08_18.png


3. Differencing VHD


Hyper-V uses differencing virtual hard disks to allow Checkpoints. A Hyper-V Checkpoint is a "snapshot" of the virtual machine state as it was when a checkpoint was created, allowing user to discard all changes later and restore the vm as it was. Read more about Hyper-V checkpoints at our sister site The Ten Forums: Hyper-V Checkpoints - Create and Use in Windows 10

When you create a checkpoint of your parent VHD (original VHD where the OS is installed) it keeps record of changes (differences) on your vm which makes it possible to discard every change made since creating the checkpoint. A differencing VHD can have a fixed size VHD or a dynamically expanding VHD as its parent, in virtual machines with several virtual hard disks it can also have (it will have) more than one parent.

VHD type for a differencing VHD cannot be changed nor can it be shrinked or expanded.

2014-10-19_14h34_27.png


Summary:


When you create a VHD in a New Virtual Machine Wizard, the resulting VHD is by default a dynamically expanding VHD, meaning it only uses as much space on your host (Hyper-V server) HDD as needed, expanding when it needs more space. The Maximum Disk Space shows how large you allow a dynamically expanding VHD to grow. You can check this easily by launching your vm and checking from its disk management how big the HDD is and compare it to VHD file size on host. The vm HDD always shows the same size but the VHD file on host expands when more space is needed.

Remember the difference between a VHD file on host and a HDD on guest vm; a VHD file on your host is a normal HDD for your vm. A 10 GB VHD file on host can contain a 1 TB HDD for a vm.

Quite a complicated explanation, I hope you got it :).

Kari
 

My Computer

System One

  • OS
    Windows 8.1 Pro with Media Center
    Computer type
    Laptop
    System Manufacturer/Model
    HP ENVY 17-1150eg
    CPU
    1.6 GHz Intel Core i7-720QM Processor
    Memory
    6 GB
    Graphics Card(s)
    ATI Mobility Radeon HD 5850 Graphics
    Sound Card
    Beats sound system with integrated subwoofer
    Monitor(s) Displays
    17" laptop display, 22" LED and 32" Full HD TV through HDMI
    Screen Resolution
    1600*900 (1), 1920*1080 (2&3)
    Hard Drives
    Internal: 2 x 500 GB SATA Hard Disk Drive 7200 rpm
    External: 2TB for backups, 3TB USB3 network drive for media
    Cooling
    As Envy runs a bit warm, I have it on a Cooler Master pad
    Keyboard
    Logitech diNovo Media Desktop Laser (bluetooth)
    Mouse
    Logitech MX1000 Laser (Bluetooth)
    Internet Speed
    50 MB VDSL
    Browser
    Maxthon 3.5.2., IE11
    Antivirus
    Windows Defender 4.3.9431.0
    Other Info
    Windows in English, additional user accounts in Finnish, German and Swedish.

GregL65

New Member
Thanks, but if I understand your explanation correctly, the guest OS should see the larger size. But it doesn't; it only sees the smaller size. And it's warning me of limited space and not doing Windows Update due to insufficient space.

Did I miss a step after expanding the drive in the Hyper-V manager settings?
 

My Computer

System One

  • OS
    Windows 8.1

Kari

Old geek, new tricks
Team Member
VIP Member
Pro User
Open the settings for your vm, select the vhd and click Inspect, make a screenshot of the Virtual Hard Disk Properties. Then launch your vm, open the Disk Management on vm, enlarge the disk management windows so that everything can be seen and take a screenshot that.

Post both screenshots here. Tutorials if needed:

I [del]want[/del] need to see these screenshots:

1. Virtual Hard Disk Properties:

2014-10-19_18h19_09.png

2. Disk Management of the vm, windows maximized so that everything is visible:

2014-10-19_18h22_53.png

Also please tell how did you change the size of the vhd?
 

My Computer

System One

  • OS
    Windows 8.1 Pro with Media Center
    Computer type
    Laptop
    System Manufacturer/Model
    HP ENVY 17-1150eg
    CPU
    1.6 GHz Intel Core i7-720QM Processor
    Memory
    6 GB
    Graphics Card(s)
    ATI Mobility Radeon HD 5850 Graphics
    Sound Card
    Beats sound system with integrated subwoofer
    Monitor(s) Displays
    17" laptop display, 22" LED and 32" Full HD TV through HDMI
    Screen Resolution
    1600*900 (1), 1920*1080 (2&3)
    Hard Drives
    Internal: 2 x 500 GB SATA Hard Disk Drive 7200 rpm
    External: 2TB for backups, 3TB USB3 network drive for media
    Cooling
    As Envy runs a bit warm, I have it on a Cooler Master pad
    Keyboard
    Logitech diNovo Media Desktop Laser (bluetooth)
    Mouse
    Logitech MX1000 Laser (Bluetooth)
    Internet Speed
    50 MB VDSL
    Browser
    Maxthon 3.5.2., IE11
    Antivirus
    Windows Defender 4.3.9431.0
    Other Info
    Windows in English, additional user accounts in Finnish, German and Swedish.

GregL65

New Member
Thanks Kari, the step I missed was going into the Disk Management control panel in the guest OS, and extending the volume to use the additional space.
 

My Computer

System One

  • OS
    Windows 8.1

adamf

Banned
2. Dynamically expanding VHD

The default VHD type in Hyper-V is dynamically expanding. A dynamically expanding VHD only uses the storage space on host it needs but is allowed to expand (grow) as the need arises. The host system sees the VHD file size as big as it actually is but the guest sees its size as the set VHD maximum disk space. A 100 GB dynamically expanding VHD with only 10 GB data stored on it is for the host a 10 GB VHD file but the guest sees it as a 100 GB HDD with 90% free space.
Note though that if you do a native boot to a dynamically expanding disk it will be expanded to full size (100GB here) on disk until you shut down at which point it will shrink again.
 

My Computer

System One

  • OS
    Windows 10 Pro Prieview x64
    Computer type
    Laptop
    System Manufacturer/Model
    MacBook Pro Core2Duo
    CPU
    T7600
    Memory
    3
    Graphics Card(s)
    ATI Radeon X1600
    Monitor(s) Displays
    Internal
    Screen Resolution
    1440 x 800
    Hard Drives
    40GB
    Keyboard
    Apple
    Mouse
    Apple
    Internet Speed
    Varies
    Browser
    Various
    Antivirus
    Defender

Kari

Old geek, new tricks
Team Member
VIP Member
Pro User
Thanks Kari, the step I missed was going into the Disk Management control panel in the guest OS, and extending the volume to use the additional space.

Good to know :).

2. Dynamically expanding VHD

The default VHD type in Hyper-V is dynamically expanding. A dynamically expanding VHD only uses the storage space on host it needs but is allowed to expand (grow) as the need arises. The host system sees the VHD file size as big as it actually is but the guest sees its size as the set VHD maximum disk space. A 100 GB dynamically expanding VHD with only 10 GB data stored on it is for the host a 10 GB VHD file but the guest sees it as a 100 GB HDD with 90% free space.
Note though that if you do a native boot to a dynamically expanding disk it will be expanded to full size (100GB here) on disk until you shut down at which point it will shrink again.
Yes, of course. The system using the VHD sees it as a HDD as big as the maximum space allowed by the setup (user). If you boot a physical machine from a VHD, in order for the system to operate it needs to allocate the set maximum space on HDD.

However, this thread, OP's question and my responses were about a virtual machine running in Hyper-V having nothing to do with booting from a VHD.
 
Last edited:

My Computer

System One

  • OS
    Windows 8.1 Pro with Media Center
    Computer type
    Laptop
    System Manufacturer/Model
    HP ENVY 17-1150eg
    CPU
    1.6 GHz Intel Core i7-720QM Processor
    Memory
    6 GB
    Graphics Card(s)
    ATI Mobility Radeon HD 5850 Graphics
    Sound Card
    Beats sound system with integrated subwoofer
    Monitor(s) Displays
    17" laptop display, 22" LED and 32" Full HD TV through HDMI
    Screen Resolution
    1600*900 (1), 1920*1080 (2&3)
    Hard Drives
    Internal: 2 x 500 GB SATA Hard Disk Drive 7200 rpm
    External: 2TB for backups, 3TB USB3 network drive for media
    Cooling
    As Envy runs a bit warm, I have it on a Cooler Master pad
    Keyboard
    Logitech diNovo Media Desktop Laser (bluetooth)
    Mouse
    Logitech MX1000 Laser (Bluetooth)
    Internet Speed
    50 MB VDSL
    Browser
    Maxthon 3.5.2., IE11
    Antivirus
    Windows Defender 4.3.9431.0
    Other Info
    Windows in English, additional user accounts in Finnish, German and Swedish.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top