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:

  • Restore the VM from the most recent backup.

If no backup is available:

WARNING: Do not attempt a repair if you suspect data was written out of order or to the wrong disk (e.g., direct writes were made to the base disk while a snapshot was active). Attempting a repair under these conditions may cause irreversible data corruption.

  • Attempt a disk chain repair only as a last resort

Important Notes:

Back Up Metadata First: Before starting, create a copy of all virtual disk descriptor files (.vmdk) using the cp command on the ESXi host. This allows you to roll back changes if the repair fails.

Manually Verify Data: A disk chain repair only fixes metadata alignment. it does not recover or fix corrupted data inside the guest OS. You must manually inspect and verify data integrity after the repair completes.

Do Not Use in Production: A repaired disk chain should never be returned to an active production environment. Use it strictly as a temporary source to salvage and extract critical data to a clean location.

When to attempt chain repair:

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

    • You have 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 parentcid values.
    • 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: