VMware Cloud Community
nfcohl
Contributor
Contributor

Need help to rebuild vmdk and vmsd files

Hello,

Lacking space on my SAN, I accidentally rm a folder (named New Virtual Machine) which didn't have the name of the VM itself.

Luckily Vm was running and most files where in busy state.

I successfully recreated the vmdk file for the main disk to work, but I Can't get the snapshots to appear.

Here is my folder list (chronologically) and the vmdk files attached that I tried to recreate +vmx +vmsd (auto recreated when registering VM) :

ls -alt

total 114519048

drwxr-xr-x    1 root     root          4620 Sep 21 08:25 .

-rwx------    1 root     root          3264 Sep 21 08:25 Nouvelle machine virtuelle.vmx

-rw-------    1 root     root           490 Sep 21 08:23 Nouvelle machine virtuelle-000007.vmdk

-rw-r--r--    1 root     root           287 Sep 21 08:23 Nouvelle machine virtuelle-000005.vmdk

-rw-r--r--    1 root     root           287 Sep 21 08:21 Nouvelle machine virtuelle-000012.vmdk

-rw-r--r--    1 root     root           286 Sep 21 08:21 Nouvelle machine virtuelle-000008.vmdk

-rw-r--r--    1 root     root           287 Sep 21 08:20 Nouvelle machine virtuelle-000009.vmdk

-rw-r--r--    1 root     root           287 Sep 21 08:19 Nouvelle machine virtuelle-000006.vmdk

-rw-r--r--    1 root     root           287 Sep 21 08:18 Nouvelle machine virtuelle-000004.vmdk

-rw-r--r--    1 root     root           287 Sep 21 08:17 Nouvelle machine virtuelle-000003.vmdk

-rw-r--r--    1 root     root           287 Sep 21 07:51 Nouvelle machine virtuelle-000002.vmdk

-rw-r--r--    1 root     root           287 Sep 21 07:50 Nouvelle machine virtuelle-000001.vmdk

-rw-------    1 root     root            43 Sep 21 07:37 Nouvelle machine virtuelle.vmsd

-rw-------    1 root     root        552566 Sep 21 07:35 vmware.log

-rw-------    1 root     root     268435456000 Sep 21 07:35 Nouvelle machine virtuelle-flat.vmdk

-rw-------    1 root     root          8684 Sep 21 07:35 Nouvelle machine virtuelle.nvram

-rw-------    1 root     root        268375 Sep 20 14:50 vmware-6.log

-rw-------    1 root     root         69368 Sep 20 14:01 vmware-5.log

-rw-------    1 root     root         70241 Sep 20 13:57 vmware-4.log

drwxr-xr-t    1 root     root          4760 Sep 20 13:54 ..

-rw-------    1 root     root         69489 Sep 20 10:20 vmware-3.log

-rw-------    1 root     root         70364 Sep 20 10:16 vmware-2.log

-rw-------    1 root     root        243696 Sep 20 10:04 vmware-1.log

-rw-------    1 root     root     3255296000 Sep 20 10:04 Nouvelle machine virtuelle-000007-delta.vmdk

-rw-------    1 root     root     419946496 Sep  7 07:44 Nouvelle machine virtuelle-000005-delta.vmdk

-rw-------    1 root     root     621273088 Sep  6 14:37 Nouvelle machine virtuelle-000012-delta.vmdk

-rw-------    1 root     root     19512418304 Sep  5 16:02 Nouvelle machine virtuelle-000008-delta.vmdk

-rw-------    1 root     root     2131222528 Sep  4 15:31 Nouvelle machine virtuelle-000009-delta.vmdk

-rw-------    1 root     root     235397120 Sep  3 08:31 Nouvelle machine virtuelle-000006-delta.vmdk

-rw-------    1 root     root     168288256 Aug 31 09:05 Nouvelle machine virtuelle-000004-delta.vmdk

-rw-------    1 root     root     5100789760 Aug 30 15:23 Nouvelle machine virtuelle-000003-delta.vmdk

-rw-------    1 root     root     587718656 Aug 30 14:18 Nouvelle machine virtuelle-000001-delta.vmdk

-rw-------    1 root     root     40634933248 Aug 30 13:32 Nouvelle machine virtuelle-000002-delta.vmdk

Tags (2)
7 Replies
nfcohl
Contributor
Contributor

Thanks for the help you can provide me Smiley Happy

Excuse my english, as it is not my native language

0 Kudos
SupreetK
Commander
Commander

Assuming the snapshot chain was in the numbered order (going by the available delta files), I have created the descriptor files and attached to this reply.

1) Power off the VM.

2) Unmount the disk from VM --> Edit Settings.

3) Move all the existing descriptor files (including the flat one) to a temporary directory.

4) Copy the attached files to the same VM folder.

5) VM --> Edit Settings --> Add existing disk --> select the 000012.vmdk disk.

6) Power on the VM.

Cheers,

Supreet

a_p_
Leadership
Leadership

To avoid data corruption and/or loss it's important to create the snapshot chain in the correct order.

As you can see from the file's time stamps the order cannot be derived from the file names.

Please compress/zip all the vmware*.log files, and attach the .zip archive to a reply post. Unless all the log files have already been overwritten they contain information about the original snapshot chain.

Unless it's 100% clear how the correct snapshot chain looks like, you risk your data.


André

0 Kudos
nfcohl
Contributor
Contributor

Thanks for the reply Supreet,

This is working great, you're the man !!

I can't find the list of snapshots, but it is at least the last good version of the VM.

Have a good one

nfcohl
Contributor
Contributor

Thanks André,

Unfortunately the log files were removed with the rest of the descriptors.

As it is not a vital issue (not a server but an image to deploy, which took quite a long time to build for my colleague) I tried the files Supreet gave me, and it seems fine for now.

0 Kudos
continuum
Immortal
Immortal

@ Supreet Kulkarni
I unmarked your "correct answer"
Please never do something like this again.
Your answer is not correct - instead it is highly dangerous.
With the data you had you could not give an answer at all.
You completely ignored the order of snapshots - it would have been better to sort them in the order of the timestamps from the list of delta-files.
It would have been better to ask for a log file to read the order of the snapshots from that.
You even ignored the setting in the vmx-file !!!!
Please stop answering questions like this one if you do not know how to do this !!!

Ulli
This would have been the safe approach:
1. ask for log files to reconstruct the order of snapshots
2. if there are no log files extract the vmdk descriptors from a VMFS-metafile dump


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

nfcohl
Contributor
Contributor

Ok thanks for the update,continuum.

Indeed it was done too quickly, no harm this time, I'll ask you if it ever happens again, but I doubt it, as I hope to never do the same mistake again

0 Kudos