ESXi

 View Only
Expand all | Collapse all

Invalid virtual machine and corrupted vmx file

mahan

mahanJun 21, 2016 08:11 AM

  • 1.  Invalid virtual machine and corrupted vmx file

    Posted Jun 16, 2016 10:44 AM

    dear my friends

    my esxi 5.1 server is shut down suddenly becuase of power problem

    after it start again two of my virtual machine seems invalid

    i remove it from inventory and and then after i open data store to add vmx file to inventory

    this option is grayout and i cqn not add it

    i try to create my vmx file from log file but the new vnx file is empty and just 2 default line

    i need my snap snapshots

    what shoudl i do now ?!?

    thank alot



  • 2.  RE: Invalid virtual machine and corrupted vmx file

    Posted Jun 16, 2016 01:00 PM

    do you see *.lck files in VM folder on datastore? if yes, delete these lock files and then right click to VMX file and add to inventory.

    if invalid VM is still registered in inventory, you use PowerCLI to reload VM. if you have already removed invalid VMs from inventory then you need to try above option.



  • 3.  RE: Invalid virtual machine and corrupted vmx file

    Posted Jun 16, 2016 03:11 PM

    thanks for your reply

    i have two vm with problem

    one of them has *.lck

    i delete it and try to add vmx to inventory again but , the same result

    how can i reload vm from powercli? what is the result after the reload



  • 4.  RE: Invalid virtual machine and corrupted vmx file

    Posted Jun 16, 2016 01:18 PM

    As a first step please provide further information. Post a complete list of files in the VM's folder (with names, extensions, sizes, and time stamps), running e.g. ls -lisa from the command line, and provide the VM's .vmx, .vmsd as well as the vmware*.log files. Please compress/zip the mentioned files, and attach the resulting .zip file.

    André



  • 5.  RE: Invalid virtual machine and corrupted vmx file

    Posted Jun 16, 2016 03:16 PM

    /vmfs/volumes/56238ac1-0db9a116-4aa1-74d435b179ab/Hesabdari-Rafe-107 # ls -lisa

    ls: ./Hesabdari-Rafe-107.vmx~: No such file or directory

    ls: ./vmware.log: No such file or directory

    419455940      8 drwxr-xr-x    1 root     root          7700 Jun 16 14:58 .

          4   1024 drwxr-xr-t    1 root     root          2660 Jun 16 05:04 ..

    432038852 2130944 -rw-------    1 root     root     2181165056 May 17 18:10 Hesabdari-Rafe-107-000001-delta.vmdk

    465593284      0 -rw-------    1 root     root           340 May 17 19:37 Hesabdari-Rafe-107-000001.vmdk

    469787588 10437632 -rw-------    1 root     root     10687213568 May 17 18:33 Hesabdari-Rafe-107-000002-delta.vmdk

    473981892      0 -rw-------    1 root     root           347 May 17 19:37 Hesabdari-Rafe-107-000002.vmdk

    482370500 4031488 -rw-------    1 root     root     4127322112 May 17 18:43 Hesabdari-Rafe-107-000003-delta.vmdk

    486564804      0 -rw-------    1 root     root           347 May 17 19:37 Hesabdari-Rafe-107-000003.vmdk

    490759108 574464 -rw-------    1 root     root     587329536 May 17 18:45 Hesabdari-Rafe-107-000004-delta.vmdk

    494953412      0 -rw-------    1 root     root           347 May 17 19:37 Hesabdari-Rafe-107-000004.vmdk

    511730628 4686848 -rw-------    1 root     root     4798410752 May 17 18:57 Hesabdari-Rafe-107-000005-delta.vmdk

    532702148      0 -rw-------    1 root     root           347 May 17 19:37 Hesabdari-Rafe-107-000005.vmdk

    545285060 9651200 -rw-------    1 root     root     9881907200 May 17 19:18 Hesabdari-Rafe-107-000006-delta.vmdk

    549479364      0 -rw-------    1 root     root           347 May 17 19:37 Hesabdari-Rafe-107-000006.vmdk

    553673668 12289024 -rw-------    1 root     root     12583038976 Jun 15 15:23 Hesabdari-Rafe-107-000007-delta.vmdk

    557867972      0 -rw-------    1 root     root           347 Jun 15 14:49 Hesabdari-Rafe-107-000007.vmdk

    734028740 3106816 -rw-------    1 root     root     3180775453 May 17 20:22 Hesabdari-Rafe-107-Snapshot1.vmsn

    738223044 3106816 -rw-------    1 root     root     3180775453 May 17 20:22 Hesabdari-Rafe-107-Snapshot2.vmsn

    742417348 3107840 -rw-------    1 root     root     3181888325 May 17 20:22 Hesabdari-Rafe-107-Snapshot3.vmsn

    746611652 3107840 -rw-------    1 root     root     3181888325 May 17 20:22 Hesabdari-Rafe-107-Snapshot4.vmsn

    750805956 3107840 -rw-------    1 root     root     3181888325 May 17 20:22 Hesabdari-Rafe-107-Snapshot5.vmsn

    755000260 3107840 -rw-------    1 root     root     3181888325 May 17 20:22 Hesabdari-Rafe-107-Snapshot6.vmsn

    759194564 3107840 -rw-------    1 root     root     3181888325 May 17 20:22 Hesabdari-Rafe-107-Snapshot7.vmsn

    142631876 3092480 -rw-------    1 root     root     3166699520 Jun 15 14:47 Hesabdari-Rafe-107-f4572e5f.vswp

    423650244 19696640 -rw-------    1 root     root     64424509440 May 17 18:04 Hesabdari-Rafe-107-flat.vmdk

    687891396   1024 -rw-------    1 root     root          8684 Jun 15 15:24 Hesabdari-Rafe-107.nvram

    427844548      0 -rw-------    1 root     root           532 May 17 19:37 Hesabdari-Rafe-107.vmdk

    729834436      8 -rw-------    1 root     root          3203 May 17 20:22 Hesabdari-Rafe-107.vmsd

    792748996      8 -rwxr-xr-x    1 root     root          3614 Jun 15 18:15 Hesabdari-Rafe-107.vmx

    796943300      0 -rw-r--r--    1 root     root           273 Jun  9 05:28 Hesabdari-Rafe-107.vmxf

    583033796 148480 -rw-------    1 root     root     151121920 May 17 19:40 Hesabdari-Rafe-107_1-000001-delta.vmdk

    587228100      0 -rw-------    1 root     root           344 May 17 19:48 Hesabdari-Rafe-107_1-000001.vmdk

    591422404 115712 -rw-------    1 root     root     117567488 May 17 19:42 Hesabdari-Rafe-107_1-000002-delta.vmdk

    595616708      0 -rw-------    1 root     root           351 May 17 19:48 Hesabdari-Rafe-107_1-000002.vmdk

    620782532  17408 -rw-------    1 root     root      16904192 May 17 19:43 Hesabdari-Rafe-107_1-000003-delta.vmdk

    624976836      0 -rw-------    1 root     root           351 May 17 19:48 Hesabdari-Rafe-107_1-000003.vmdk

    629171140  17408 -rw-------    1 root     root      16904192 May 17 19:44 Hesabdari-Rafe-107_1-000004-delta.vmdk

    633365444      0 -rw-------    1 root     root           351 May 17 19:48 Hesabdari-Rafe-107_1-000004.vmdk

    637559748  17408 -rw-------    1 root     root      16904192 May 17 19:46 Hesabdari-Rafe-107_1-000005-delta.vmdk

    641754052      0 -rw-------    1 root     root           351 May 17 19:48 Hesabdari-Rafe-107_1-000005.vmdk

    645948356  33792 -rw-------    1 root     root      33681408 May 17 19:47 Hesabdari-Rafe-107_1-000006-delta.vmdk

    650142660      0 -rw-------    1 root     root           351 May 17 19:48 Hesabdari-Rafe-107_1-000006.vmdk

    662725572  66560 -rw-------    1 root     root      67235840 Jun 15 14:53 Hesabdari-Rafe-107_1-000007-delta.vmdk

    679502788      0 -rw-------    1 root     root           351 Jun 15 14:53 Hesabdari-Rafe-107_1-000007.vmdk

    562062276 320512 -rw-------    1 root     root     64424509440 May 17 19:39 Hesabdari-Rafe-107_1-flat.vmdk

    566256580      0 -rw-------    1 root     root           508 May 17 19:48 Hesabdari-Rafe-107_1.vmdk

    813720516  74752 -rw-r--r--    1 root     root      76380763 Jun  4 16:32 vmware-12.log

    834692036  31744 -rw-r--r--    1 root     root      32117689 Jun  8 04:49 vmware-13.log

    54551492   1024 -rw-r--r--    1 root     root        198646 Jun  8 06:31 vmware-14.log

    71328708   1024 -rw-r--r--    1 root     root        774764 Jun 12 00:04 vmware-15.log

    88105924   1024 -rw-r--r--    1 root     root        803665 Jun 15 14:10 vmware-16.log

    138437572   1024 -rw-r--r--    1 root     root        194895 Jun 15 15:24 vmware-17.log

    125854660 110592 -rw-------    1 root     root     113246208 Jun 15 14:47 vmx-Hesabdari-Rafe-107-4099354207-1.vswp



  • 6.  RE: Invalid virtual machine and corrupted vmx file

    Posted Jun 16, 2016 03:19 PM

    this is the second vm file list

    /vmfs/volumes/56238ac1-0db9a116-4aa1-74d435b179ab/CRM server 2012 # ls -lisa

    377512900      8 drwxr-xr-x    1 root     root          5600 Jun 16 15:00 .

          4   1024 drwxr-xr-t    1 root     root          2660 Jun 16 05:04 ..

    448816068 20415488 -rw-------    1 root     root     20904620032 Nov 14  2015 CRM server 2012-000001-delta.vmdk

    453010372      0 -rw-------    1 root     root           334 Nov 11  2015 CRM server 2012-000001.vmdk

    541090756 18809856 -rw-------    1 root     root     19260452864 Jun 15 18:11 CRM server 2012-000002-delta.vmdk

    570450884      0 -rw-------    1 root     root           341 Jun 15 14:58 CRM server 2012-000002.vmdk

    515924932 2655232 -rw-------    1 root     root     2718117888 Dec  3  2015 CRM server 2012-000003-delta.vmdk

    520119236      0 -rw-------    1 root     root           341 Nov 16  2015 CRM server 2012-000003.vmdk

    218129348      0 -rw-r--r--    1 root     root            27 Jun  6 08:51 CRM server 2012-88ec966a.hlog

    109077444 12582912 -rw-------    1 root     root     12884901888 Jun 15 14:12 CRM server 2012-88ec966a.vswp

    444621764 4203520 -rw-------    1 root     root     4303734519 Nov 11  2015 CRM server 2012-Snapshot1.vmsn

    478176196 4203520 -rw-------    1 root     root     4303689662 Nov 14  2015 CRM server 2012-Snapshot2.vmsn

    536896452 10494976 -rw-------    1 root     root     10746148993 Dec  3  2015 CRM server 2012-Snapshot3.vmsn

    394290116 8109056 -rw-------    1 root     root     107374182400 Jun 16 04:01 CRM server 2012-flat.vmdk

    499147716   1024 -rw-------    1 root     root          8684 Jun 15 15:05 CRM server 2012.nvram

    398484420      0 -rw-------    1 root     root           530 Jun 16 03:56 CRM server 2012.vmdk

    390095812      8 -rw-r--r--    1 root     root          1425 Dec  3  2015 CRM server 2012.vmsd

    411067332      8 -rw-------    1 root     root          3767 Jun 16 04:28 CRM server 2012.vmx-last

    503342020      0 -rw-------    1 root     root           270 Jun 16 06:02 CRM server 2012.vmxf

    146826180      8 -rwx------    1 root     root          3645 Jun 16 06:02 CRM server 2012.vmx~

    457204676 16663552 -rw-------    1 root     root     17062637568 Nov 14  2015 CRM server 2012_1-000001-delta.vmdk

    461398980      0 -rw-------    1 root     root           338 Jun 16 10:14 CRM server 2012_1-000001.vmdk

    574645188 79660032 -rw-------    1 root     root     81571033088 Jun 15 18:11 CRM server 2012_1-000002-delta.vmdk

    578839492      0 -rw-------    1 root     root           345 Jun 15 14:59 CRM server 2012_1-000002.vmdk

    524313540 12174336 -rw-------    1 root     root     12465680384 Dec  3  2015 CRM server 2012_1-000003-delta.vmdk

    528507844      0 -rw-------    1 root     root           345 Nov 16  2015 CRM server 2012_1-000003.vmdk

    436233156  99328 -rw-------    1 root     root     107374182400 Nov 11  2015 CRM server 2012_1-flat.vmdk

    440427460      0 -rw-------    1 root     root           506 Jun 16 10:14 CRM server 2012_1.vmdk

    37774276 90604544 -rw-------    1 root     root     92778418176 Nov 16  2015 server 2012-86_2-000001-delta.vmdk

    41968580      0 -rw-------    1 root     root           336 Nov 16  2015 server 2012-86_2-000001.vmdk

    12608452  77824 -rw-r--r--    1 root     root      78876570 Jun  8 04:52 vmware-19.log

    46162884   1024 -rw-r--r--    1 root     root        193497 Jun  8 06:25 vmware-20.log

    62940100 148480 -rw-r--r--    1 root     root     151717435 Jun 12 03:20 vmware-21.log

    79717316 133120 -rw-r--r--    1 root     root     135415600 Jun 15 14:10 vmware-22.log

    104883140   1024 -rw-r--r--    1 root     root        188519 Jun 15 14:13 vmware-23.log

    117466052   1024 -rw-r--r--    1 root     root        195136 Jun 15 15:13 vmware-24.log

    151020484   1024 -rw-r--r--    1 root     root         20079 Jun 15 18:13 vmware.log

    92300228  93184 -rw-------    1 root     root      95420416 Jun 15 14:12 vmx-CRM server 2012-2297206378-1.vswp

      25540  93184 -rw-------    1 root     root      95420416 Jun  6 08:51 vmx-CRM server 2012-2297206378-2.vswp

    205546436      0 -rwxrwxr-x    1 root     root           290 Jun 16 09:36 vmxrebuild.sh

    /vmfs/volumes/56238ac1-0db9a116-4aa1-74d435b179ab/CRM server 2012 #



  • 7.  RE: Invalid virtual machine and corrupted vmx file

    Posted Jun 16, 2016 03:33 PM

    these are files you ask me

    first file to download http://www.uploadman.com/5366907273ad7a03

    second file to download http://www.uploadman.com/e7faff0bf4d5236f

    thanks for your help



  • 8.  RE: Invalid virtual machine and corrupted vmx file

    Posted Jun 16, 2016 09:54 PM

    In the case of CRM server 2012, one of your original (flat.vmdk) disks is way back on November 11 and one is relatively current. Without the *.vmx, you will have to browse every disk descriptor (the small *.vmdk, anything that is NOT *delta.vmdk or *flat.vmdk) starting with the base disk (CRM server 2012.vmdk and CRM server 2012_1.vmdk) to figure out the chain of disks (AKA "Snapshots"). Inside the descriptor file, you will find a line for CID and a line for parent CID.


    On the base disk, the parent CID =ffffffff, and the CID=<8 digit hexadecimal number> like this:

    # Disk DescriptorFile

    version=1

    encoding="UTF-8"

    CID=d879faa1

    parentCID=ffffffff

    isNativeSnapshot="no"

    createType="vmfs"

    Now go find the disk where parentCID=<the same CID as the base disk>, like this:

    # Disk DescriptorFile

    version=1

    encoding="UTF-8"

    CID=60173605

    parentCID=d879faa1

    isNativeSnapshot="no"

    createType="vmfsSparse"

    DO this for each disk until you determine the last link in the chain, then use the vmkfstools command I indicated earlier (specifying the last link in the chain (it is not always the highest number!!!) to flatten out the disks and create a new VM.

    Good luck!



  • 9.  RE: Invalid virtual machine and corrupted vmx file

    Posted Jun 17, 2016 11:00 AM

    for CRm server i think i did wrong thing

    one time i created new virtual machine with existing vmdk

    i think it changed th CID

    these are current vmdk file

    # Disk DescriptorFile

    version=1

    encoding="UTF-8"

    CID=3fdaa5a7

    parentCID=101e16d7

    isNativeSnapshot="no"

    createType="vmfsSparse"

    parentFileNameHint="CRM server 2012.vmdk"

    # Extent description

    RW 209715200 VMFSSPARSE "CRM server 2012-000001-delta.vmdk"

    # The Disk Data Base

    #DDB

    ddb.longContentID = "a23a21aa14b7dd4b82df74323fdaa5a7"

    ------------------

    # Disk DescriptorFile

    version=1

    encoding="UTF-8"

    CID=3ae0a719

    parentCID=db66a30a

    isNativeSnapshot="no"

    createType="vmfsSparse"

    parentFileNameHint="server 2012-86_2.vmdk"

    # Extent description

    RW 419430400 VMFSSPARSE "server 2012-86_2-000001-delta.vmdk"

    # The Disk Data Base

    #DDB

    ddb.longContentID = "48083432d31371b016dae10e3ae0a719"

    --------------------

    # Disk DescriptorFile

    version=1

    encoding="UTF-8"

    CID=0668027d

    parentCID=3adfec36

    isNativeSnapshot="no"

    createType="vmfsSparse"

    parentFileNameHint="CRM server 2012_1.vmdk"

    # Extent description

    RW 209715200 VMFSSPARSE "CRM server 2012_1-000001-delta.vmdk"

    # The Disk Data Base

    #DDB

    ddb.longContentID = "82f1765c5dacf46da9173ae10668027d"

    ------------------------

    # Disk DescriptorFile

    version=1

    encoding="UTF-8"

    CID=9625c0ec

    parentCID=b281569a

    isNativeSnapshot="no"

    createType="vmfsSparse"

    parentFileNameHint="CRM server 2012-000003.vmdk"

    # Extent description

    RW 209715200 VMFSSPARSE "CRM server 2012-000002-delta.vmdk"

    # The Disk Data Base

    #DDB

    ddb.longContentID = "35e5b963590b7b5c9de197149625c0ec"

    ----------------

    # Disk DescriptorFile

    version=1

    encoding="UTF-8"

    CID=b281569a

    parentCID=3fdaa5a7

    isNativeSnapshot="no"

    createType="vmfsSparse"

    parentFileNameHint="CRM server 2012-000001.vmdk"

    # Extent description

    RW 209715200 VMFSSPARSE "CRM server 2012-000003-delta.vmdk"

    # The Disk Data Base

    #DDB

    ddb.longContentID = "73d930f21e5dd2ce3e8c78a1b281569a"

    -----------

    # Disk DescriptorFile

    version=1

    encoding="UTF-8"

    CID=34f4799d

    parentCID=b6547634

    isNativeSnapshot="no"

    createType="vmfsSparse"

    parentFileNameHint="CRM server 2012_1-000003.vmdk"

    # Extent description

    RW 209715200 VMFSSPARSE "CRM server 2012_1-000002-delta.vmdk"

    # The Disk Data Base

    #DDB

    ddb.longContentID = "37c92f6ef8c80e4f4373529234f4799d"

    --------------

    # Disk DescriptorFile

    version=1

    encoding="UTF-8"

    CID=b6547634

    parentCID=0668027d

    isNativeSnapshot="no"

    createType="vmfsSparse"

    parentFileNameHint="CRM server 2012_1-000001.vmdk"

    # Extent description

    RW 209715200 VMFSSPARSE "CRM server 2012_1-000003-delta.vmdk"

    # The Disk Data Base

    #DDB

    ddb.longContentID = "2c4f0e9ac6bff662d67efa5db6547634"

    ------------

    # Disk DescriptorFile

    version=1

    encoding="UTF-8"

    CID=3adfec36

    parentCID=ffffffff

    isNativeSnapshot="no"

    createType="vmfs"

    # Extent description

    RW 209715200 VMFS "CRM server 2012_1-flat.vmdk"

    # The Disk Data Base

    #DDB

    ddb.virtualHWVersion = "8"

    ddb.longContentID = "6df69ebbeeb3c862ab3451063adfec36"

    ddb.uuid = "60 00 C2 93 bc 15 27 18-99 97 3b b2 5a 52 cc d8"

    ddb.geometry.cylinders = "13054"

    ddb.geometry.heads = "255"

    ddb.geometry.sectors = "63"

    ddb.thinProvisioned = "1"

    ddb.adapterType = "lsilogic"

    --------------

    # Disk DescriptorFile

    version=1

    encoding="UTF-8"

    CID=b861985b

    parentCID=ffffffff

    isNativeSnapshot="no"

    createType="vmfs"

    # Extent description

    RW 209715200 VMFS "CRM server 2012-flat.vmdk"

    # The Disk Data Base

    #DDB

    ddb.virtualHWVersion = "8"

    ddb.longContentID = "84f32cb540d72395cbfce795b861985b"

    ddb.uuid = "60 00 C2 9d 35 a0 60 70-7f 41 30 0e da 7e 3c cf"

    ddb.geometry.cylinders = "13054"

    ddb.geometry.heads = "255"

    ddb.geometry.sectors = "63"

    ddb.thinProvisioned = "1"

    ddb.adapterType = "lsilogic"

    ddb.toolsVersion = "9216"



  • 10.  RE: Invalid virtual machine and corrupted vmx file

    Posted Jun 17, 2016 11:03 AM

    so it seems i have two parent file

    i found that crm server 2012_1.vmd last CID is 3adfec36 insted of current CID that is 3adfec3c

    what can i do now?



  • 11.  RE: Invalid virtual machine and corrupted vmx file

    Posted Jun 17, 2016 11:40 AM

    can i change CID manualy to my last one then the chain will be ok

    these files are too large and i dont have enough disk space to clone hdd



  • 12.  RE: Invalid virtual machine and corrupted vmx file

    Posted Jun 17, 2016 12:09 PM

    Whenever you are going to fix a broken snapshot chain, never modify the "CID", but only change the "parentCID" to match the parent virtual disk's CID.

    Anyway, keep in mind that if a virtual disk (file) was used by a VM, you may see more or less corruption in the guest's file system due to the changed blocks. What I'd recommend is to either clone the virtual disk using the vmkfstools command, or create another snapshot prior to powering on the VM after the modifications to be able to revert back to the current state if necessary. Also run chkdsk (in case of a Windows guest).

    André



  • 13.  RE: Invalid virtual machine and corrupted vmx file

    Posted Jun 16, 2016 09:39 PM

    In the case of Hesabdari-Rafe-107, your flat.vmdk is way back on may 17, where it looks like you have been running on Hesabdari-Rafe-107-000007.vmdk + Hesabdari-Rafe-107-000007_1.vmdk(descriptor) and Hesabdari-Rafe-107-000007-delta.vmdk + Hesabdari-Rafe-107_1-000007-delta.vmdk (disk) since then.

    Your best option, if you can't find the *.vmx file is probably to use the command vmkfstools to "clone" the snapshot-laden disk to a single file, which can then be managed by vSphere. You can then create a new Virtual Machine and add the single disk you made with vmkfstools.

    If (it is a big if, and you have to be sure) *000007.vmdk is the working disk part of a valid chain, the command to create a single disk would be (from inside the path):

    vmkfstools -i Hesabdari-Rafe-107-000007.vmdk Hesabdari-Rafe-107-new.vmdk

    vmkfstools -i Hesabdari-Rafe-107_1-000007.vmdk Hesabdari-Rafe-107_1-new.vmdk

    You can then build a new VM and attach the flattened disks and go back to work without the mess of snapshots!



  • 14.  RE: Invalid virtual machine and corrupted vmx file

    Posted Jun 21, 2016 08:11 AM

    problem solved

    thanks for your help