3 Replies Latest reply on Apr 7, 2015 10:49 AM by continuum

    Check VMDK for Corruption

    abillings45 Lurker

      Is there a way to check the integrity of a VMDK file?  The system is reporting numerous I/O errors, and cannot be VMotion'ed to a different LUN.  Other VMS on the same LUN appear to be working normally.

        • 1. Re: Check VMDK for Corruption
          wila Guru
          Community WarriorsUser Moderators

          Hello,

           

          Shut down the VM.

          Then from the vSphere host command line run the vmkfstools command.

           

          For details see here:

           

          Vmkfstools - VI-Toolkit

           

          --

          Wil

          | Author of Vimalin. The VMware Fusion Backup app for virtual machines |
          | More info at http://www.vimalin.com |
          | Twitter @wilva |
          | Wiki at http://www.vi-toolkit.com |
          | http://www.vimalin.com/why-is-time-machine-not-a-good-backup-for-virtual-machines/ |
          • 2. Re: Check VMDK for Corruption
            Sateesh_vCloud Hot Shot

            If I understand your comment - you have numerous I/O generated by Disk file

             

            Please check below things before you suspect Corruption:

             

            1)     Based on OS version - install tools to analyse the I/O from guest - like Perfmon of Windows

             

            2)     Identify Applications at OS - which can generate I/O

             

            3)    Once you are sure that nothing is wrong with OS - then check for Backup or AV solution problems

            • 3. Re: Check VMDK for Corruption
              continuum Guru
              Community WarriorsUser ModeratorsvExpert

              There are 2 types of I/O errors that you may see in log files while attempting standard operations: physical i/o errors and logical i/o errors.
              If I see this I usually first try to clone the vmdk with vmkfstools:

               

              vmkfstools  -i disk-with-i-o-errors.vmdk fixed-disk.vmdk

               

              If that works without vmkfstools-errors you can regard fixed-disk.vmdk as healthy.
              If that fails with I/O errors again make sure that  disk-with-i-o-errors.vmdk is used readonly by adding an empty snapshot-delta to it.

               

              vmkfstools  -i disk-with-i-o-errors-000001.vmdk fixed-disk.vmdk

               

              If that works without vmkfstools-errors you can regard fixed-disk.vmdk as healthy.
              If that again fails with I/O errors  you probably have VMFS heartbeat corruption on that volume.

               

              Try from esxi-shell or ssh

              dd if=disk-with-i-o-errors-flat.vmdk of=fixed-disk-flat.vmdk bs=1M
              If that works without errors you can regard fixed-disk-flat.vmdk as healthy.

               

              If that also fails it is time to switch to Linux for the following steps.

               

              Use a Linux VM and connect to an ESXi host that has access to the VMFS-volume.
              Connect to a second ESXi with a healthy datastore

               

              mkdir /esxi-in
              sshfs -o ro root@esxi-host:/ /esxi-in
              mkdir /esxi-out

              sshfs root@esxi-host:/ /esxi-out

              ddrescue /esxi-in/vmfs/volumes/datastore-damaged/vm-name/disk-with-i-o-errors-flat.vmdk /esxi-out/vmfs/volumes/healthy-datastore/recovery/fixed-disk-flat.vmdk  /esxi-out/vmfs/volumes/healthy-datastore/recovery/fixed-disk-flat.vmdk.log

              Make sure to create a log-file !
              If this works you can regard the fixed-disk-flat.vmdk as healthy - or better - as the best you can get in this circumstances.
              If this also fails you have a real problem and probably should call me or Ontrack for help.

               

              Read the link Wil gave you - easpecially make sure you read about vmkfstools -t 0

               

              Unfortunately ESXi itself has only diagnostic tools but can not help at all when you want to fix any serious errors.
              voma may give you some results but those results are not really helpful.

               

              DISCLAIMER: I just describe what I successfully do in such cases  - it may contradict with articles you find in the VMware KB or hear from VMware-support.

               

              Ulli