ehowton: (Default)
Steps to create a virtual machine disk descriptor file:

    Connect to the ESXi host as root through SSH or DCUI.
    Navigate to the directory that contains the virtual machine disk with the missing descriptor file using the command:

    cd /vmfs/volumes/DATASTORE_NAME/VM_NAME
     
    Identify the type of SCSI controller the virtual disk is using by examining the virtual machine configuration file (.vmx ). The controller is identified by the line scsi#.virtualDev , where # is the controller number.

    This example uses lsilogic :

    scsi0.present = "true"
    scsi0.sharedBus = "none"
    scsi1.present = "true"
    scsi1.sharedBus = "virtual"
    scsi1.virtualDev = "lsilogic"
     
    Identify and record the exact size of the -flat file using this command:

    ls -l vmdisk0-flat.vmdk

    -rw------- 1 root root 4294967296 Oct 11 12:30 vmdisk0-flat.vmdk
     
    Use the vmkfstools command to create a new temp virtual disk:

    # vmkfstools -c 4294967296 -d thin temp.vmdk

    The command uses these flags:
        -c size
        This is the size of the virtual disk.
        -d thin
        This creates the disk in thin-provisioned format.

The temp.vmdk and temp-flat.vmdk files are created as a result.

Note: To save disk space, we create the disk in thin-provisioned format using the type thin. The only consequence, however, is that the descriptor file contains an extra line that must be manually removed in a later step if the original disk is not Thin provisioned.

    Delete temp-flat.vmdk, as it is not needed. Run this command:

    rm -i temp-flat.vmdk
     
    Rename temp.vmdk to the name that is required to match the orphaned -flat file (or vmdisk0.vmdk , in this example):

    mv -i temp.vmdk vmdisk0.vmdk
     
    Edit the descriptor file using "vi" text editor ( vi vmdisk0.vmdk, in this example)
     
        Under the Extent Description section,
            Use command "Insert" to allow modifications on the descriptor file.
            Locate and change the name of the -flat file to match the orphaned -flat. Once completed - hit "Esc" to exit this mode.
        Find and remove the line ddb.thinProvisioned = "1" if the original .vmdk was not a thin disk. If it was, retain this line. Use command ":wq!" to save and exit "vi" editor.

        The virtual machine is now ready to power on. Verify your changes and ensure the Disk chain is consistent before starting the virtual machine.
         
    To check the disk chain for consistency, run this command against the disk descriptor file:

    vmkfstools -e filename.vmdk

    For a complete chain, you see output similar to:
    Disk chain is consistent.

    For a broken chain, you see a summary of the snapshot chain and then an output similar to:
    Disk chain is not consistent : The parent virtual disk has been modified since the child was created. The content ID of the parent virtual disk does not match the corresponding parent content ID in the child (18).

Original here: https://kb.vmware.com/s/article/1002511

THEN USE DETACHED CONSOLE and RESIZE TROUBLESOME DISK using the GUI if required!

Also just in case:
# esxcli storage vmfs extent list
# partedUtil fixGpt /vmfs/devices/disks/naa.NUMBER <-- datastore level only
# vmkfstools -x repair rando_disk.vmdk
◾ Tags:

June 2025

S M T W T F S
1 2 3 4 5 6 7
8 9 10 11 1213 14
15 16 17 18 19 2021
22232425262728
2930     

Most Popular Tags

Expand Cut Tags

No cut tags