locked
Internally file space utilization is different but from host OS the VHD size looke the same. RRS feed

  • Question

  • There are two identical VMs, only that one has 1GB ram & the other is running with 2GB.

    When looking through the explorer the C:\ contains the page file, for vm1 its 1 GB & on vm2 its 2 GB but on the HOST OS the VHD size is same !!

    How is that possible?

    Is it something like unless the page file is utilized internally the VHD won't expand & show that space ?


    yup

    Friday, December 21, 2012 10:46 AM

Answers

  • And again I will answer 'yes' to your question.  Until content is actually written to a dynamically expanding disk, storage is not allocated.  Well, sort of.  To be efficient, Hyper-V will allocate incremental storage in blocks so that it does not have to allocate every time a new write is done.  If the memory of the virtual machines is properly sized, the need to write to the page file is minimized.  Until something writes, there is nothing in the page file.

    tim

    Sunday, December 23, 2012 5:45 PM

All replies

  • How big is the VHD (configured size)? Are you using fixed sized or dyanamically expanding disks?
    Friday, December 21, 2012 4:22 PM
  • Sorry I should've included this in the first place. These are dynamically expanding disks.

    Guest & Host OS - both are Win 2008 R2 Sp1


    yup

    Friday, December 21, 2012 5:10 PM
  • Maybe the systems have not needed the page files enough to expand into the space available.  If a system's memory is properly sized for the memory demands of a system, the pagefile get minimal use.  So if you just created the two VMs and have not really done anything with them other than boot them up, it would not surprise me at all if the two VHDs were about the same size.

    tim

    Friday, December 21, 2012 11:13 PM
  • When I check  the file size inside the guest OS, those are 1 GB & 2 GB.


    yup

    Saturday, December 22, 2012 3:28 AM
  • Did you define the pagefile as a fixed length file or a variable length file?  Sounds like you may have specified a fixed length.  If so, the same applies.  In a dynamic disk, space is not allocated until it is written.

    So, I am answering in the affirmative the question you asked about page file utilization.


    tim

    Saturday, December 22, 2012 10:13 PM
  • :) sorry again, I should 've stated this in the beginning. The page file is system managed (windows default).

    There are two identical VMs, only that one has 1GB ram & the other is running with 2GB. The machines are using dynamically expanding disks.
    On both the machines the page file is system managed (windows default).
    Guest & Host OS - both are Win 2008 R2 Sp1
    In the guest OS when looking through the explorer, the C:\ contains the page file, for vm1 its 1 GB & on vm2 its 2 GB but on the HOST OS the VHD size is same !!

    How is that possible?
     
    Is it something like unless the page file is utilized internally the VHD won't expand & show that space ?


    yup

    Sunday, December 23, 2012 1:15 AM
  • And again I will answer 'yes' to your question.  Until content is actually written to a dynamically expanding disk, storage is not allocated.  Well, sort of.  To be efficient, Hyper-V will allocate incremental storage in blocks so that it does not have to allocate every time a new write is done.  If the memory of the virtual machines is properly sized, the need to write to the page file is minimized.  Until something writes, there is nothing in the page file.

    tim

    Sunday, December 23, 2012 5:45 PM
  • Got you. Can this be verified with something other than a page file ?

    Will it be applicable on SQL Server mdf/ndf files if instant initialization is enabled?

    I'll check & get back.


    yup

    Monday, December 24, 2012 3:21 AM
  • Just checked this on SQL Server MDF/LDF files, its effective there too. The space allocation inside Dynamic disks is dependent on utilization.

    Any ms pages/papers where I can find this as documented ?

     

    yup

    Monday, December 24, 2012 4:48 AM
  • Hi,

    The 64-bit versions of Microsoft Windows Server 2008 and Microsoft Windows Server 2008 R2 can support more RAM than the 32-bit versions of Windows Server. When lots of memory is added to a computer, a paging file may not be required.

    And maybe as Tim mentioned, pagefile is not really write on virtual disks.

    Below are some articles related to pagefile and dynamically expanding disk:

    Frequently Asked Questions: Virtual Hard Disks in Windows 7 and Windows Server 2008 R2
    http://technet.microsoft.com/en-us/library/dd440865
    What is the Page File for anyway?
    http://blogs.technet.com/b/askperf/archive/2007/12/14/what-is-the-page-file-for-anyway.aspx
    How to determine the appropriate page file size for 64-bit versions of Windows Server 2008 and or Windows 2008 R2
    http://support.microsoft.com/kb/2021748

    Hope this helps!

    TechNet Subscriber Support

    If you are TechNet Subscription user and have any feedback on our support quality, please send your feedback here.



    Lawrence

    TechNet Community Support

    Monday, December 24, 2012 6:36 AM
  • This is not unique to Microsoft VHDs.  Storage vendors using thin provisioning and VMware using thin provisioning also do the same thing.  This has been around almost since the start of virtualization.  But, if you really want to read up on it, see http://download.microsoft.com/download/f/f/e/ffef50a5-07dd-4cf8-aaa3-442c0673a029/Virtual%20Hard%20Disk%20Format%20Spec_10_18_06.doc

    tim

    Monday, December 24, 2012 1:58 PM