VMware vSphere

 View Only
Expand all | Collapse all

'Error caused by file [File path].vmdk' When trying to clone, migrate, backup, copy

zmanho

zmanhoJun 18, 2019 06:33 AM

  • 1.  'Error caused by file [File path].vmdk' When trying to clone, migrate, backup, copy

    Posted May 14, 2018 10:52 AM

    Hi all,

    I wondered if anyone here could help me I am having real trouble trying to move a VM from one host to another. I've tried live migration, normal migration, cloning, Veeam backup & restore, downloading VMDK from the datastore, FTPing the VMDK from the datastore and each time these methods fail.

    When cloning, migrating or downloading in the vSphere web client i get the error 'error caused by file [Then the file path of the vmdk for that virtual machine]. Veeam fails with a permissions issue, FTP fails with 'error while reading'. I cannot seem to get around this issue and the VM is just stuck where it is. (And yes the VM works fine, boots fine etc)

    If anyone has any suggestions that would be great.



  • 2.  RE: 'Error caused by file [File path].vmdk' When trying to clone, migrate, backup, copy

    Posted May 15, 2018 07:32 AM

    Greetings,

    looks like the datastore where the VMDK file resides is corrupt, probably due to disk hardware errors. The Guest OS probably has not yet allocated any of the bad sectors, so it hasn't noticed the corruption until now.

    Try to copy the vmdk file from the ESXi console using dd with the switch conv=noerror (This should ignore read errors).

    You can also try to back up the disk from within the Guest OS (using Windows Backup if it runs Windows, a CloneZilla boot disk, or other disk imaging software that is able to ignore read errors).

    - Andreas



  • 3.  RE: 'Error caused by file [File path].vmdk' When trying to clone, migrate, backup, copy

    Posted May 15, 2018 01:02 PM

    Hi there,

    Thank you for the suggestion, I am unable to get the dd command to work properly, not sure if I am doing something wrong.

    Anyhow it looks like I may need to image it somehow as the machine is a legacy freebsd OS so there is no local backup options that I am aware of. I'll try your suggestion of Clonezilla and see how that goes

    James



  • 4.  RE: 'Error caused by file [File path].vmdk' When trying to clone, migrate, backup, copy

    Posted May 19, 2018 09:59 PM

    This is caused by datastore when filesystem is formated with block size not recognized by vmware,

    VMware Knowledge Base

    you can find the block size of your datastore by using fdisk

    There is switch to DD where you can specify the block size of source datastore.  use it to copy vmdk to a datastore recognized by vmware



  • 5.  RE: 'Error caused by file [File path].vmdk' When trying to clone, migrate, backup, copy

    Posted May 20, 2018 03:26 AM

    Hello

    This is the problem on your ESXI host where your VM is running on. To isolate issue, do vMotion to other host and retry one of those task on this machine.

    I got this issue few days back when I was enabling HA on VCSA, cloning of VCSA VM was failing with same error as you mentioned, logged a case with VMware results no help. This host also gave other smaller errors for normal operations such increasing/decreasing resources which made me doubt on ESXI host itself. I vmotioned 2 VMs to another host then was able to clone successfully.

    Try this if it works.



  • 6.  RE: 'Error caused by file [File path].vmdk' When trying to clone, migrate, backup, copy

    Posted May 20, 2018 04:49 PM

    Did the dd command fail with an I/O error ?
    In that case I would suggest to do the following:
    go to the directory with putty and run the command
    vmkfstools -p 0 name-flat.vmdk >> mapping.txt
    attach the mapping.txt to your next reply
    I will create a different dd-command  then.

    Ulli



  • 7.  RE: 'Error caused by file [File path].vmdk' When trying to clone, migrate, backup, copy

    Posted Sep 04, 2018 01:01 AM

    For me the dd says:

    vmware # dd conv=noerror if=/vmfs/volumes/datastore2/Data/Data-flat.vmdk  of=/vmfs/volumes/datastore4/Data/Data-flat.vmdk

    dd: can't open '/vmfs/volumes/datastore2/Data/Data-flat.vmdk': Invalid argument

    I verified that I could make a disk file of the same size as the source disk:

    /vmfs/volumes/5b8d8777-8bfbb68c-56a0-a4badbfb2eac/Data_Copy # vmkfstools -c 80530636800 xx.vmdk

    Create: 100% done.

    /vmfs/volumes/5b8d8777-8bfbb68c-56a0-a4badbfb2eac/Data_Copy # ls -l

    -rw-------    1 root     root          8684 Sep  4 01:47 Data.nvram

    -rw-------    1 root     root             0 Sep  4 01:48 Data.vmsd

    -rw-------    1 root     root          3297 Sep  3 22:46 Data.vmx

    -rw-------    1 root     root           259 Sep  4 01:48 Data.vmxf

    -rw-------    1 root     root     80530636800 Sep  4 02:03 xx-flat.vmdk

    -rw-------    1 root     root           464 Sep  4 02:03 xx.vmdk

    Source:

    Here is the source.  Note the error about the missing Data.vmdk.  Perhaps that is my problem somehow?

    /vmfs/volumes/52d85079-cc5e83dc-5f66-a4badbfb2eac/Data # ls -l

    ls: ./Data.vmdk: No such file or directory

    -rw-r--r--    1 root     root            27 Feb 12  2014 Data-9c51ad3b.hlog

    -rw-------    1 root     root     805306368000 Sep  3 00:07 Data-flat.vmdk

    -rw-------    1 root     root          8684 Sep  3 05:53 Data.nvram

    -rw-------    1 root     root             0 Jan 17  2014 Data.vmsd

    -rwx--x---    1 root     root          3297 Sep  4 01:39 Data.vmx

    -rw-------    1 root     root           259 Sep  3 05:51 Data.vmxf

    -rw-r--r--    1 root     root        162382 Sep 12  2017 vmware-12.log

    -rw-r--r--    1 root     root        475869 Oct  3  2017 vmware-13.log

    -rw-r--r--    1 root     root       8011602 Aug 31 10:10 vmware-14.log

    -rw-r--r--    1 root     root        166094 Sep  3 05:53 vmware-15.log

    -rw-r--r--    1 root     root         38959 Sep  3 05:53 vmware-16.log

    -rw-r--r--    1 root     root         38909 Sep  3 22:39 vmware-17.log

    -rw-r--r--    1 root     root         38911 Sep  4 01:40 vmware.log

    Dest:

    /vmfs/volumes/5b8d8777-8bfbb68c-56a0-a4badbfb2eac/Data # ls

    Data.vmsd  Data.vmx   Data.vmxf

    /vmfs/volumes/5b8d8777-8bfbb68c-56a0-a4badbfb2eac/Data # ls -l

    -rw-------    1 root     root             0 Sep  4 01:46 Data.vmsd

    -rw-------    1 root     root          3297 Sep  4 01:46 Data.vmx

    -rw-------    1 root     root           259 Sep  4 01:46 Data.vmxf



  • 8.  RE: 'Error caused by file [File path].vmdk' When trying to clone, migrate, backup, copy

    Posted Sep 04, 2018 02:32 AM

    Data.vmdk is missing.
    That will not have any influence on a dd command against Data-flat.vmdk
    When you cant dd the flat.vmdk you may have an I/O error in the flat.vmdk.
    Call me via skype - I can handle that if necessary ....
    Sorry for short answer. I am in a hurry ...
    Ulli



  • 9.  RE: 'Error caused by file [File path].vmdk' When trying to clone, migrate, backup, copy

    Posted Feb 09, 2020 02:15 PM

    I have the exact same error - made the mapping.txt file and would like to know how to build the custom DD command to get the data extracted.. are you still here to help ?

    The mapping.txt zipped is 800k or so - where can i share it with you ?

    Best regards

    Keld Norman



  • 10.  RE: 'Error caused by file [File path].vmdk' When trying to clone, migrate, backup, copy

    Posted Feb 10, 2020 09:33 PM

    Hi

    see attachment ...

    ### script to manually extract a flat file to a new location

    ### please set the IF parameter

    ### please check the OF parameter

    ### put script into a new directory for the VM

    ### make script executable and run it

    ### if you run the script via putty launch it as "nohup script &"

    IF="/dev/disks/naa.blabla"

    OF="onion_1-flat.vmdk"

    ### (268435456000 bytes in size)

    dd if=$IF of=$OF bs=1M conv=notrunc seek=$((  0 / 1048576 )) count=$((  1048576 / 1048576 ))  skip=$(( 245236760576 / 1048576 )) >> copy.log ###  245237809152)]

    exit

    ...

    I usually stop the script after the first MB.

    Copy the first MB to your Linux-admin host and run

    sgdisk -p onion_1-flat.vmdk

    That should display a reasonable partitiontable if you got the IF-parameter entered correctly.

    When that looks good remove the exit line.

    Here are 2 lines from somewhere in the original txt file:

    1695547392:     1048576] --> [VMFS -- LVID:5b1e3f9b-90303408-edc2-001fc69c00f3/5b1e3f9b-8dd148de-4cc8-001fc69c00f3/1:( 245248294912 -->  245249343488)]

    1696595968:    32505856] --> [NOMP -- :smileysad:          0 -->     32505856)]

    red values > seek parameter

    blue values > skip parameter

    green values > count parameter

    bold black parameters > if parameter - where you do not need to add that line  when if=/dev/zero (NOMP)

    The skip parameter is always  zero as it will not make a difference when if=/dev/zero

    Watch out if you use VMFS-volumes with extents !!!

    Do resist the tempation to combine 100 of 1 MB fragments into one 100Mb fragment.

    If one of those 1 MB fragments has an I/O error it will prevent the 100Mb to copy.

    If you consider to not convert the bytes values into full MBs the script will be dead slow.

    Dont consider to use larger blocksizes to speed up the extraction.

    larger bs-values will not speed up the process and and introduce several other new problems ... tried it and changed back to 1MB blocksizes.

    Ulli



  • 11.  RE: 'Error caused by file [File path].vmdk' When trying to clone, migrate, backup, copy

    Posted Feb 10, 2020 10:12 PM

    Forgot to mention ...

    after the script is done compare the size of the new flat.vmdk with the size listed in the descriptor.

    Sometimes the flat vmdk is one or more MBs too small.

    That is normal !

    In such a case I recommend to add the missing area with dd.



  • 12.  RE: 'Error caused by file [File path].vmdk' When trying to clone, migrate, backup, copy

    Posted Jun 21, 2021 07:55 AM

    Hi There,

    I have exactly this issue - but I need step-by-step help in following the resolution described.

    Please help.

    Thanks.



  • 13.  RE: 'Error caused by file [File path].vmdk' When trying to clone, migrate, backup, copy

    Posted Jun 18, 2019 06:33 AM

    May i know how to fix this issue?



  • 14.  RE: 'Error caused by file [File path].vmdk' When trying to clone, migrate, backup, copy

    Posted Apr 16, 2022 02:15 PM

    Migrate both compute resources and storage (not just storage). Do not change the source type of the disk (such as thick to thin). That worked for me when I got this error.