question

Shishir-9181 avatar image
0 Votes"
Shishir-9181 asked Shishir-9181 commented

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

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-server-clustering
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

YuhanDeng-MSFT avatar image
0 Votes"
YuhanDeng-MSFT answered Shishir-9181 commented

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.



image.png (42.2 KiB)
image.png (109.3 KiB)
image.png (59.5 KiB)
image.png (80.4 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks but when I tried to do that I got an error saying can not get information from VHDX, Object is in Use.

I copied the VHDX file to another location and then created a new VM and attached the copy of Vhdx file, that got attached and VM is working fine.

Now I want to delete the Old VHDX file but still getting the error Object is in Use.

Please advise what to do.

Regards

Shishir

0 Votes 0 ·
YuhanDeng-MSFT avatar image
0 Votes"
YuhanDeng-MSFT answered Shishir-9181 commented

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.



image.png (89.0 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes it was deleted from both. Hyper-V Manager as well as Failover Cluster Manager.

Regards

Shishir


0 Votes 0 ·
YuhanDeng-MSFT avatar image
0 Votes"
YuhanDeng-MSFT answered Shishir-9181 commented

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.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

99472-capture.jpg



Maybe this is what I am looking for.

The Storage Volume has currently only 1 file, the problematic vhdx. If I detach the Volume from Disk Management, and Reattach the same, it may work.

What do you think?

Regards

Shishir

0 Votes 0 ·
capture.jpg (83.4 KiB)

Hi Shishir,
You may try it. This issue in general could be caused by the occupation of relevant resources.
Just do remember to make copies of your files.

Thanks and best regards,
Danny

0 Votes 0 ·

it worked. thanks

0 Votes 0 ·

Hi,
Glad to see this issue fixed. Would you help accept an answer so that others who have the same issue would know how to deal with it better?

Thanks for your understanding.
Best regards,
Danny

0 Votes 0 ·