VMware Cloud Community
ktf12
Contributor
Contributor

Accidentally deleted .vmdk, anyway to recover the files?

Hi all,

I have a VMWare EXi 6.5 server with 3 data HDDs and 1 SSD containing my linux VM.

I used the entire usable area of the 3 x HDDs to create VMFS partitions and then passed over to my Linux VM to create a ZFS pool. I recently deleted my VM from VMWare host management web interface and I noticed that all the .vmdks files for the 3 disk devices got deleted along with it.

Is there a way to recover the ZFS pool or vmdk files? I tried TestDisk and photore but no luck. photorec and TestDisk aren't VMFS aware so not sure if it can recover single large .vmdk. (it recovered bunch small .vmdks though - not sure how valid they are. I looked at them on an hex editor and found they contain some file content).

I have left the 3 HDDs untouched and nothing has been written to it since so I know the content of the VMFS partitions are in tact. Do you think if I create a new .vmdk for each HDDs (utilising the entire space available for each disk) would allow me to re-import my zfs file system in a new linux VM?

Would creating new .vmdks overwrite the important sectors in those 3 HDDs?

9 Replies
harry89
Enthusiast
Enthusiast

Descriptor files can be recreated with the help of .vmx file

VMware Knowledge Base

For actually flat.vmdk (data) files please check with the storage or see if any image backups are being used

Harry
VCIX-DCV6.5 ,VCIX-NV6 , VCAP-CMA7
Mark answer as correct/helpful if it solves your query
Reply
0 Kudos
nachogonzalez
Commander
Commander

Hey, Hope you are doing fine

VMDK files are just a descriptor file (a virtual abstraction of the electronic components of a HDD), all the data is stored on a file called .flat_vmdk (which is a virtual abstraction of the spinning disks on a HDD).

What i would do is connect via SSH to the ESXi host and scan the VMFS for flat_vmdk files

something like

ls -al /vmfs/volumes/YOUR/DATASTORE

If flat vmdk exist they can be recreated by doing this VM disk is not recognized

Hope this works

continuum
Immortal
Immortal

That does not sound good - it is unlikely that you only deleted the descriptor-vmdks with ESXi 6.5.

Also hearing about the ZFS-pool is no advantage - is that ZFS-filesystem spread over several vmdks ?

Do you have one datastore that is not affected ? - if you have a datastore from which you did not delete vmdks then we could have a look at the VMFS-header dumps ...

Anyway - can we have more details about the current situation and the ZFS-related details ?

Ulli

.


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

Reply
0 Kudos
ktf12
Contributor
Contributor

Hi,

yeah I think all files associated with the VM data store were deleted when I deleted my linux VM. so vmdks and flat_vmdks are gone. There are no files when I try to list all (-all).

Yes, ZFS filesystem is spread across all three vmdks and unfortunately when the VM was deleted, it deleted all three of those data stores (which is quite silly without a user prompt).

Reply
0 Kudos
continuum
Immortal
Immortal

That sounds like you somehow confuse VMDKs and datastores.

A delete VM action will definetely do NOT remove the datastore.

Is it possible that you used RDMs instead of regular VMDKs ?

rdm means raw device mapping = and with RDMs it would be  somehow make sense ...

Can you show us what you still have with some screenshots ?


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

Reply
0 Kudos
ktf12
Contributor
Contributor

I think I'm fairly certain I used VMDKs to be passed to Linux VM.

I attached some screen captures of my current configuration as per your request.

Let me know if you need further info or screen captures.

Thank you so much for your help.

Reply
0 Kudos
continuum
Immortal
Immortal

Is the datastore SSD available for creating a small Linux VM ?

If yes -I would like to have a closer look


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

Reply
0 Kudos
djjaeger
Contributor
Contributor

Did you ever find a solution to this problem? I just had the same issue myself.  I had created a duplicate VM to troubleshoot some GPU passthrough I was working on (lets just call it VM2).  I assigned the same disks that were in use by VM1.  I finished my troubleshooting and playing around with VM settings to get things working properly, so I deleted VM2....

It didn't pop up and warn that the disks would be deleted... It did not warn that the disks were also associated with another VM... (which would be a nice safety feature in my opinon).  It just deleted VM2 along with the disks that I need for VM1.  Is there any way to undelete?  No data has been written to the datastore at all since this happened just a few minutes ago.  

I'm running ESXI 7 U1 on my homelab, and the datastore is a NFS share from my TRUENAS box (and no I don't have snapshots setup, ugh)... I know my fault... but still if there's any hope I'd truly appreciate if anyone could reach out.

wnofearw
Contributor
Contributor

I realize this is an old thread, but any chance you are still around this forum?

i accidentally deleted a VM and the 2 vmdk files were deleted with it.  any possible chance of recovery?  i have not written or created any additional VMs on this server in the hopes of recovery.

 

Reply
0 Kudos