VMware Communities
nelfata
Contributor
Contributor

How to fix linked clone with lost parent snapshot?

Hi,

I have lost the parent snapshot for a linked clone while performing a resize of the parent.

Is there any way to recreate the snapshot and have the linked clone recognize and be able to access the files in the linked clone?

I am using VMWare Fusion 6.0.2

Here is what I did:

- tried to resize the parent but got a message that the snapshots need to be deleted

- the delete confirmed that the linked clone will not be affected

- I deleted the snapshots

- then attempting the resize again, was prompted to perform a cleanup

- after performing the cleanup could not startup the linked clone

apparently the cleanup deleted the snapshot used initially while creating the linked clone...

Trying some ideas:

- I created another linked clone (from the same parent)

- then replaced the .vmdk with the inaccessible linked clone

- then modified the parentCID

- the VM started but hung early on with at the black screen

If there is any way to recover or recreate the snapshots and have the linked clone link back into the parent please provide the procedure.

I would appreciate your help as I have lost 3 months of work, or if there is any way to access the files in the linked clone so I can save them and dump the old VMs.

Thank you in advance.

0 Kudos
13 Replies
WoodyZ
Immortal
Immortal

I would appreciate your help as I have lost 3 months of work, or if there is any way to access the files in the linked clone so I can save them and dump the old VMs.

Is there and good reason why you do not have proper backups?

Instead of trying to start the Virtual Machine from the installed Guest OS, which under the circumstances will most likely fail anyway and probably cause more issues for an attempted recovery I'd try mounting the virtual hard disk if it's a mountable filesystem that VMDKMounter or Parallels Mounter understands, e.g. NTFS, Ext3 etc.  Or try booting the Virtual Machine from a Recovery Type Disc ISO Image or Live OS ISO Image, etc.

VMDKMounter is no longer included with VMware Fusion since IIRC v3.x so you'd have to get a copy from it and install it manually.  Have a look at Fusion 4: no VMDKMounter for information on this and if you install it manually and have an issue look for my reply in that thread which shows the proper permissions.

0 Kudos
nelfata
Contributor
Contributor

Thank you for your prompt reply.

Yes I have no good reason, I was traveling, so it was more lack of diligence from my part for not performing backups.

Anyway, I attempted to follow your instructions and here is what I got:

lion:MacOS Nad$ ./vmware-vmdkMounter /Users/Nad/Desktop/VMWare/Office.vmwarevm/Windows\ 7\ Ultimate\ AIO-cl2-000001.vmdk

Failed to analyze snapshot chain '/Users/Nad/Desktop/VMWare/Office.vmwarevm/Office.vmx'.

Will not be able to make an informed decision based on partial information.

Mounting the disk read-only instead.

mount_osxfusefs: failed to mount /private/var/run/vmware/fuse/10656104320646347603@/dev/osxfuse0: Socket is not connected

NOTE:

I was not able to run VMDKMounter from Finder, I had to to the path where vmware-vmdkMounter and execute it as shown above.

I did not need to change any permission with the exception of the .vmdk file.

Any ideas? Perhaps I am misusing the tool?

Thank you.

0 Kudos
nelfata
Contributor
Contributor

In addition, there is a warning popup window showing:

"It is not safe to mount the virtual disk.  It may be attached to a suspended or powered on VM, or it may be inside a snapshot chain."

0 Kudos
WoodyZ
Immortal
Immortal

Obviously VMDKMounter is no longer supported beyond the last version of VMware Fusion it was included in however it still manages to work if the disk is not damaged or limited by it programming directives.  I still use it with VMware Fusion 6.0.2 from a VMware Fusion 3.1.2 installer using Pacifist to install it to its default location.  Prior to installing it I had also installed Fuse for OS X (with the "MacFUSE Compatibility Layer" checked) and Tuxera NTFS for Mac.

You may need to first manually execute the VMDKMounter.app and then log out/in or alternately use the following two commands.

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f /Library/Application\ Support/VMware\ Fusion/VMDKMounter.app

killall Finder

To use VMDKMounter you ctrl-click (right-click) the target Virtual Machine Package or .vmdk virtual hard disk and select Open With > VMDKMounter

I find that selecting the appropriate target .vmdk file succeeds when selecting the Virtual Machine Package fails under VMware Fusion 5 and 6, of course assuming proper conditions exist.

I have found Parallels Mounter to at times work when VMDKMounter fails.

The other alternatives I've already mentioned and that's to boot the Virtual Machine from a appropriate Live OS ISO Image.  I also use one that initially mounts the disk R/O so as not to alter it already compromised structure in the use case scenario like you have.

0 Kudos
nelfata
Contributor
Contributor

Yes thank you. Those tools don't seem to work so far.

I will try to use the alternative option you mentioned.

Hopefully I will be able to recover the files.

By the way, is there any remote chance to recreate a new linked clone from the same parent and be able to point the orphaned linked clone to the snapshot that gets created with the linked clone?

I have attempted to do that, and changed the ParentCID but with no luck. There must be some way I would think.

