none
Using New-VHD to create differencing disk based on AVHDX parent disk

    Dotaz

  • Hi, I am trying to create a differencing VHDX disk based on a snapshot AVHDX disk.

    The PowerShell command I am using is as follows:

    New-VHD -Path abc.vhdx -ParentPath d:\vm\fs00\fs00_6ccd6d16-98d2-498f-94eb-1335ab0b1558.avhdx -Differencing

    which unfortunately fails saying the AVHDX extension on the parent disk is not allowed:

    The file extension for 'd:\vm\fs00\fs00_6ccd6d16-98d2-498f-94eb-1335ab0b1558.avhdx' is invalid.
    Virtual hard disk for this operation must have a .vhd or .vhdx 
    extension.
        + CategoryInfo          : InvalidArgument: (:) [New-VHD], VirtualizationException
        + FullyQualifiedErrorId : InvalidParameter,Microsoft.Vhd.PowerShell.Cmdlets.NewVhd
     

    Preliminary research indicates that differencing disk can be based on other differencing disk, and also that AVHDX files are indeed differencing disks. Indeed, repeating the command after renaming the extension of the parent disk file from .AVHDX to .VHDX works!

    Is this a bug in the New-VHD cmdlet? Or is using an AVHDX file as the parent of a differencing disk not supported for some reason?

    Also would you have any suggestion for how I can workaround the bug? Renaming the AVHDX would be problematic.

    Thanks for any help.

    úterý 10. července 2018 8:49

Všechny reakce

  • Hi,

    It is not recommended to change the extension.

    More information about New-vhd, please refer to it.

    https://docs.microsoft.com/en-us/powershell/module/hyper-v/new-vhd?view=win10-ps

    You could consult the powershell problem in powershell forum for better answer.

    https://social.technet.microsoft.com/forums/en-us/home?forum=winserverpowershell

    Best Regards,

    Frank



    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    středa 11. července 2018 9:01
    Moderátor

  • Hi,

    Just check the situation about your issue.

    Best Regards,
    Frank

    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    pátek 13. července 2018 10:16
    Moderátor
  • The "A" in AVHDX stands for "Automatic", as in "Hyper-V will automatically manage this resource". You are attempting to chain a manually-managed child to an automatically-managed parent. When Hyper-V decides to destroy its managed resource, or even just modify it by a single bit, it would also catastrophically invalidate any unmanaged children because it would have no idea of their existence. Therefore, AVHDX files should only be managed by manipulating the virtual machine.

    This is not a bug. It is the Hyper-V team preventing you from doing something that you'd almost certainly regret. If you want a child of this particular AVHDX, create a checkpoint from the checkpoint that owns it.


    Eric Siron
    Altaro Hyper-V Blog
    I am an independent contributor, not an Altaro employee. I accept all responsibility for the content of my posts. You accept all responsibility for any actions that you take based on the content of my posts.

    pátek 13. července 2018 15:24
  • Hi,

    Firstly, I would like to know what it is the necessity to create a differencing disk?

    A differencing disk can be created from an AVHDX file (or AVHD) only when a snapshot is created, making the current .avhdx file as a parent and creates a new .avhdx file (diffenecing disk)

    Apart from the situation above, it is not possible to create a differencing disk from .avhdx file (as a parent)

    Renaming the extension is NOT recommended and there may be data loss or the entire set of VHDs get corrupted.

    So it is not a bug. It is by design that avhdx can not be a parent of another differencing disk if it is not through snapshot

    Regards,
    Bala N

    úterý 17. července 2018 5:19