VMware Cloud Community
sanskar007
Contributor
Contributor

I deleted snapshots using snapshot manager but have backup. How do I restore? Thank You

I made a blunder and deleted the snapshots using the snapshot manager. The problem is actually wildly different. This goes back.

  1. There was a VM with 2 snapshots

  2. I expanded the HDD of ABC.vmdk file using vmfkstools to 150GB. Previously, supposedly 100GB. I totally shouldn't have used it while there were snapshots present. Stupid me! 

  3. The VM didn't come up.

  4. I further expanded my blunder by deleting the snapshots using snapshot manager.

  5. I researched and found out, I can modify the CID and RW values to solve the problem. But I presume I need snapshots back in place.

  6. I figured out about CID thingy but don't know my old RW value or exact storage value.

  7. I am trying to get those snapshots back. I have copied them back to the directory. I want them to be shown in snapshot manager.

  8. I am stuck and need help. Thank You

Also: flat.vmdk has the size of 150gb. abc.vmdk, abc-000001.vmdk and abc-000002.vmd are just few kbs

0 Kudos
6 Replies
bryanvaneeden
Hot Shot
Hot Shot

Hi @sanskar007 ,

This is a peculiar situation indeed. First and foremost there is a reason the edit button is greyed out on disks once a VM has a snapshot. You can mess up the VM while doing this, and it looks like this has happened to you. Was the GUI not available for you during the expansion or was there any other reason for doing it with the CLI?

As for the issue at hand, by reading your explanation, it does seem like the only good solution here is to restore the VM from a recent backup. Also, the .vmdk files are only descriptor files so they can be a few KB large. The actual files are the "sesparse|flat" files that you will need as far as I know.

I hope this helped.

Visit my blog at https://vcloudvision.com!
0 Kudos
a_p_
Leadership
Leadership

To see what may be done, please provide the following:

  • a complete file listing, i.e. the output of ls -lisa from the VM's folder
  • the content of three small descriptor .vmdk files
  • explain which files you've modified so far, and what you've changed

André

sanskar007
Contributor
Contributor

hrms.vmdk.pnghrms-000001.vmdk.pnghrmsl-000002.vmdk.pngScreenshot_1.png

I expanded the HRMS.vmdk file to 150G even though there were snapshots. The VM didn't come up so I deleted the snapshots using snapshot manager. I got an error of CID mismatch so I did some google and matched the CID and parent CID. Although I couldn't figure out about RW value. I registered a new vm from HRMS.vmdk and it came up! From data from previous month was not there After that I regerested a new vm from HRMS-00001.vmdk, it did come up but got stuck in startup repair thingy of windows 10. Thats all so far

0 Kudos
a_p_
Leadership
Leadership

Did you let Windows run the startup repair, or did you power off the VM immediately after seeing this?

It looks like you've modified the block size (the RW value) in the snapshot files too, which causes even more issues, because the new value doesn't match the binary structure anymore.

Please run hexdump -n 32 -C HRMS-000002-delta.vmdk and post the output to verify the initial virtual disk size.

Also let me know how much free disk space you have on the datastore to create a clone if necessary.

André

PS: Please consider posting the command output as text rather than as a screenshot.

sanskar007
Contributor
Contributor

Apologies for the screenshots. 

I let the windows repair a couple of times. It restarted the machine couple of times. It didn't work either of the time so I shut it down. I did change RW value on 00001.vmdk to match the original vmdk file. It only boot up after doing that.  Also, how did you know that the RW was changed? 

BTW I did a work around to backup my important data. I followed these steps:

1) I added the HRMS-000001.vmdk file as a New HDD (as HDD2) in another VM file (lets say VM B).

2) I logged into B and brought it online through disk management. 

3)  I copied the database mdf and ldf files into C drive of VM B 

4) I registered from HRMS.vmdk and booted from it and imported the database files. 

Although I couldn't get the data after second snapshot. I got most of the data I needed. I am now too scared  run the hexdump. I will save this important command as I couldn't figure out the RW value.

Thank you. Thank you so much for your help

 

0 Kudos
a_p_
Leadership
Leadership

>>> Also, how did you know that the RW was changed?
The RW value is the virtual disk's provisioned size in 512 Byte blocks. The shown value resolves to 150GB instead of the original 100GB.

>>> I am now too scared run the hexdump
The command only ready a few bytes from the file, and displays them in a human readable format.

Since you are now using the base disk again, can I assume that you don't need any further help?

André

0 Kudos