As the free version of ESXi lack the option to migrate to a new datastore or host, it will have to be done manually. That’s easy enough by logging in to the ESXi shell by ssh and simply copying the VM files. Naturally the VM has to be powered off for the copy to be in a consistent state.
It’s very important to not have a trailing slash on the first path or the files within the directory will be copied, not the directory itself.
cp -pr /vmfs/volumes/olddatastore/vm /vmfs/volumes/newdatastore
However, the virtual disks format for some reason are not kept. In my tests using thin provisioned all over originally, suddenly the disks were eager zeroed thick provisioned when copied to the new datastore. This will remedy that, by first renaming the disk and then inflating the disk as thin provisioned.
cd /vmfs/volumes/newdatastore/vm
vmkfstools -E disk.vmdk disk-thick.vmdk
vmkfstools -i disk-thick.vmdk -d thin disk.vmdk
rm *thick*.vmdk
Then edit the VM configuration, remove the disk and re-add it and note that it now is thin provisioned instead.
Recent Comments