For many years – oh as far back as ESX 2.x I’ve used the vmkfstools command to import/export .VMDK files as a crude form of backup/restore. This usage goes way back to the days when vCenter usage wasn’t mainstream and on the old ESX Admin I & II courses you used sysprep manually, before “exporting” the flat format into what was called back then the “COW” format (its now referred to more accurately as the 2gbsparse format). To day I had a problem with a long-standing VM that’s been in around my lab in some shape or form since those days. One of the nice things about vmkftools is it simplicity and the fact its been around for such a long time.
Sadly, I found the vmkfstools command returned an error. The error displays itself as an inability to locate the source file that I was trying to restore:
http://communities.vmware.com/message/2143115
It turns out that vmkfstools with -i and -d 2gbsparse does work but the module that allows this behaviour is not longer enabled. To enable it on an ESXi host directly you need to load the module with:
esxcli system module load -m multiextent
Once this module is loaded then the vmkfstools at the ESXi host functions as normal. Apparently, this change of functionality is in the release notes. So I googled that http://www.vmware.com/support/vsphere5/doc/vsphere-esx-vcenter-server-51-release-notes.html
to check out what the statement says:
Clone or migration operations that involve non-VMFS virtual disks on ESXi fail with an error
No matter whether you use the vmkfstools command or the client to perform a clone, copy, or migration operation on the virtual disks of hosted formats, the operation fails with the following error message: The system cannot find the file specified.
Workaround: To perform a clone, copy, or migration operation on the virtual disks of hosted formats, you need to load the VMkernel multiextent module into ESXi.
- Log in to ESXi Shell and load the multiextent module.
# vmkload_mod multiextent - Check if any of your virtual machine disks are of a hosted type. Hosted disks end with the -s00x.vmdk extension.
- Convert virtual disks in hosted format to one of the VMFS formats.
- Clone source hosted disk test1.vmdk to test2.vmdk.
# vmkfstools -i test1.vmdk test2.vmdk -d zeroedthick|eagerzereodthick|thin - Delete the hosted disk test1.vmdk after successful cloning.
# vmkfstools -U test1.vmdk - Rename the cloned vmfs type disk test2.vmdk to test1.vmdk.
# vmkfstools -E test2.vmdk test1.vmdk
- Clone source hosted disk test1.vmdk to test2.vmdk.
- Unload the multiextent module.
# vmkload_mod -u multiextent
So going forward…
I think its time for me to reconsider my usage of vmkfstools for this purposes, and opt for something more robust for achiving. Old habits diehard as they saying goes! 🙂