Saturday, August 6, 2016

VM crashed during backup and now getting error when trying to power on : sparse disk

Today while taking backup of a Linux VM, it got crashed during backup however backup completed successfully. When tried to power on this VM, end up with this error,

An error was received from the ESX host while powering on VM Test-VM01
Cannot open the disk '/vmfs/volumes/5e4eb348-00341c9a-a87d-011d296158e2/Test-VM01/Test-VM01-000001.vmdk' or one of the snapshot disks it depends on.
The system cannot find the file specified
VMware ESX cannot find the virtual disk "/vmfs/volumes/5e4eb348-00341c9a-a87d-011d296158e2/Test-VM01/Test-VM01-000001.vmdk". Verify the path is valid and try again.

Here I was able to quickly get the VM back in working condition by just pointing the disk back to original disk file however now I noticed this VM is using a Sparse disk which is spirited into 2Gbsize files.

This kind are disks are disallowed on all ESXi 5.x and later hosts and ideally we wouldn't able to power on VMs with such disk (VMware kb#1022242) however here I was/am able to power on this VM, noticed any issue only after backup.

Here one thing is worth to point out, this VM was not created on Esxi 5.x host but was imported from Virtual Box to VMware environment.

To fix this issue, power off the VM and clone all the sparse disks to a compatible format with vmkfstools by running this command,

# vmkfstools -i /vmfs/vloumes/.../source/VM_Name.vmdk -d disk_format(thin/zeroedthick/eagerzeroedthick) /vmfs/vloumes/.../destination/VM_Name.vmdk

Once completed then from VM edit settings, remove the old sparse disk and add this thin/thick vmdk file and now you can power on the VM.

As above process required downtime so alternatively I tried storage vMotion and it worked for here the preferred fix is.. just Storage vMotion the affected VM to another Datastore, this will change the disk format on the fly and we are done.

Then just to check if we can restore the VM backup which was taken using Dell vRanger backup, when we tried to restore the backup it failed with the error: Error: API Call failed with message: The device or operation specified at index '9' is not supported for the existing virtual machine platform.

When checked about the error found a kb article on Dell support site, kb#10489719559960, according to this kb, we may take backup of a such kind of VM running on ESXi host but wouldn’t be able restore the same, and in order to fix this behavior we need to change the Sparse disk to thin/thick VMDK file. The process of converting the sparse disk is same a described above.

That's it... :)

No comments:

Post a Comment