none
Proper Method for Deleting/Moving Virtual Machines/Snapshots RRS feed

  • Question

  • Hello,

    I have had several VMs that I used for testing and exam prep. Each time I try to delete them, I've run into some problems.

    1. There appears to be more to a VM than meets the eye. Not only is there a VHD, but there's also a Virtual Machine XML file and corresponding folder. When I use Delete... to delete the VM, all (some) of this stays behind.
      Q. Do I then just manually delete the VHDs, XML file, and its corresponding folder?
    2. In one instance, I had played with snapshots. When I wanted to move the VM to a new host server, I took just the VHD and created the machine new. This seemed to end up being a bit of a mess, and I decided to rebuild the VM from scratch on the new host.
      Q.  What did I do wrong?

    The snapshot files were especially confusing. I deleted the snapshots out of Hyper-V Manager, but that didn't seem to remove them from the disk.
    Q. How do the steps taken in Hyper-V Manager relate to what actually happens on the disk?

    I just want to make sure that I understand best practices for deleting/moving VMs going forward, and that I maintain clean procedures. I have several VMs now in production, but am getting ready to add more hosts and VMs, and build things out further.

    Thanks for any help you might be able to give...


    Noel Stanford Oveson
    jeremyNLSO
    MCTS, MCITP, CCENT, CNE, MCSE, CLSE
    Berlin, Germany


    • Edited by ArchiTech89 Tuesday, November 20, 2012 7:12 PM clarifying remarks
    Tuesday, November 20, 2012 7:06 PM

Answers

  • Correct, deleting a VM from Hyper-V Manager is simply removing a pointer to the VM information.  It's sort of a safety valve for those people who might accidentally delete something and then realize they just lost 40 hours of work.  So if you really want to get rid of them, go to the root directory of where you stored the VM and delete the whole directory tree after you have deleted the entry from Hyper-V Manager.

    Snapshots are a little different.  If you delete them from within Hyper-V Manager. the contents of the snapshot file will be merged when the VM is shut down.  Once the merge is complete, the snapshot file is deleted. 


    tim

    • Marked as answer by ArchiTech89 Wednesday, November 21, 2012 7:31 PM
    Tuesday, November 20, 2012 11:17 PM

All replies

  • Try this

    ) After deleting the VM inside the Hyper-V program you will still have some files left ove as you notr.

    Delete the files in (if you took the default) "C:\Users\Public\Documents\Hyper-V\Virtual hard disks\"your VM name".vhdx"

    You may also ant to delete

    C:\ProgramData\Microsoft\Windows\"Your VM name"

    Snapshots ar estored in a different directory which is defined in the create VM proces don't have that  handy as I don't use them..

    Tuesday, November 20, 2012 7:19 PM
  • So when you delete the VM in Hyper-V Manager, nothing gets deleted on the hard disk? Everything stays out there and you have to manually delete everything, including snapshots?

    Also, is there something I did or didn't do to mess up when I tried to delete the snapshots? Am I understanding that when you delete snapshots in Hyper-V Manager, they also remain on the hard disks and have to be manually deleted?

    I'm just a tad bit confused as to whether anything gets deleted from the hard disk at all...

    Thanks.


    Noel Stanford Oveson
    jeremyNLSO
    MCTS, MCITP, CCENT, CNE, MCSE, CLSE
    Berlin, Germany

    Tuesday, November 20, 2012 8:30 PM
  • Correct, deleting a VM from Hyper-V Manager is simply removing a pointer to the VM information.  It's sort of a safety valve for those people who might accidentally delete something and then realize they just lost 40 hours of work.  So if you really want to get rid of them, go to the root directory of where you stored the VM and delete the whole directory tree after you have deleted the entry from Hyper-V Manager.

    Snapshots are a little different.  If you delete them from within Hyper-V Manager. the contents of the snapshot file will be merged when the VM is shut down.  Once the merge is complete, the snapshot file is deleted. 


    tim

    • Marked as answer by ArchiTech89 Wednesday, November 21, 2012 7:31 PM
    Tuesday, November 20, 2012 11:17 PM
  • Control Panel\All Control Panel Items\Programs and Features

    Turn Windows features on or off

    Uncheck the box next to "Hyper-V"

    Restart the PC

    Delete all the files from "C:\Users\Public\Documents\Hyper-V\Virtual hard disks"

    • Proposed as answer by okkeh27 Thursday, October 10, 2019 8:15 AM
    Thursday, October 10, 2019 8:15 AM