VMware Communities
vmwarejockey
Contributor
Contributor
Jump to solution

Merging non-OS snapshot disks on a different VM using VMWare Workstation 11

I recently had a VM Guest OS crash frequently which had a few snapshots associated with it.  I had both an OS VMDK disk and a secondary data VMDK disk.  I could not revert to snapshot because that would mean that I would lose all of my data on my secondary data disk.

I hastily deleted the OS disk and moved the data VMDK disks over to another Guest VM and attempted to use it only to discover all of the files on the secondary data disk.

However, when I attempted to mount the secondary data disk in a guest VM, I could not do so to discover all of the files in the snapshot.

Is there a way for me to merge the data between the 2 snapshots in the disk to have a single consolidated file?

I attempted to try and run a vmware-vdiskmanager.exe -r command, but I think the parent disk was converted to a newer version so it put the 2 disks out of sync and I got this error message:

vmware-vdiskmanager.exe : VixDiskLib: Invalid configuration file parameter. Failed to read configuration file.

Failed to convert disk: The parent virtual disk has been modified since the child was created. Parent virutal disk's content ID does not match with the parent content ID in the child

(0x3e88).

Please advise as to how to get this data consolidated between my snapshots on my secondary data disk.

Can you please provide an example of how to accomplish this using the dsfi.exe command since I am not familiar with this command and the documentation on the website does not seem to provide much insight on how to accomplish what you have outlined in your reply.

Thanks again.  Your help is greatly appreciated.

Message was edited by: vmwarejockey

Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
a_p_
Leadership
Leadership
Jump to solution

Assuming you extracted the first 1536 bytes using dsfo.exe, backup and then edit this file, and finally use dsfi.exe to inject the modified file into the .vmdk file again using the following syntax:

dsfi <destination> <offset> <size> <source>

e.g.: dsfi.exe vmname.vmdk 0 1536 modified_file.bin

Prior to injecting the modified file, please double-check that it sill has the same size, and use e.g. fc /b extracted_file.bin modified_file.bin to ensure that only the parentCID has been modified.


André

View solution in original post

Reply
0 Kudos
8 Replies
a_p_
Leadership
Leadership
Jump to solution

As a first step, please provide a full list of files (the output of dir *.* /oen), to find out what's required fix the snapshot chain, and try to consolidate the snapshots.

André

Reply
0 Kudos
vmwarejockey
Contributor
Contributor
Jump to solution

I just have the Data.vmdk and Data-000002.vmdk files that I copied from my other Guest OS directory.  That is it.

Thanks.

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

With just the two disks I assume that these are monolithic sparse files, i.e. they have the descriptor embedded.

Please download dsfok.zip from http://faq.sanbarrow.com/index.php?action=artikel&cat=47&id=111&artlang=en, extract the executables, run the below mentioned command in the .vmdk's folder, then compress/zip the "xxx-....bin" files and attach them to a reply post

for %i in (*.vmdk) do @dsfo.exe "%i" 0 1536 "xxx-%~ni.bin"

André

Reply
0 Kudos
vmwarejockey
Contributor
Contributor
Jump to solution

I have attached the output files from dsfo.exe for your review here.

I used the commands outlined in the article since I am not very familiar with batch syntax since I primarily use PowerShell nowadays.  Hopefully it has the information that you need.  If not, please provide me with the corresponding PowerShell syntax needed to run this tool.

This is what I used as my PowerShell script:

$VMDKFiles = "C:\VMs\Data.vmdk", "C:\VMs\Data-000002.vmdk"

$dsfoFilePath = "D:\dsfo.exe"

Clear-Host

foreach ($VMDKFile in $VMDKFiles)

{

$OutputFileName = Split-Path $VMDKFile -Leaf

$DSFOCmd = @"

""$dsfoFilePath" "$VMDKFile" 0 1536 "C:\Temp\$OutputFileName.txt""

"@

Write-Host $DSFOCmd

& "$dsfoFilePath" "$VMDKFile" 0 1536 "C:\Temp\$OutputFileName.txt"

}#foreach

Thanks.

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

To fix the snapshot chain you need to modify the "parentCID" in the snapshot .vmdk file, either by modifying the extracted file and using dsfi.exe, or by using a hex-editor. Make sure you backup the file prior to modifying it!

parentCID=89169aa4 -> 71c0f71a (i.e. the parent .vmdk file's CID)

This should allow you to clone the virtual disk (using the snapshot .vmdk file as the source). However, depending on the changes made to the parent .vmdk file you may see more or less data corruption in the guest file system.

André

vmwarejockey
Contributor
Contributor
Jump to solution

Can you please provide an example of how to accomplish this using the dsfi.exe command since I am not familiar with this command and the documentation on the website does not seem to provide much insight on how to accomplish what you have outlined in your reply.

Thanks again.  Your help is greatly appreciated.

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Assuming you extracted the first 1536 bytes using dsfo.exe, backup and then edit this file, and finally use dsfi.exe to inject the modified file into the .vmdk file again using the following syntax:

dsfi <destination> <offset> <size> <source>

e.g.: dsfi.exe vmname.vmdk 0 1536 modified_file.bin

Prior to injecting the modified file, please double-check that it sill has the same size, and use e.g. fc /b extracted_file.bin modified_file.bin to ensure that only the parentCID has been modified.


André

Reply
0 Kudos
vmwarejockey
Contributor
Contributor
Jump to solution

Thank you so much!!

That worked beautifully!!  Smiley Happy

Reply
0 Kudos