Hyper-V Windows Server 2016. Accidently deleted all files in Virtual Machine Folder

Shishir 1 Reputation point
2021-05-24T12:41:25.843+00:00

Hello Gurus

I had a Virtual Machine called XXXY. It was created in a failover cluster.

I Stopped the VM in Failover Cluster Manager.
I Deleted the VM from Failover Cluster Manager.
and then
By Mistake I deleted all files in the folder named "XXXY/Virtual Machines" (There were 2 files and 1 empty folder in it).

I tried creating a new VM and attaching the existing VHDX file from XXXY/Virtual Hard Disks/XXXY.Vhdx but getting an error.

The Object is in use.

Please advise how to fix this error. I do not know where this file is being used as it was deleted from Failover Cluster Manager too.

Windows for business | Windows Server | Storage high availability | Clustering and high availability
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Anonymous
    2021-05-25T02:11:38.12+00:00

    Hi,
    Based on my understanding, you mistakenly deleted the files as below, am I correct?
    99321-image.png
    The VMCX file is the configuration file of the VM while The VMRS file is the state (so memory, etc.) of the VM. If you delete them, the VM will stop working or not booting next time, etc.
    To fix this, I would suggest that you create another empty VM first, and attach the vhdx file to it. This way, new VMCX and VMRS files would be created, and it should solve this problem.
    Creating new VM:
    99322-image.png
    Attaching vhdx file:
    99323-image.png
    99267-image.png

    Thanks for your time.
    Best regards,
    Danny

    -----------------------------

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

  2. Anonymous
    2021-05-25T05:46:14.103+00:00

    Hi Shishir,
    Based on your description you've deleted the VM from Failover Cluster manager.
    Would you check the Hyper-V manager and see if the VM has been deleted?
    99289-image.png
    Please make sure that in both managers you've deleted the VM, and try again.

    Thanks for your time.
    Best regards,
    Danny

    -----------------------------

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  3. Anonymous
    2021-05-25T08:51:24.837+00:00

    Hi,
    Well, this is strange. Maybe you can refer to this:
    https://community.spiceworks.com/topic/2033520-error-when-starting-vm-hyper-v-failed-to-change-state
    Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.

    Since log analysis is not within the forum scope, I would suggest you contact Microsoft Customer Support and Services where more in-depth investigation can be done so that you would get a more satisfying explanation and solution to this issue. In addition, if the issue has been proved as system flaw, the consulting fee would be refund. You may find phone number for your region accordingly from the link below.
    Global Customer Service phone numbers:
    https://support.microsoft.com/en-us/help/13948/global-customer-service-phone-numbers

    Thanks for your time.
    Best regards,
    Danny

    -----------------------------

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.