none
VM / Snapshot Question

    Вопрос

  • Hello.  Strange question. 

    It appears that one of our production VM's had a snapshot taken of it, and when the snapshot was deleted, it was never merged.  Or when it was deleted, it errored out.  I'm not really sure, as i am not the one who did it, and i am not sure who did.  Basically, all i see is that there is the .vhd file, and a .avhd file where they are typically stored.  I also see in the Snapshots folder there is the .vsv file.  Within SCVMM and Hyper-V Manager, i do not see any reference to a snapshot though.  So, i turned off the VM, hoping it would merge the vhd files, but it didnt.  So i did some parsing of the log files, and here is what i found for when i see the last modified date of the .vhd file - likely exactly when this snapshot, or something else happened.

    'VMNAME' could not perform the operation. The Virtual Machine is not in a supported state to perform the operation. (Virtual machine ID 361B2EA9-6685-434D-9B94-526209DDD4BA)

    The requested operation has failed.

    'VMNAME' failed to save RAM contents during a snapshot operation: The I/O operation has been aborted because of either a thread exit or an application request. (0x800703E3). (Virtual machine ID 361B2EA9-6685-434D-9B94-526209DDD4BA)

    So....

    1) What do you think may have happened here?

    2) What can I do to resolve this?  I'd like to only have the .vhd file.

    TIA!

    17 марта 2012 г. 20:49

Ответы

  • So, does the size of the .avhd file grow when the VM is running? 

    The vsv file and bin file are created in the snapshot folder if the snapshot was taken while the virtual machine was running, or paused, or saved.  The bin file is an image of VM memory and the vsv file is the saved state of the VM.  If a snapshot is taken when a VM is stopped, you won't have a vsv or bin file in the snapshot directory.  The .avhd will however grow, regardless of what state the VM whas in when the snapshot was taken, when the VM is running because avhd file is basically a differencing disk. 

    Since you have a VSV file but no BIN file in the snapshot directory, and the error from the log would indicate that the snapshot aborted, I'd lay odds on it being orphaned.  Please confirm that the .avhd file does or does not grow when the VM is running.  If the .avhd is not growing, then writes are not going to this differencing file.  You can remove it if you don't need the changes in the snapshot.

    If the VM is growing, writes are going to the differencing file and you'll want to recover it to keep any changes since when the snapshot was taken.  To do this, let's assume you have a vhd file and an avhd file:

    My_VM.VHD

    My_VM_1.AVHD

    1. Shut the VM Down. 

    2. Rename My_VM_1.AVHD to My_VM_1.VHD

    3. Create a new VM, but specify using an existing disk, My_VM_1.VHD. 

    Changing the extention from AVHD to VHD turns the snapshot into a regular old differencing disk.  You can inspect the differencing disk on the new VM:

    And you can merge it with the parent (the original VHD):

    • Помечено в качестве ответа Vincent HuModerator 9 апреля 2012 г. 8:50
    18 марта 2012 г. 13:08
  • Hi,
     
    Please right click on the problematic VM, select “Settings”, check the Hard Dive under IDE Controller. Following is a screenshot from my Hyper-V computer, I have deleted the snapshot and the snapshot had not been merged into the original VHD file. So you will be able to find that the IDE Controller associate with a .avhd file instead of .vhd file.
     
     
     
    By the way, you can manually merge the snapshot into vhd file.
     
     

    Vincent Hu

    TechNet Community Support

    • Помечено в качестве ответа Vincent HuModerator 9 апреля 2012 г. 8:50
    19 марта 2012 г. 6:05
  • If the Hyper-V Server is R2.

    Then, using the Hyper-V manager, create a new snapshot and export this new snapshot, then import this exported machine as a repalcement.

    In the end you will end up with a VM with a single, flattened VHD.

    (regardless of what may have happened to get you here).


    Brian Ehlert (hopefully you have found this useful)
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

    • Помечено в качестве ответа Vincent HuModerator 9 апреля 2012 г. 8:50
    19 марта 2012 г. 15:11

