VMware Cloud Community
Wincio
Contributor
Contributor

Help restoring VM from flat and delta .vmdk files

Hello to all VM community.

I'm asking help cause some days ago I accidentally deleted a VM files. In that moment the VM was online and active so I was able to recover machine-flat.vmdk and machine-delta.vmdk. Following a old topic I started to recover and recreate .vmdk file from 'flat' and then .vmx. At this point I tried to recreate, following the indication in the old post, all the other files in a way to recreate the consistency in the disk chain and then try to link the configuration file to the delta file.

But when I started the VM I immediately receive an errror: "Failed to power on VM. Unable to enumerate all disks". It is possibile that I made some mistakes in the recreation of the description files. If someone could help to check what I done I'll be greatful.

Here i post the ls -lisa command of the VM directory:

272646916 8 drwxr-xr-x 1 root root 1120 Apr 27 14:04 .
4 1024 drwxr-xr-t 1 root root 1540 Jan 10 2018 ..
201343748 0 -rw-r--r-- 1 root root 43 Apr 27 14:04 THOR.vmsd
184566532 8 -rwxr-xr-x 1 root root 2104 Apr 27 14:04 THOR.vmx
578831108 71402496 -rw------- 1 root root 73115275264 Apr 23 15:57 THOR_0-000001-delta.vmdk
205538052 0 -rw-r--r-- 1 root root 260 Apr 27 13:30 THOR_0-000001.vmdk
281035524 48497664 -rw------- 1 root root 85899345920 Feb 3 2019 THOR_0-flat.vmdk
180372228 0 -rw------- 1 root root 476 Apr 27 13:27 THOR_0.vmdk

Here attached to the post I'm sending the reconstructed files. After I notice the problem I immediately copied the original two .vmdk files to another datastore maybe could be usueful.

 

 

0 Kudos
12 Replies
berndweyand
Expert
Expert

the line scsi0:1.fileName = "THOR_0-000001-delta.vmdk" in the vmx is wrong.

should read scsi0:1.fileName = "THOR_0-000001.vmdk"

also check the content of the vmsd if the snapshot chain is correct

 

after modifying the vmx you have to reregister the vm

0 Kudos
Wincio
Contributor
Contributor

Thanks for the fast response. I performed the modification to the .vmx file but I'm not sure about the one to the .vmsd.

Actually I read:

.encoding = "UTF-8"
snapshot.lastUID = "1"

 

Thanks again for your support

 

 

0 Kudos
a_p_
Leadership
Leadership

Forget about the .vmsd file, you can even delete it in this case.

André

0 Kudos
Wincio
Contributor
Contributor

Hi Andrè thanks for the reply.

I deleted the .vmsd file and now Esxi is asking for consolidation of the disks through --> Actions --> Snapshots --> Consolidate Disks

I should proceed with the consolidation? It is going to fix the disk state?

 

 

0 Kudos
a_p_
Leadership
Leadership

The consolidation message shows up, if the snapshot(s) don't match the contents of the .vmsd file, so don't worry about this until you are sure that the VM (guest OS) is ok.

What I would do at this point - assuming you have free disk space on the datastore - is to create another snapshot, so that the current .vmdk files will not get modified, and you will be able to revert to the current state.

Then power on the VM and check everything. After that - if the VM is ok - you may proceed with running "Delete All"  from the Snapshot Manager to consolidate all existing snapshots.

André

0 Kudos
Wincio
Contributor
Contributor

Hi all just a brief summary:

- I recovered/rebuild both .vmx and .vmdk lost files starting from flat and delta ones.

- I fix the mistake on one of the .vmdk file as suggested

- I delete the .vmsd file

- At this point Esxi start to give message to consolidate disk that I ignored

- I was able to create another snapshot (delta2)

- Started the VM, but after some moments of "spinning wheel" it just shut down, no errors where reported on Esxi 

So I downloaded the vmware.log just to see what happen and I found two errro messages that I report:

2022-04-28T17:36:09.167Z In(05) vmx esxui-c357-65ec DISKLIB-DSCPTR: Unrecognized ddb entry. ID='isNativeSnapshot' Val='no'
2022-04-28T17:36:09.167Z In(05) vmx esxui-c357-65ec DISKLIB-VMFS : "/vmfs/volumes/5a18769b-4419e816-04c0-d094661e358a/THOR/THOR_0-000001-delta.vmdk" : open successful (524293) size = 73115275264, hd = 0. Type 9
2022-04-28T17:36:09.167Z Wa(03) vmx esxui-c357-65ec DISK: Failed to retrieve ddb entries: "One of the parameters supplied is invalid" (1)
2022-04-28T17:36:09.167Z In(05) vmx esxui-c357-65ec DISKLIB-VMFS : "/vmfs/volumes/5a18769b-4419e816-04c0-d094661e358a/THOR/THOR_0-000001-delta.vmdk" : closed.

There is something wrong in the configuration/description files? It seems that disk file are ok.

I attach the log file maybe could be of some help.

Thanks for any suggestions

0 Kudos
a_p_
Leadership
Leadership

The disk files seem to be ok, but you've recreate the VM with low memory (16 MB RAM).

2022-04-28T17:36:09.724Z In(05) vcpu-0 - [msg.efi.insufficientMemory] This virtual machine has insufficient memory to boot with EFI firmware, which requires a minimum of 96 MB. Please increase the virtual machine's memory and try again.

André

0 Kudos
Wincio
Contributor
Contributor

Opss I left MB insted of GB during the VM reconfiguration.

Now it is ok, I then power up the VM and after some moments the screen shows up a message of attempting to start up from several source without success (as visible in the picture below). I downloaded the log file and I notice again the error linked to "DISK: Failed to retrieve ddb entries: "One of the parameters supplied is invalid" (1)"

THanks for any advice

 

 

0 Kudos
berndweyand
Expert
Expert

the actual log shows the same error with efi and 96mb ?

your vmx shows memsize=16 which means 16mb

are you sure the original vm was efi boot and not bios ?

you are using virtual hw version 19 (available since 7.0u3 from Oct 2021), but your snapshot was from 2019. so your old vm wasnt running this version. do you have old vmware*.log from the original machine ? with this logs you can recreate the original vmx.

0 Kudos
Wincio
Contributor
Contributor

Hi berndweyand thanks for reply, here the answers to your questions:

- Actual log doesn't show the same error with efi and 96mb, as I correct the VM memory configuration and now has 16Gb memory assigned. The .vmx attached at the beginning of the post was wrong (as incorporated the mistake) now I'm providing the updated one.

- The original machine was created in 2019, I believe that had a normal BIOS and not EFI. Your consideration are right all this problem came up after an upgrade of Esxi from version 6.5 to 7.03. During the migration of one of the two VM I accidentally delete the wrong folder where it was running one VM. I was able to save only the two flat and delta files. I tried to recover deleted files from the datastore but I didn't find any log ones and I do not have one. I only have the log of the other machine that was created in 2018 and was almost identically, could be of any help?

THanks to all for your patience and support!

0 Kudos
berndweyand
Expert
Expert

the other vm has boot mode bios - so just switch to bios and try

and always keep a good copy of the original vmdk while testing

0 Kudos
Wincio
Contributor
Contributor

BANG!!! It worked, I gain complete access to the VM at the precise moment of the shut down.

Thanks a lot for the support, I don' know why Esxi placed EFI as default firmware, but changing it to BIOS let the system start.

Now I'm copying some files and then I'll consolidate the disk preparing it for migration.

Thanks again!

 

0 Kudos