Thursday 23 July 2015

Deploying multiple VMs fails with error "Error caused by file /vmfs/volumes/datastore_id/path_to/source.vmdk" on ESXi 5.5 u2

I've been puzzled over this issue for quite a long time.

Customer has some cloud solution on top of vSphere 5.5 u2 and deploying/cloning multiple VMs from template/VM fails with an error:

"Error caused by file /vmfs/volumes/datastore_id/path_to/source.vmdk".

This errors shown in vSphere client during "Apply Storage DRS recommendation".

I was able to replicate this behaviour with simple PowerCli script:

$vmquantity = 5
$template = Get-vm -Name "template_vm"
$dsclu = Get-DatastoreCluster -Name DS_clu1_foo
$clu = Get-Cluster -Name Clu1_foo
$vmlocation = Get-Folder -Name Folder_foo


1..$vmquantity |ForEach-Object {
$vmname = "testVM$_"
New-VM -ResourcePool $clu -Name $vmname -Datastore $dsclu -Location $vmlocation -VM $template -RunAsync 
}

Key here is "RunAsync" parameter, only then problem occur.

I did a lot of unnecessary steps, like disabling VAAI, changing datastore and storage controller queues, without success.

Simple solution resolved this issue: deleting ctk.vmdk file of source VM/template fixed the problem. Also, make sure that .vmx or .vmtx files doesn't have any reference to deleted files.

There is some VMware KB with this solution but it is not related to the error I was getting.VMware should update their KB's because solution was hard to find.

Update:

I noticed that backups also are affected by this (at least TSM backup can be), that is snapshots are not created and as a result backup fails. Deleting ctk file can help here also.

1 comment:

  1. Worked for me; saved me a lot of time and trouble. Thanks.

    ReplyDelete