locked
Expand Dynamically Expanding Virtual HD Space RRS feed

  • Question

  • Hi Server Expert,

    I have a Server 2012 Hyper V server that being installed with few VMs. Those VM are using dynamically Expanding virtual HDD.

    Take an example from one of the server below:

    A VM called "Finance Server". this server virtual HDD has been configured with dynamically expanding virtual hdd. On the hyper v server, we created 500GB partition and this partition is being used to store the virtual hdd of the "Finance Server". I created 3 dynamically expanding VHD as I would like to have 3 partitions on the Finance Server. The three dynamically expanding VHDs are A.vhdx,B.vhdx, and c.vhdx. A.vhdx is 50GB, B.vhdx is 100GB, and C.vhdx is 150GB. each of the dynamic VHD will correspond to the partition in the "Finance Server". So, C partition is using A.vhdx, D partition is using B.vhdx, and E partition is using C.vhdx.

    The Problem Encounter:

    D partition is out of disk space. in this case, how am I going to expand it? Should I expand the space on the Hyper V server? currently the "Finance Server" is using 500GB of the HDD space. if we increase disk space by 200GB in the Hyper V Server, after extend the 500GB to 700GB, how am I going to use the space that just being increased into the "Finance Server"'s D drive? does it mean that by increasing the Hyper V disk space of 500GB to 700GB, the Finance server will be able to automatically consume the new space of 200GB or I need to login to Finance Server and activate it?

    Now, if the finance VM is able to consume the 200GB free space from the server, how should I allocate it to the partition D inside the  finance server? does it mean that by increasing the size of D drive by using the new space of 200GB will solve the issue? or I still need to expand the size of dynamic VHD? as I know dynamic VHD is not able to expand as it will always grow right?

    Thanks

    Regards,

    H

    Tuesday, April 14, 2015 4:36 PM

Answers

  • Hi Tim,

    Thanks for the response. I didn't find any option for the VHDX expansion. would you mind send a screenshot for this?

    Thanks.

    Here we go (with a screenshots):

    Expand VHDX

    http://virtualizationreview.com/blogs/everyday-virtualization/2012/12/expand-vhdx-disk.aspx

    Good luck :)


    Cheers,

    Anton Kolomyeytsev [MVP]

    StarWind Software Chief Architect

    Profile:   Blog:   Twitter:   LinkedIn:  

    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

    • Proposed as answer by Alex Lv Wednesday, April 22, 2015 2:10 AM
    • Marked as answer by Henry2050 Thursday, April 23, 2015 12:47 AM
    Thursday, April 16, 2015 11:28 AM
  • Hi Henry2050,

    May there have some misunderstanding in your mind, when we create a dynamic expand vhd we set the maximum size of this disk, it will not automatically give this partition when it over the specific size, this is by design, a Dynamically VHD is rather small in size when first created and the size grows as data are written into the disk. At any given time, a Dynamic VHD is with a size of the actual data written to it and the housekeeping information.

    Additional, a Dynamic VHD is recommended for development and testing, since relatively small footprint to manage. A server intended to run applications not disk intensive is also a possible candidate for a Dynamic VHD. Still when it comes to performance, a Fixed VHD always performs better than a comparable Dynamic VHD in most scenarios by roughly 10% to 15% with the exception of 4k writes, where Fixed VHD performs significantly better as documented in Hyper-V and VHD Performance - Dynamic vs. Fixed.

    See more at: http://blogs.technet.com/b/yungchou/archive/2013/01/23/hyper-v-virtual-hard-disk-vhd-operations-explained.aspx#sthash.KiruaO9O.dpuf

    I’m glad to be of help to you!


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com

    • Marked as answer by Henry2050 Thursday, April 23, 2015 12:47 AM
    Wednesday, April 22, 2015 2:16 AM
  • "i configure 250GB maximum disk for the vhdx, does it mean that the dynamically expanding vhdx that i have created only can expand up to 250GB?"

    Yes, a dynamically expanding disk can only expand to the maximum size it is created.  This is sometimes called 'thin provisioning'.  You create a dynamic disk of 250 GB, but when it is first created it only occupies a few MB of space on the physical disk.  As information is written to the dynamic disk, it will use more physical space.  If you take a simple dir of the file that contains the dynamic virtual disk, for example sample.vhdx, you can see its size increase.  But it can never get larger than 250GB because that is how large it was created.

    If you have a physical disk of 500 GB and you want a dynamic disk to be able to use all that space, you would need to create a dynamic disk of 500GB.

    You do have to be careful, though.  With dynamic disks it is possible to over-allocate your space.  If you have a 500 GB physical disk, it is possible to create multiple 500 GB dynamic disks.  They are each able to grow to 500 GB.  But as soon as the sum of all the allocated space adds up to 500 GB, none of them can grow any larger.


    . : | : . : | : . tim


    • Edited by Tim CerlingMVP Wednesday, April 22, 2015 4:05 PM
    • Marked as answer by Henry2050 Thursday, April 23, 2015 12:46 AM
    Wednesday, April 22, 2015 3:51 PM

All replies

  • Your use of the term 'partition' makes your query a bit confusing. A 'partition' is a part of a disk. So you can have multiple partitions on a single disk. You state "C partition is using A.vhdx, D partition is using B.vhdx, and E partition is using C.vhdx. "  You cannot have different partitions pointing to different disks.

    In general, partitions do not buy you much of anything unless you like to spend more time managing disk space. 

    It sounds like you created a 500GB partition on one of the physical drives on the Hyper-V host.  In that partition you created three dynamically expanding virtual hard disks for a total of 50+100+150=300 GB.  So you still have room in the 500GB partition to expand any one or all of the virtual hard disks, up to the maximum of 500 GB.

    Whether you are dealing with physical or virtual disks, the exact same process applies.  After you increase the size of a disk drive, you have to go into Disk Management an extend the partition on that disk to include the expanded size.  Since you have a 500 GB partition on a physical drive, you are expanding the partition to 700 GB via disk management.  From Hyper-V you can expand the size of any one or all of the virtual hard disks that are stored in that host partition.  Then from within a virtual machine that owns the virtual hard disk, you open disk management and expand the partition on that disk, just like you did on the host partition.


    . : | : . : | : . tim

    Tuesday, April 14, 2015 10:34 PM
  • Hi Tim,

    Thanks so much for your explanation.

    Yes. My current situation is:

    From the Physical HDD of my Hyper V server, I have a partition with the size of 500GB. i am creating this partition in the past with the intention to store all of VHDx of one of my virtual machine called "Finance". Since i am planning to create three partitions or drives inside this Virtual Machine, i am creating 3 dynamically expanding VHDx and store them inside the 500GB partition, those are 50GB,100GB, and 150GB with the name A.VHDx, B.VHDx, and C.VHDx. Then from the Hyper V manager, I have attached all of them into the virtual machine. Thus, from within the VM, i can see there are 3 drives as i am attaching the 3 VHDx in. So, in order to create the situation of 3 partition, i am labelling the 3 drives as C, D, and E drives.

    Now my issue is: I find D drive space is going to full soon. in this case, how am i going to increase the space? Though on the physical hyper v server i am only using 300GB from the 500GB i created, how am i going to use the remaining 200GB? I am thinking of 2 ideas below:

    1. Delete the VHDx that being assigned as D drive in the virtual machine and then create a new bigger space of dynamically expanding VHDx. So, previously the VHDx is only 100GB, now i can create a new dynamically expanding VHDx with the size of 200GB and then attach it in again.

    2. Since it is dynamically expanding VHDx and we still have 200GB left, i just let the VHDx grow. One day those VHDx will slowly occupy the remaining 200GB. Then, if 500GB is not enough, I am extending the 500GB partition again from the physical server to for instance 1TB. But, when there is new space available, how am i going to expand the size of any one or all of the dynamically expanding virtual hard disks that are stored in that host partition.

    Thanks for your attention.

    Regards,

    H

    Wednesday, April 15, 2015 2:59 PM
  • You can use the Hyper-V Manager console to Edit Disk (find it in the Actions column). Make sure the VM is not running.  Select the VHDX you want to expand and select the option to Expand it.  Once you have expanded it, start the VM and go into Disk Management.  Expand the partition on the disk.

    . : | : . : | : . tim

    • Proposed as answer by Alex Lv Wednesday, April 22, 2015 2:09 AM
    Wednesday, April 15, 2015 5:52 PM
  • Hi Tim,

    Thanks for the response. I didn't find any option for the VHDX expansion. would you mind send a screenshot for this?

    Thanks.

    Thursday, April 16, 2015 9:23 AM
  • Hi Tim,

    Thanks for the response. I didn't find any option for the VHDX expansion. would you mind send a screenshot for this?

    Thanks.

    Here we go (with a screenshots):

    Expand VHDX

    http://virtualizationreview.com/blogs/everyday-virtualization/2012/12/expand-vhdx-disk.aspx

    Good luck :)


    Cheers,

    Anton Kolomyeytsev [MVP]

    StarWind Software Chief Architect

    Profile:   Blog:   Twitter:   LinkedIn:  

    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

    • Proposed as answer by Alex Lv Wednesday, April 22, 2015 2:10 AM
    • Marked as answer by Henry2050 Thursday, April 23, 2015 12:47 AM
    Thursday, April 16, 2015 11:28 AM
  • Hi Anton,

    Thanks for the article. It is very helpful.

    I have one query that I still don't understand. Unlike the fixed disk vhdx, since the dynamically expanding vhdx will keep expanding automatically when the data are written, what is the actual reason that we still need to expand the dynamically expanding vhdx using the function provided your above article manually? If the physical disk that contain the dynamically expanding vhd is out of space, then I can just extend the physical hard disk space. Thus, I am allowing the dynamically expanding vhdx inside has the space to grow. am I right here?

    Thanks.

    Regards,

    h

    Sunday, April 19, 2015 2:06 PM
  • Hi Henry2050,

    May there have some misunderstanding in your mind, when we create a dynamic expand vhd we set the maximum size of this disk, it will not automatically give this partition when it over the specific size, this is by design, a Dynamically VHD is rather small in size when first created and the size grows as data are written into the disk. At any given time, a Dynamic VHD is with a size of the actual data written to it and the housekeeping information.

    Additional, a Dynamic VHD is recommended for development and testing, since relatively small footprint to manage. A server intended to run applications not disk intensive is also a possible candidate for a Dynamic VHD. Still when it comes to performance, a Fixed VHD always performs better than a comparable Dynamic VHD in most scenarios by roughly 10% to 15% with the exception of 4k writes, where Fixed VHD performs significantly better as documented in Hyper-V and VHD Performance - Dynamic vs. Fixed.

    See more at: http://blogs.technet.com/b/yungchou/archive/2013/01/23/hyper-v-virtual-hard-disk-vhd-operations-explained.aspx#sthash.KiruaO9O.dpuf

    I’m glad to be of help to you!


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com

    • Marked as answer by Henry2050 Thursday, April 23, 2015 12:47 AM
    Wednesday, April 22, 2015 2:16 AM
  • Hi Alex,

    Thanks for your explanation.

    I have some questions here.

    For instance: I have physcal hyper v server with the HDD size of 500GB. Now, i am creating a dynamically expanding vhdx and store in this 500GB partition. you mention that when we are creating a dynamically expanding vhdx, we are setting the maximum disk size of the dynamically expanding vhdx. for instance, i configure 250GB maximum disk for the vhdx, does it mean that the dynamically expanding vhdx that i have created only can expand up to 250GB? i have 500GB physical disk space. does the dynamically expanding vhdx unable to expand to accomodate the 500GB?

    THanks.

    Regards,

    H

    Wednesday, April 22, 2015 3:37 PM
  • "i configure 250GB maximum disk for the vhdx, does it mean that the dynamically expanding vhdx that i have created only can expand up to 250GB?"

    Yes, a dynamically expanding disk can only expand to the maximum size it is created.  This is sometimes called 'thin provisioning'.  You create a dynamic disk of 250 GB, but when it is first created it only occupies a few MB of space on the physical disk.  As information is written to the dynamic disk, it will use more physical space.  If you take a simple dir of the file that contains the dynamic virtual disk, for example sample.vhdx, you can see its size increase.  But it can never get larger than 250GB because that is how large it was created.

    If you have a physical disk of 500 GB and you want a dynamic disk to be able to use all that space, you would need to create a dynamic disk of 500GB.

    You do have to be careful, though.  With dynamic disks it is possible to over-allocate your space.  If you have a 500 GB physical disk, it is possible to create multiple 500 GB dynamic disks.  They are each able to grow to 500 GB.  But as soon as the sum of all the allocated space adds up to 500 GB, none of them can grow any larger.


    . : | : . : | : . tim


    • Edited by Tim CerlingMVP Wednesday, April 22, 2015 4:05 PM
    • Marked as answer by Henry2050 Thursday, April 23, 2015 12:46 AM
    Wednesday, April 22, 2015 3:51 PM
  • Hi Tim,

    Thanks so much for your explanation.

    Regards,

    H

    Thursday, April 23, 2015 12:46 AM