Repairing broken disk chains of a virtual machine when CID Mismatch errors are reported
search cancel

Repairing broken disk chains of a virtual machine when CID Mismatch errors are reported

book

Article ID: 404894

calendar_today

Updated On:

Products

VMware Cloud Foundation

Issue/Introduction

This article addresses an issue where disk chains in a virtual machine (VM) become broken, causing the error message. A broken disk chain occurs when the ParentCID in a delta disk does not match the CID in its parent disk.

Environment

VCF 9.1 

Resolution

If a backup is available:

  • Proceed to restore the VM from the most recent backup.
  • After restoration, the broken VM can either:

    • Be removed from the ESXi host if no longer needed
    • Be repaired using the steps below and then optionally removed from vCenter.

If no backup is available:

    • Attempt a disk chain repair only if necessary.
    • Important: Before starting, back up all related virtual disk metadata files (.vmdk descriptors) using the cp (copy) command on ESXi. This allows rollback in case of failure.

When to attempt chain repair:

Chain repair should only be attempted under specific, controlled conditions. The currently supported scenario is:

  • Manually modified the virtual disk’s metadata files (e.g., editing .vmdk descriptors), and this may have unintentionally broken the disk chain — for example, by causing a mismatch between the CID and ParentID values.

    Do not attempt repair if it is suspected that data was written to the wrong disk (e.g., writing to the base disk while a snapshot was active), as this may lead to further corruption.

  • In all other cases or if uncertainty remains, contact Broadcom Support for further assistance.

Repair Methods

On ESXi:

    • Use the CLI tool to repair the chain and reload the VM:

 vmkfstools -x repairChain <disk.vmdk>

    • Alternatively, use the vSphere VMODL API via PowerCLI or curl

Using PowerCLI:

    • Connect to vCenter:

Connect-VIServer -Server <vc-ip or hostname> -User <user@domain> -Password <password>

    • If the disk is attached to a VM:

$vm = Get-VM <vm-name>
$vm.ExtensionData.RepairVmDiskChains_Task()

    • If the disk is a First Class Disk (FCD) not attached to any VM:

$vdisk = Get-VDisk <vdisk-name>
$objectId = New-Object VMware.Vim.ID
$objectId.Id = $vdisk.ExtensionData.Config.Id

$si = Get-View ServiceInstance
$vsom = Get-View $si.Content.vStorageObjectManager
$ds = Get-Datastore -Name <datastore-name>

$vsom.RepairVStorageObjectChain_Task($objectId, $ds.ExtensionData.MoRef)

Using curl to repair the disk chains attached to a VM

    • Login to vCenter and retrieve a session key:

curl -k -X POST -u 'administrator@<sso domain>:<VC-PASSWORD>' https://<VC-IP>/rest/com/vmware/cis/session

    • Use the session key in your repair request

curl -k -X POST -H 'vmware-api-session-id: <The session key retrieved by login command>' https://<VC-IP>/sdk/vim25/<release>/VirtualMachine/<vm-moid>/RepairVmDiskChains_Task 

On Workstation / Fusion:

Use the following command-line utility to attempt repair:

 vmware-vdiskmanager -F <disk.vmdk>

Post-repair Steps