Thank you.

0 Kudos
WoodyZ
Immortal
Immortal

Okay, I took a VM and created a clone...

Booted the clone and DnD a bunch of images and documents to it and then shut it down.

Went back to the Parent, deleted the Snapshot and resized the virtual hard disk.

Went to the clone and fixed the parentCID however it would not boot or mount with VMDKMounter as expected because the virtual hard  disk of the clone was a different size then the parent.  However Parallels Mounter did mount it and I was able to retrieve the files although I do not recommend this because it reset the date/time stamp on all files to the date/time it was mounted and really was just wanting to see if Parallels Mounter would not care that the parent and child disks were of different size.

Now this is what I did to get VMDKMounter to mount the disk that had the data and also booted from Live OS ISO Image mounting R/O and retrieving the data.

With the original Parent resized I created a new linked clone of the same name the original linked clone at a different location.

Next I copied all but the first and last the .vmdk files from the original clone overwriting the same files in the new clone.  The first being the "Disk DescriptorFile" not the first binary extent and the last being the last binary extent.

This got past the original error messages because the parent and child disk were now the same size only now the new clone contained all of the binary extents that had data in them from the original clone.

I did make a copy of the parent disk and the new mixed file clone disks into a separate folder so initially only the virtual disk files existed to test mounting with both VMDKMounter and Parallels Mounter so as to avoid any possible conflicts with other existing files and Parallels Mounter again changed the date/time stamp on all files so personally I would not use it except as a last resort as I utilize date/time stamp information and don't what it being changed unnecessarily.  I also added a .vmx configuration file to the set of .vmdk files and booted it with a Linux Live OS ISO Image and retrieved the files as well.

So recovery is possible in multiple ways although there is no guarantee that in you're particular use case scenario that you'll be able to retrieve everything with no corruption.   What I did was done in a very controlled manner with intimate knowledge of the product and structure of virtual hard disks and a small data sample and without having run the parent disks OS live after the resize.  So the way I did it the recovery was expected to be full with no corrupted files.  YMMV! Smiley Wink

Message was edited by: WoodyZ - Note that I also corrected the parentFileNameHint as necessary because of copying the files to different location for testing.

0 Kudos
nelfata
Contributor
Contributor

Hello again,

first I would like to thank you for taking the time and providing your excellent comments and details on how to resolve the issue.

I would like to clarify that I did not resize the parent after I deleted accidentally the snapshot for the linked clone, but I have rerun the parent VM although not sure if that might have an effect.

I have changed the ParentCID of the linked clone but according to what you said it should have worked due to the fact that the parent size did not change, but maybe rerunning the parent could have made some changes.

I also tried using Slax with your suggestions, and changed the clone's HD to point to the vmdk we are trying to recover, but that did not work, the VM could not boot (only through the BIOS) and could not find the OS.

I have also found this tool: http://www.diskinternals.com/partition-recovery/

It looks promising, if you have any thoughts about it that might be helpful.

I thank you again, and I will follow your steps to see how far I could go with this.

0 Kudos
WoodyZ
Immortal
Immortal

I reread your OP and I see now that you only tried to resize it.  I thought after deleting the snapshot and cleanup you also then resized it.  Anyway, having run the Parent VM and having deleted its Snapshot(s) especially if having run the Parent considerably after creating the clone can greatly lessen the chances of a good recovery of data in the Linked Clone.  Not saying it's imposable at this point because I have no hard data to analyze.

If you want to provide the Support bundle then... To help figure out what is what, the best way to provide comprehensive diagnostic information is to use the "Collect Support Information" command from the VMware Fusion (menu bar) > Help > Collect Support Information and then attach the .zip file it created on your Desktop to a reply post.

Note: Use the "Use advanced editor" link in the upper right corner of the normal reply window to bring up the Advanced Editor where you'll be able to attach files via the Choose File button or Browse button (depending on the Browser) above the Post Message button!

0 Kudos
nelfata
Contributor
Contributor

I have attached the file requested.

The two VMs I am interested in are called: Development and Office

Development is the crucial one.

I think I am asking too much here, and to be fair please let me know how I can reward you for your services.

Thank you.

0 Kudos
WoodyZ
Immortal
Immortal

I see the virtual disks are of type monolithicSparse, so how did you edit the parentCID?

Also I'm headed out for a couple of hours so I'll further review the information in the support bundle a bit later.

0 Kudos
nelfata
Contributor
Contributor

I edited the VMDK file with emacs.

Thank you.

0 Kudos
nelfata
Contributor
Contributor

If I can recover the VMs that would be even better, but I will be satisfied with the files at this point.

0 Kudos
nelfata
Contributor
Contributor

I was able to use the following tool:

Partition Recovery and Partition Table Recovery software

It worked well, although it seemed to create multiple copies of some of the files that were written within the last few hours of the failure/delete. When transferring the files, the transfer prompted me to overwrite or have copies of the same files, so you would need to deal with that. Overall it is a good tool with a reasonable price.

Thank you for your input and time to help me with this issue.

0 Kudos