Все ответы

  • Some more info...

    In SCVMM, if i go to look at the hard disk options, it tells me: VMNAME_disk_1.vhd and there is no mention of a snapshot

    In HV Manager, for the same, it tells me: VMNAME_disk_1_0BBFCAF0-9A0C-4E3A-AE32-31FA47C8F38D.avhd and also displays a warning that i cannot edit the virtual disk because a snapshot exists.

    17 марта 2012 г. 21:00
  • See if you can save the virtual machine, then start the virtual machine.  This is like the area in which the problem with the snapshot occurred.  Apparently the operation to save the state (the contents of RAM in the virtual machine) failed during the snapshot causing it to be aborted.  If you are not able to save the VM and then start it (which will merge a deleted snapshot), then you could try shutting down the virtual machine and then starting it which should also merge a deleted snapshot.

    18 марта 2012 г. 5:35
  • Hi John, thanks for the reply.

    I have no issues shutting down the VM and starting it - there is not a broken chain or anything.  I turned off the VM last night, in the hopes that it was just taking forever to merge it, but I checked it this morning, and it has not merged.  It's as if it is using the .avhd file for the snapshot, but HV Manager, and SCVMM doesnt detect that there even is a snapshot...

    18 марта 2012 г. 11:32
  • So, does the size of the .avhd file grow when the VM is running? 

    The vsv file and bin file are created in the snapshot folder if the snapshot was taken while the virtual machine was running, or paused, or saved.  The bin file is an image of VM memory and the vsv file is the saved state of the VM.  If a snapshot is taken when a VM is stopped, you won't have a vsv or bin file in the snapshot directory.  The .avhd will however grow, regardless of what state the VM whas in when the snapshot was taken, when the VM is running because avhd file is basically a differencing disk. 

    Since you have a VSV file but no BIN file in the snapshot directory, and the error from the log would indicate that the snapshot aborted, I'd lay odds on it being orphaned.  Please confirm that the .avhd file does or does not grow when the VM is running.  If the .avhd is not growing, then writes are not going to this differencing file.  You can remove it if you don't need the changes in the snapshot.

    If the VM is growing, writes are going to the differencing file and you'll want to recover it to keep any changes since when the snapshot was taken.  To do this, let's assume you have a vhd file and an avhd file:

    My_VM.VHD

    My_VM_1.AVHD

    1. Shut the VM Down. 

    2. Rename My_VM_1.AVHD to My_VM_1.VHD

    3. Create a new VM, but specify using an existing disk, My_VM_1.VHD. 

    Changing the extention from AVHD to VHD turns the snapshot into a regular old differencing disk.  You can inspect the differencing disk on the new VM:

    And you can merge it with the parent (the original VHD):

    • Помечено в качестве ответа Vincent HuModerator 9 апреля 2012 г. 8:50
    18 марта 2012 г. 13:08
  • Hi,
     
    Please right click on the problematic VM, select “Settings”, check the Hard Dive under IDE Controller. Following is a screenshot from my Hyper-V computer, I have deleted the snapshot and the snapshot had not been merged into the original VHD file. So you will be able to find that the IDE Controller associate with a .avhd file instead of .vhd file.
     
     
     
    By the way, you can manually merge the snapshot into vhd file.
     
     

    Vincent Hu

    TechNet Community Support

    • Помечено в качестве ответа Vincent HuModerator 9 апреля 2012 г. 8:50
    19 марта 2012 г. 6:05
  • Thanks for the info, i will give this a try. there are 2 .avhd files, one is large, and the other is smaller. the smaller one is one that is being written to. How would i go about doing this if there were 2 orphaned snapshots? thanks. EDIT: nevermind, i see the steps in the link you provided.
    • Изменено Ian Silber 19 марта 2012 г. 14:29
    19 марта 2012 г. 14:27
  • If the Hyper-V Server is R2.

    Then, using the Hyper-V manager, create a new snapshot and export this new snapshot, then import this exported machine as a repalcement.

    In the end you will end up with a VM with a single, flattened VHD.

    (regardless of what may have happened to get you here).


    Brian Ehlert (hopefully you have found this useful)
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

    • Помечено в качестве ответа Vincent HuModerator 9 апреля 2012 г. 8:50
    19 марта 2012 г. 15:11
  • If the Hyper-V Server is R2.

    Then, using the Hyper-V manager, create a new snapshot and export this new snapshot, then import this exported machine as a repalcement.

    In the end you will end up with a VM with a single, flattened VHD.

    (regardless of what may have happened to get you here).


    Brian Ehlert (hopefully you have found this useful)
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

    This sounds like the lesser of 2 evils.  thanks!
    19 марта 2012 г. 17:24
  • Brian,

    I used your methodology, and it worked very well.  Appreciate your help!

    Ian

    10 апреля 2012 г. 17:18