ESXi

 View Only
Expand all | Collapse all

Can you recover an accidentally deleted VMDK file?

  • 1.  Can you recover an accidentally deleted VMDK file?

    Posted Feb 27, 2019 03:43 AM

    I was donated a Dell T420 server which I turned into a web server. I've installed ESXi 6 into which I created a Linux Mint LAMP server for hosting a few non profits and a few small business owners I know for free. This is a hobby level thing - not for money. I am very new to all of this.

    There is a pair of 500GB SAS drives in this. One is Datastore 1 and the other Datastore 2. The web server is installed in Datastore 1.

    At one point the web server crashed and it appeared I have run out of disk space so it wouldn't reboot. After reading a lot online it was suggested to see if removing one or more snapshots might not free up the space. I only had two snapshots in place. I deleted the oldest one. However, this did not appear to free up enough space. I did not want to delete my only remaining snapshot.

    It was then suggested that during the process the associated VMDK files in the datastore may not have been cleaned out properly during the snapshot deletion. I browsed the datastore in which are several different files LOG files, XML files, VMSN, NVRAM, VMSD, VMX, VMXF, and a series of VMDK files, which I've been told would the be the "main" files for the virtual machine.

    The files I had listed were:

    Webserver0.vmdk

    Webserver0-000001.vmdk

    Webserver0-000002.vmdk

    Webserver0-000003.vmdk

    Webserver0-000004.vmdk

    Webserver0-000005.vmdk

    Webserver0-000006.vmdk <---This one being the newest date.

    Not knowing what to do with these I right clicked on the Webserver0-000001.vmdk to see what was available and saw a dropdown menu of options. However, I may have accidentally double clicked and hit the "delete" option from the menu. Before I knew it that file was gone. I then could not boot the VM after. All I get is an error message:

    Failed to power on virtual machine WebServer. File /vmfs/volumes/58866b0f-0a0319b0-38e0-e0db55027e66/WebServer/WebServer0-000001.vmdk was not found

    I looked back in the datastore and now in place of that file is a Webserver0-000001-delta.vmdk file instead.

    I assume all these files are required for the VM to operate? Have I just royally screwed myself and all these people I've been hosting? Is there a way to recover or rebuild that file and restore this machine? I do not have a backup since Veeam said their products won't work with free ESXi. I also have no money and cannot afford to pay a support ticket or buy recovery software that cost $699 at minimum!

    I need help desperately!



  • 2.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Feb 27, 2019 06:35 AM

    Hi Troy and welcome to the community!

    From what you have described it appears that you might have been fortunate and have removed the VMDK descriptor file rather than the actual data component. Now while I could have a go at rebuilding, your best bet is this gentleman: continuum

    If you check his signature, you can contact him on Skype: sanbarrow

    In the meantime could you run the following from the console in the directory containing the VM:

    ls -lsh

    Post the output here please. Also attach the vmx file if that is okay to do.

    Also whatever you do, do not be tempted to attach the base disk directly to another VM or remove references to the snapshots. If the parent disk changes then you are possibly a much worse position.

    Kind regards.



  • 3.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Feb 27, 2019 03:47 PM
    In the meantime could you run the following from the console in the directory containing the VM:

    I'm sorry, but I am very new to this. Where do I go to do this?

    I'm signed into the server remotely through the web client, but don't see where I can enter a console from here? Or, do I have to plug a monitor, mouse, and keyboard into the server and directly interface with it that way?

    I have attached the vmx file as requested. Thank you so much for your quick response and assistance! I'm still freaking out about this.



  • 4.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Feb 27, 2019 03:55 PM

    1. Launch ssh session(using putty) to the ESXi host

    2. type the following

    cd /vmfs/volumes/<datastore name>/<vm directory>

    ls -l | grep -i vmdk

    please post the output, if ssh service is stopped , you may not be able to launch putty session. To start the ssh service , launch ESXi host client from browser

    https://<ESXi ip>/ui

    Then go to configure tab --> security profile --> Services --> there you can start the ssh service



  • 5.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Feb 28, 2019 04:15 AM

    -rw-------    1 root     root     5788553216 Feb  6  2017 WebServer0-000001-delta.vmdk

    -rw-------    1 root     root     25032019968 Feb 22  2017 WebServer0-000002-delta.vmdk

    -rw-------    1 root     root           331 Feb  6  2017 WebServer0-000002.vmdk

    -rw-------    1 root     root     80111620096 Jul 14  2017 WebServer0-000003-delta.vmdk

    -rw-------    1 root     root           358 Jul 14  2017 WebServer0-000003.vmdk

    -rw-------    1 root     root     105864646656 Oct 22  2017 WebServer0-000004-delta.vmdk

    -rw-------    1 root     root           331 Jul 14  2017 WebServer0-000004.vmdk

    -rw-------    1 root     root     109454970880 Jul  5  2018 WebServer0-000005-delta.vmdk

    -rw-------    1 root     root           331 Jun 18  2018 WebServer0-000005.vmdk

    -rw-------    1 root     root     121953996800 Feb 25 23:58 WebServer0-000006-delta.vmdk

    -rw-------    1 root     root           358 Feb 25 23:26 WebServer0-000006.vmdk

    -rw-------    1 root     root     214748364800 Jan 30  2017 WebServer0-flat.vmdk

    -rw-------    1 root     root           527 Jan 30  2017 WebServer0.vmdk



  • 6.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Feb 27, 2019 05:54 PM

    There a re couple of things that need to be clarified to recommend the proper steps to resolve the issue.

    Some things have already been said, but let me put everything together.

    1. enable SSH on the host, and use e.g. putty to connect to it
    2. go to the VM's folder (cd /vmfs/volumes/<datastore-name>/<folder-name>/) and run
      ls -elisa > filelist.txt
    3. use e.g. WinSCP to connect to the host, and download the following files from the VM's folder
      filelist.txt, *.log, *.vmsd, *.vmdk (only the small descriptor .vmdk files without flat, delta, or sesparse in their names)
    4. compress/zip the downloaded files, and attach the .zip archive to a reply post

    How much free disk space do you currently have on the datastore?

    André



  • 7.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Feb 28, 2019 04:27 AM

    It looks like WinSCP is just an FTP program? I don't have Windows. The only other computer I have available is Linux Mint. I will attempt to use Filezilla or another FTP program to download those and will post as soon as I can. Thanks!!



  • 8.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Feb 28, 2019 07:15 AM

    There's a physical 500GB hard drive. The virtual machine is set for 200GB. However, there is only 11MB free in the datastore.



  • 9.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Feb 28, 2019 08:43 AM

    I've attached a recreated descriptor file.

    However, this won't help much due to the low disk space.

    According to the descriptor files, the VM's disk has been thin provisioned, i.e. will most likely grow when you try to delete snapshots, so don't try this at the moment.

    Please post the output for ls -elisa, as this will show not only the files' provisioned disk space, but also the used space. Base on this we need to find out how to resolve this issue.

    How much free disk space do you have on the other datastore? I'm asking to find out whether it is an option to clone the virtual disk from the command line.

    André



  • 10.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Feb 28, 2019 12:49 PM

    @ Glen
    I received a PM from you with the following question:

    Trust you don't mind but I've been playing along at home and this stuff interests me :smileyhappy:

    Would the descriptor file you are going to create look like this (named "WebServer0-000001.vmdk":

    # Disk DescriptorFile

    version=1

    encoding="UTF-8"

    CID=e056a0a1

    parentCID=1065ec08

    isNativeSnapshot="no"

    createType="vmfsSparse"

    parentFileNameHint="WebServer0.vmdk"

    # Extent description

    RW 419430400 VMFSSPARSE "WebServer0-000001-delta.vmdk"

    # The Disk Data Base #DDB

    ddb.longContentID = "914a7521b682d3f525c773e16c3a7f6b"

    Thanks in advance!

    This is no secret knowhow - and the more folks can handle issues like this correctly the better it is for the community.
    So your question is welcome.

    Compare your suggestion with the one that Andre uploaded.
    It has the exact same values - so your suggestion was spot on.
    You may notice that Andre did not include the parameter:
    ddb.longContentID = "914a7521b682d3f525c773e16c3a7f6b"
    which you suggested to include.
    I would have skipped this line as well.
    It is optional and skipping it will do no harm so we both simply skip it.

    Basically you have 5 parameters in a snapshot-descriptorfile that you have to check:

    CID=e056a0a1

    parentCID=1065ec08

    parentFileNameHint="WebServer0.vmdk"

    RW 419430400 VMFSSPARSE "WebServer0-000001-delta.vmdk"

    Lets see how to get the values for each of them:
    CID=e056a0a1
    This value can be looked up in the descriptor of the next child vmdk. It must match the parentCID value of the next child vmdk.
    parentCID=1065ec08
    This value can be looked up in the descriptor of the parent vmdk. It must match the CID value of the parent vmdk.
    parentFileNameHint="WebServer0.vmdk"

    This value references the  path to the parent vmdk.. If both vmdks reside in the same directory the filename is enough. If the parent-vmdk resides in a different directory you must use the full path.
    RW 419430400
    This references the "nominal" size of the VMDK. It gives the size in sectors.This value should be the same for EVERY vmdk in the snapshot-chain.
    If not you will receive an error message: SIZE does not match. Parent has been expanded.

    VMFSSPARSE "WebServer0-000001-delta.vmdk"

    This parameter gives the path to the associated binary file that has the actual data. In 99.99 % of the cases both the descriptor vmdk as well as the binary part reside in the same directory so using the filename will work in almost all cases.

    @ Glen
    Feel free to contact me via skype if you are interested in this topic.
    Ulli



  • 11.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Feb 28, 2019 06:31 PM

    continuum​ - you are too kind and thanks for the explanation. Very clear and very helpful.

    I will take you up on the offer at some stage because this is something that definitely interests me. Often try to follow the bread crumbs as you guys do the work :smileywink:

    This is one thing I love about the VMware community - the free sharing of knowledge. It’s great to be able to try and give back in some small way especially as you learn along the way!

    Thanks again and normal service resumes :smileyhappy:



  • 12.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Mar 01, 2019 01:29 AM

    Here's the output you were looking for.

    total 791560

          4   1024 drwxr-xr-t    1 root     root          1400 Tue Jan 24 21:50:00 2017 .

    73675999881280      0 drwxr-xr-x    1 root     root           512 Thu Feb 28 13:18:17 2019 ..

    4194308   3072 -r--------    1 root     root       2490368 Mon Jan 23 20:43:59 2017 .fbb.sf

    8388612 261120 -r--------    1 root     root     267026432 Mon Jan 23 20:43:59 2017 .fdc.sf

    25165828   2048 -r--------    1 root     root       1179648 Mon Jan 23 20:43:59 2017 .pb2.sf

    12582916 262144 -r--------    1 root     root     268435456 Mon Jan 23 20:43:59 2017 .pbc.sf

    16777220 257024 -r--------    1 root     root     262733824 Mon Jan 23 20:43:59 2017 .sbc.sf

    29360132   1024 drwx------    1 root     root           280 Mon Jan 23 20:44:00 2017 .sdd.sf

    20971524   4096 -r--------    1 root     root       4194304 Mon Jan 23 20:43:59 2017 .vh.sf

    83890564      8 drwxr-xr-x    1 root     root          4060 Tue Feb 26 22:39:17 2019 WebServer

    I have another 500GB drive in this server which is Datastore2. I had copied a bunch of the files from Datastore1 to it, but that's it. I can delete the contents of that datastore so we can use all the space if necessary.



  • 13.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Mar 01, 2019 06:32 PM

    Here's the output you were looking for.

    Not exactly. Sorry if I wasn't clear enough. What I need is this output for the files in the VM's folder.


    André



  • 14.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Mar 02, 2019 05:41 AM

    I'm sorry. I should have gone one more folder deeper. Try this.

    total 462701592

    83890564      8 drwxr-xr-x    1 root     root          4060 Tue Feb 26 22:39:17 2019 .

          4   1024 drwxr-xr-t    1 root     root          1400 Tue Jan 24 21:50:00 2017 ..

    465572228 8388608 -rw-------    1 root     root     8589934592 Thu Jul  5 01:40:24 2018 WebServer-Snapshot8.vmem

    461377924   7168 -rw-------    1 root     root       6386305 Thu Jul  5 01:40:24 2018 WebServer-Snapshot8.vmsn

    301994372      0 -rw-r--r--    1 root     root            13 Mon Jan 30 22:44:34 2017 WebServer-aux.xml

    125833604   1024 -rw-------    1 root     root          8684 Mon Feb 25 23:58:39 2019 WebServer.nvram

    100667780      0 -rw-r--r--    1 root     root           438 Mon Feb 25 22:57:43 2019 WebServer.vmsd

    88084868      8 -rwxr-xr-x    1 root     root          3256 Mon Feb 25 23:58:39 2019 WebServer.vmx

    268439940      8 -rw-------    1 root     root          3283 Mon Feb 25 23:26:01 2019 WebServer.vmxf

    314577284 5653504 -rw-------    1 root     root     5788553216 Mon Feb  6 03:25:30 2017 WebServer0-000001-delta.vmdk

    331354500 24445952 -rw-------    1 root     root     25032019968 Wed Feb 22 22:47:34 2017 WebServer0-000002-delta.vmdk

    335548804      0 -rw-------    1 root     root           331 Mon Feb  6 03:25:35 2017 WebServer0-000002.vmdk

    348131716 78234624 -rw-------    1 root     root     80111620096 Fri Jul 14 02:47:18 2017 WebServer0-000003-delta.vmdk

    352326020      0 -rw-------    1 root     root           358 Fri Jul 14 02:43:52 2017 WebServer0-000003.vmdk

    390074756 103384064 -rw-------    1 root     root     105864646656 Sun Oct 22 22:43:28 2017 WebServer0-000004-delta.vmdk

    394269060      0 -rw-------    1 root     root           331 Fri Jul 14 02:47:22 2017 WebServer0-000004.vmdk

    406851972 106890240 -rw-------    1 root     root     109454970880 Thu Jul  5 01:38:30 2018 WebServer0-000005-delta.vmdk

    411046276      0 -rw-------    1 root     root           331 Mon Jun 18 09:01:35 2018 WebServer0-000005.vmdk

    469766532 119096320 -rw-------    1 root     root     121953996800 Mon Feb 25 23:58:39 2019 WebServer0-000006-delta.vmdk

    473960836      0 -rw-------    1 root     root           358 Mon Feb 25 23:26:00 2019 WebServer0-000006.vmdk

    92279172 16591872 -rw-------    1 root     root     214748364800 Mon Jan 30 22:45:05 2017 WebServer0-flat.vmdk

    96473476      0 -rw-------    1 root     root           527 Mon Jan 30 22:44:36 2017 WebServer0.vmdk

    578818436   1024 -rw-r--r--    1 root     root        186726 Mon Feb 25 22:55:54 2019 vmware-24.log

    595595652   1024 -rw-r--r--    1 root     root        219630 Mon Feb 25 23:58:39 2019 vmware-25.log

    612372868   1024 -rw-r--r--    1 root     root         84517 Tue Feb 26 02:54:15 2019 vmware-26.log

    629150084   1024 -rw-r--r--    1 root     root         85491 Tue Feb 26 03:07:33 2019 vmware-27.log

    645927300   1024 -rw-r--r--    1 root     root         85494 Tue Feb 26 03:07:39 2019 vmware-28.log

    662704516   1024 -rw-r--r--    1 root     root         85623 Tue Feb 26 21:17:06 2019 vmware-29.log

    679481732   1024 -rw-r--r--    1 root     root         84319 Tue Feb 26 22:39:17 2019 vmware.log



  • 15.  RE: Can you recover an accidentally deleted VMDK file?
    Best Answer

    Posted Mar 02, 2019 11:11 AM

    How much free disk space do you have on the other datastore (Datastore2)? What we need is ~200GB free disk space.

    If you have that amount of free disk space on Datastore2, then you may follow the below steps to clone the Webserver VM to Datastore2.

    1. create a new folder "Webserver" on the target Datastore2
    2. remove the VM from the ESXi host's inventory (DON'T use delete from diks)
    3. clone the Webserver VM's virtual disk from the source Datstore1 to the target Datsatore2 (this will consolidate all snapshots)
      vmkfstools -i "/vmfs/volumes/Datastore1/Webserver/WebServer0-000006.vmdk" "/vmfs/volumes/Datastore2/Webserver/WebServer.vmdk"
    4. copy the VM's .vmxf, and .nvram files from the old folder to the new one
    5. upload the attached configuration (.vmx) file to the new folder - I've modified this file to point to the new .vmdk file name
    6. right click the .vmx file in the new folder, and select "Add to Inventory"

    You should now be able to power on the VM. Note that you may be asked whether you copied, or moved the VM at first power on. In this case select "I moved it".

    Once everything works as expected you may procedd with deleting the "old" VM's folder on Datstore1.

    Remember that each single snapshot can grow up to the virtual disk's provisioned size (200GB in this case). Best practice is to avoid snapshots on production VMs, i.e. only use them if needed, e.g. before making critical updates to have a way back in case it's necessary.

    André

    PS: I assume you've already fixed the missing .vmdk descriptor file issue.



  • 16.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Mar 02, 2019 04:08 PM
    How much free disk space do you have on the other datastore (Datastore2)? What we need is ~200GB free disk space.

    I had copied a bunch of files from Datastore1 to Datastore2 previously using the Datastore Browser, but  I can delete all that to free up the space. Then I will have a full 500GB Datastore2.

    remove the VM from the ESXi host's inventory (DON'T use delete from diks)

    Do I just right click on the VM and choose something from the dropdown?

    clone the Webserver VM's virtual disk from the source Datstore1 to the target Datsatore2 (this will consolidate all snapshots)
    vmkfstools -i "/vmfs/volumes/Datastore1/Webserver/WebServer0-000006.vmdk" "/vmfs/volumes/Datastore2/Webserver/WebServer.vmdk"

    Am I doing this from SSH?

    copy the VM's .vmxf, and .nvram files from the old folder to the new one

    Do these copy over as part of the clone process you mentioned previously?

    upload the attached configuration (.vmx) file to the new folder - I've modified this file to point to the new .vmdk file name

    I can just do this using the Datastore Browser?

    right click the .vmx file in the new folder, and select "Add to Inventory"

    Again in Datastore Browser?

    PS: I assume you've already fixed the missing .vmdk descriptor file issue.

    continuum said he was going to rebuild it, but I haven't seen anything back yet (unless I missed a message in the chain somewhere), so I assume he's still working on it.

    Sorry for all the clarifying questions. If I sound like a complete idiot it's because I am [or I wouldn't have gotten myself into this position in the first place]. I am really new to virtualization and I'm still learning how to navigate ESXi and I certainly have no experience with SSH or any of that other stuff. So, this is a big learning experience for me. I appreciate everyone's help and patience.



  • 17.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Mar 02, 2019 06:15 PM

    It's better to ask now than to run into issues, so don't worry about this.

    I had copied a bunch of files from Datastore1 to Datastore2 previously using the Datastore Browser, but  I can delete all that to free up the space. Then I will have a full 500GB Datastore2.

    Not sure what exactly you've copied, but since we are going to clone the virtual disk, the source will always be available in case the clone doesn't work as expected. So you can free up the disk space on Datstore2.

    Do I just right click on the VM and choose something from the dropdown?

    Yes, right click and select Remove from Inventory.

    Am I doing this from SSH?

    Yes, it's a command line tool. Also remember that it will run for quite some time due to the file size, so please remain patient.

    Do these copy over as part of the clone process you mentioned previously?

    No, that's why I have this step on the ToDo list. The vmkfstools command will only take care of the virtual disk (.vmdk) files.

    I can just do this using the Datastore Browser?

    Yes.

    Again in Datastore Browser?

    Again, Yes.

    continuum said he was going to rebuild it, but I haven't seen anything back yet (unless I missed a message in the chain somewhere), so I assume he's still working on it

    I doubt it, because he already replied, mentioning the rebuit file that I've already attached the rebuit file to a previous reply.

    André



  • 18.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Mar 02, 2019 10:54 PM
    Yes, right click and select Remove from Inventory.

    I don't see an option like that. Could it be that I should choose "Unregister"?



  • 19.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Mar 03, 2019 08:55 AM

    You are absolutely awesome! It works!! I am actually in tears. You have no idea how much this means to me. What a fantastic community!!!



  • 20.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Mar 02, 2023 06:29 AM

    Hello, 
    I have been reading through this thread to try and find a solution, but I accidentally deleted my vmdk files for when the vms were initially setup, these were incremental snapshots i think, that is why i can not be able to use the currently vmdk files
    I would like to get in touch with someone to assist me since am using esxi 7 with basic support but i haven't received any feedback from support



  • 21.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Jun 10, 2019 07:55 PM

    Hi Andre (or should I address you as a.p.?) - I actually have done a very similar removal of a .vmdk file from the datastore like Troy and was following your thread conversation with Troy. 
    I started down this path, because after I built a GNS3 environment to simulate/practice on building networks, one of the
    appliances used all the disk space (or ran out of swap space), so I thought to delete some large files (older - thinking
    those files are no longer used) - that was a mistake :smileysad:
    So, I saw this thread in the vmware community and wanted to pursue.  I noticed that you have helped modified the WebServer0.vmdk file (in Troy's situation) ....
    this is where I got lost!  Would you be able help guide me in your thought process so I can create a new .vmdk file for this purpose, or is it
    different enough that the method may not work?  I'm willing to give it a try and open for suggestions.

    In Troy's VM (the Web you have made (or at least I think you have made):
    1. I noticed the following changes:
    CID FROM: "1065ec08" TO: "e056a0a1"
    parentCID FROM "ffffffff" TO "1065ec08"
    createType FROM: "vmfs" TO: "vmfsSparse"

    2. You added:
    parentFileNameHint "WebServer0.vmdk"

    3. Under Extent description:
    FROM: "RW 419430400 VMFS "WebServer0-flat.vmdk"
    TO:       "419430400 VMFSSPARSE "WebServer0-000001-delta.vmdk"

    4. Removed everything below the two comments:
    # The Disk Data Base
    #DDB

    How did you determine the new values?  Or rather, how would I determine the correct modifications based on my VM files (i.e. GNS3-2.1.15.vmx)?

    This is what I have:
    *********************
    A single DataStore [Identification = "datastore1 (2)"]  with 27GB free space.
    *********************


    ************* Begin ***********************
    output from the 'ls -elisa > filelist.txt:
    *******************************************
    total 125181968
    264241540      8 drwxr-xr-x    1 root     root          2380 Mon Jun 10 17:44:18 2019 .
          4   1024 drwxr-xr-t    1 root     root          1960 Fri Mar 29 20:06:30 2019 ..
    549454212 1213440 -rw-------    1 root     root     1241559040 Mon Jun 10 05:45:30 2019 GNS3-2.1.15-000001-delta.vmdk
    553648516      0 -rw-------    1 root     root           325 Mon Jun 10 05:45:09 2019 GNS3-2.1.15-000001.vmdk
    545259908   1024 -rw-------    1 root     root         27997 Wed Apr  3 01:45:37 2019 GNS3-2.1.15-Snapshot1.vmsn
    322961796   1024 -rw-------    1 root     root          8684 Mon Jun 10 05:45:30 2019 GNS3-2.1.15.nvram
    276824452      0 -rw-r--r--    1 root     root           615 Wed Apr  3 01:45:40 2019 GNS3-2.1.15.vmsd
    268435844      8 -rwxr-xr-x    1 root     root          2577 Mon Jun 10 17:23:17 2019 GNS3-2.1.15.vmx
    272630148      0 -rw-r--r--    1 root     root           266 Fri Mar 29 20:06:32 2019 GNS3-2.1.15.vmxf
    557842820 21562368 -rw-------    1 root     root     22079021056 Mon Jun 10 05:45:30 2019 GNS3-2.1.15_1-000001-delta.vmdk
    562037124      0 -rw-------    1 root     root           330 Mon Jun 10 05:45:20 2019 GNS3-2.1.15_1-000001.vmdk
    289407364 102400000 -rw-------    1 root     root     104857600000 Wed Apr  3 01:42:10 2019 GNS3-2.1.15_1-flat.vmdk
    293601668      0 -rw-------    1 root     root           508 Wed Apr  3 01:21:31 2019 GNS3-2.1.15_1.vmdk
    515899780      0 -rw-r--r--    1 root     root             0 Mon Jun 10 17:44:18 2019 filelist.txt
    478151044   1024 -rw-r--r--    1 root     root         42845 Mon Jun 10 05:55:16 2019 vmware-1.log
    494928260   1024 -rw-r--r--    1 root     root         53217 Mon Jun 10 07:57:34 2019 vmware-2.log
    511705476   1024 -rw-r--r--    1 root     root         52960 Mon Jun 10 17:23:18 2019 vmware.log
    ************* End **************************

    ************* Begin ***********************
    zip file of all the "small" files from my VM (GNS3-2.1.15) including filelist.txt
    *******************************************

    Given this information, would you have some spare cycles in your days to help me?  If you don't think it is possible, I understand and am willing
    to create this GNS3-VM environment from scratch - still a great learning experience.  Or if you beleive it is possible, but don't have the time,
    that is fine as well... I'll give it a go on my own and do a little more research.  Thanks for you time.  Ernie



  • 22.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Jun 10, 2019 08:56 PM

    I'm afraid that there's not much I can do in this case.

    The first disk's base files (GNS3-2.1.15.vmdk, and GNS3-2.1.15-flat.vmdk) which are required are missing.

    The VM's second virtual disk's files look ok, so it should be possible to use these files, and either extract/backup the files on it, or manually attach it to another VM (e.g. a newly created GNS3) if that helps.

    André



  • 23.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Jun 10, 2019 09:07 PM

    Hi Andre - Thanks for your quick response.  I just notice, when I ssh and "ls" the GNS3-VM, I see a lot more files.  Let me see if I can download and zip for you and see if these are the missing files?



  • 24.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Jun 10, 2019 09:09 PM

    /vmfs/volumes/555a3841-37b701d0-ab79-d48564510900/GNS3-2.1.15 # ls -lag

    total 125183000

    drwxr-xr-x    1 root          2520 Jun 10 19:33 .

    drwxr-xr-t    1 root          2100 Jun 10 20:54 ..

    -rw-------    1 root     1241559040 Jun 10 05:45 GNS3-2.1.15-000001-delta.vmdk

    -rw-------    1 root           325 Jun 10 05:45 GNS3-2.1.15-000001.vmdk

    -rw-------    1 root         27997 Apr  3 01:45 GNS3-2.1.15-Snapshot1.vmsn

    -rw-------    1 root          8684 Jun 10 05:45 GNS3-2.1.15.nvram

    -rw-r--r--    1 root           615 Apr  3 01:45 GNS3-2.1.15.vmsd

    -rwxr-xr-x    1 root          2577 Jun 10 19:33 GNS3-2.1.15.vmx

    -rw-r--r--    1 root           266 Mar 29 20:06 GNS3-2.1.15.vmxf

    -rw-------    1 root     22079021056 Jun 10 05:45 GNS3-2.1.15_1-000001-delta.vmdk

    -rw-------    1 root           330 Jun 10 05:45 GNS3-2.1.15_1-000001.vmdk

    -rw-------    1 root     104857600000 Apr  3 01:42 GNS3-2.1.15_1-flat.vmdk

    -rw-------    1 root           508 Apr  3 01:21 GNS3-2.1.15_1.vmdk

    -rw-r--r--    1 root          1793 Jun 10 17:44 filelist.txt

    -rw-r--r--    1 root         42845 Jun 10 05:55 vmware-1.log

    -rw-r--r--    1 root         53217 Jun 10 07:57 vmware-2.log

    -rw-r--r--    1 root         52960 Jun 10 17:23 vmware-3.log

    -rw-r--r--    1 root         52958 Jun 10 19:33 vmware.log

    /vmfs/volumes/555a3841-37b701d0-ab79-d48564510900/GNS3-2.1.15 #



  • 25.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Jun 10, 2019 09:50 PM

    Hi Andre -  I was able to download the rest of files, please see attached.  Let me know if this is doable.  Thanks Ernie



  • 26.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Feb 27, 2019 06:47 PM

    Hi Troy,

    No problems and sorry I should have provided the steps to get this file listing via a PuTTY session. Thanks SureshKumarMuthukrishnan for doing this.

    I see continuum has responded so I will revert to just watching this thread and let him work with you. You are in good hands with his advice and I recommend just following what he says. a.p. has replied as well so definitely in good company there.

    NOTE: not saying others cannot or will not offer good advice, just that it’s probably better to follow only one when dealing with potential data loss. Don’t want potential cross contamination of tasks :smileywink:

    Kind regards.



  • 27.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Feb 27, 2019 04:03 PM

    Also, please do not attempt to delete any other files, as per the error message it looks like you have deleted only the descriptor file i.e 0006.vmdk , we can recreate this file using the available delta file.

    Basically , each virtual disk will have two files

    1. Descriptor file

    2. Data file

    for a disk without snapshot , you will have the file in this naming convention (taken your server name as example)

    Webserver0.vmdk -- is the descriptor file of base disk

    Webserver0-flat.vmdk -- actual data file ( if we delete this then we cannot recover data if we do not have any proper back up or using proper recovery tool)

    In case if you have snapshot , you will find many disks in the following naming convention depends on the number of snapshots you have . in your case if appears that you have 6 snapshots

    Webserver0-000001.vmdk -- descriptor file, can be recovered using the delta disk.

    Webserver0-000001-delta.vmdk (data disk)

    In your case, fortunately you deleted only the descriptor file which can be recovered using the steps given in the following video and kb article

    How to recreate a missing Virtual Machine Disk Descriptor File (VMDK) - YouTube

    VMware Knowledge Base

    Waiting for the output from ESXi ssh session for further steps



  • 28.  RE: Can you recover an accidentally deleted VMDK file?

    Posted Feb 27, 2019 05:41 PM

    Please do not recommend that video again:
    How to recreate a missing Virtual Machine Disk Descriptor File (VMDK) - YouTube

    Following that bad advice can make matters worse - I have seen that way too often.

    @ Troy
    please connect to your ESXi via WinSCP and download all descriptor-vmdks of that VM.
    That are the small vmdks with -flat, -ctk, -delta or -sesparse on the name.
    Infortunately the Datastorebrowser will not display them correctly so you need to use WinSCP.
    Zip them together and attach them to your next reply.
    I will create the missing file for you.
    Ulli



  • 29.  RE: Can you recover an accidentally deleted VMDK file?