7 Replies Latest reply on Mar 29, 2020 11:54 AM by a.p.

    Recover missing snapshot after moving from datastore

    cvazwm Lurker

      Hi everyone!

      It is my first post, I hope to do well.

       

      I am really confused and need some guidance, I had a VM in esxi 6.7.0 (8169922).

      with a single 900Gb virtual disk in a 940Gb Datastore.

       

      After performing the clean installation of the operating system I made a snapshot, and then with the necessary software within the operating system, I made another snapshot and then I forgot about them.

       

      As a result I got two snapshots (one of ~ 4Gb and the last one with ~ 36Gb) with all the information and I haven't been able to start the VM for a week.

       

      Oddly, snapshots were created outside of the VM folder.

       

      The first thing I try to do is delete the snapshots from the administrator in the web client, and then try to consolidate disks, the process does not throw any errors and ends, but I still see in the browser the vmdk of the snapshots outside the VM folder , just as they were previously to consolidate the disk.

      So I try to move the first snapshot to an nfs folder on a seagate NAS, this process is halted and a flat ... file of ~ 930Gb ....... appears in the Datastore.

       

      inside the snapshot that is still in the datastore, it refers to another obviously missing snapshot CID (see attached image)

       

      and now is when i think ..

      - how is it possible that a 940Gb datastore enters two 900Gb files + the last 36Gb snapshot? ...

      - is this flat file an incomplete file and should I recover the deleted snapshot?

       

      I will not comment on the other issues that come from ignorance.

       

      I hope someone can help me and I hope this problem is not so serious.

       

      Regards!! and thank you very much in advance.

        • 1. Re: Recover missing snapshot after moving from datastore
          a.p. Guru
          User ModeratorsvExpertCommunity Warriors

          For me it looks like the VM has originally been created in the MailServer folder with a 900GB thick provisioned virtual disk, then that virtual disk has been removed from the VM (without deleting it from the disk), and another virtual disk was created. This time a 930GB thin provisioned disk, and located in the datastore's root folder. If this is that case, the .vmdk file in the Mailserver folder isn't in use.

          Which files did you move to the NAS storage? is there one named "MailServer.vmdk" that has been moved from the datastore's root folder? If yes, see whether it contains an entry "CID=f122d733", and also "RW 1950351360 VMFS "MailServer-flat.vmdk". If this is that case, move that single .vmdk file backfrom the NAS server to the datastore's root folder.

          Although I'm pretty sure that the .vmdk file in the "MailServer" folder are obsolete in that case, I'd suggest that you backup them before deleting them to free up disk space.

           

          In doubt, please post the "MailServer.vmdk" file's (the one on the NAS) contents, as well as the entry from the .vmx file which contains the pointer to the current .vmdk file (likely the snapshot file).

           

          André

          1 person found this helpful
          • 2. Re: Recover missing snapshot after moving from datastore
            cvazwm Lurker

            You're right!!!!

             

            Sure enough, that is the file you reference and it was not a snapshot as I thought.

             

            I am backing up the folder and then returning it to its place, I hope it is complete.

            • 3. Re: Recover missing snapshot after moving from datastore
              cvazwm Lurker

              Thank you very much for the help you have given me so far, it would never have occurred to me.

               

              Now I have 904Gb available in the datastore,

              When trying to copy the disk back to its place it says this:

              The virtual disk is corrupted or does not have a supported format.

              and this one weighs 424.6Gb ...

               

              is there any way to recover this by having the flat file in the above place?

               

              In on NAS I have:

               

              -rw ------- 1 root root 424.6G Mar 26 22:02 MailServer-flat.vmdk      (corrupted)

              -rw ------- 1 root root 480 Mar 26 19:48 MailServer.vmdk

               

              and on the server I have:

               

              drwxr-xr-x 1 root root 76.0K Mar 28 00:17 MailServer

              -rw ------- 1   root root 36.0G Mar 26 19:41 MailServer-000001-sesparse.vmdk

              -rw ------- 1   root root 318 Mar 22 16:34 MailServer-000001.vmdk

              -rw ------- 1   root root 930.0G Feb 24 21:03 MailServer-flat.vmdk     (says 930Gb but datastore has available space)

               

              and inside the VM folder

               

              (Here we backed up and removed the 900Gb flat file and the old vmdk)

              -rw ------- 1  root root 8.5K Mar 22 16:54 MailServer.nvram

              -rw-r - r-- 1  root root 77 Mar 26 18:26 MailServer.vmsd

              -rwx ------ 1 root root 3.2K Mar 26 18:29 MailServer.vmx

              -rw ------- 1  root root 39.4K Mar 23 16:56 vmware-13.log

              -rw ------- 1  root root 39.4K Mar 23 17:22 vmware-14.log

              -rw ------- 1  root root 39.4K Mar 23 17:28 vmware-15.log

              -rw ------- 1  root root 39.4K Mar 26 18:29 vmware-16.log

              -rw ------- 1  root root 39.4K Mar 26 18:42 vmware-17.log

              -rw ------- 1  root root 39.4K Mar 26 19:11 vmware-18.log

              -rw ------- 1  root root 39.4K Mar 26 19:41 vmware.log

              -rw ------- 1  root root 110.0M Mar 2 03:21 vmx-MailServer-1113890851-2.vswp

              • 4. Re: Recover missing snapshot after moving from datastore
                cvazwm Lurker

                I have seen that knowing the size of the flat file, could be generated ...

                do you know if it is feasible?

                 

                with this command:

                vmkfstools -c (Size of the file) -d thin -a lsilogic newDisk.vmdk

                • 5. Re: Recover missing snapshot after moving from datastore
                  a.p. Guru
                  vExpertCommunity WarriorsUser Moderators

                  STOP!

                  The only file that you want to restore form the NAS is the small descriptor "MailServer.vmdk", i.e. not the corrupted flat file!

                  Since your attemt to move this file to the NAS halted, I assume that the current "MailServer-flat.vmdk" in the datastore's root folder has not been modified, and is still healthy.

                   

                  -rw ------- 1   root root 930.0G Feb 24 21:03 MailServer-flat.vmdk     (says 930Gb but datastore has available space)

                  Thin provisioning is comparable to sparse in Linux, where unused blocks are not allocated on the disk.

                  The size that's shown is the provisioned size, i.e. the maximum size that the file can grow to. The command ls -lisa will show you the used disk space (in kB) in the second column.


                  André

                   

                  PS: Do not try to copy/move .vmdk files from the GUI, but either use the native cp command from the command line, or e.g. WinSCP. The GUI will always try to copy both, the small descriptor .vmdk file, as well as the large data .vmdk file.

                  1 person found this helpful
                  • 6. Re: Recover missing snapshot after moving from datastore
                    cvazwm Lurker

                    It's already working !!! ... honestly all your answers were correct.

                     

                    I would like to send you a small gift from Argentina, as a thank you for the help and for my learning ... after the quarantine ends.

                    It has made it clear to me how the UI works with respect to physical storage.

                     

                    Thank you.

                    • 7. Re: Recover missing snapshot after moving from datastore
                      a.p. Guru
                      vExpertCommunity WarriorsUser Moderators

                      Thanks for the feedback. I'm glad that I was able to help.

                       

                      Don't forget to backup the VM, and - unless you need them - delete the VM's snapshot(s) from the Snapshot Manager. Please remember that snapshots are no replacement for backups.

                       

                      André