I have some ESXi (4.1) virtual machines which were initially created using thin-provisioned disks, but where then physically moved to different datastores (all of them iSCSI); since these are stand-alone hosts, there is no vCenter Server available to manage them, so the operation was done from the ESXi command line using the mv command.
Now the VMs exhibit a rather interesting behaviour: the disk format in the VM settings is shown as "thick", the VMDK files do not have the ddb.thinProvisioned = "1" line, but the actual file size is much less than the virtual disk size. When examined via the Datastore Browser, it shows two different columns for "Size" and "Provisioned Size", just as it would do with a thin-provisioned disk.
Howewer, this doesn't seem to be a problem, as the machines are working fine.
Then, another copy of them was taken for backup purpose; this copy was also made from the command line, using the cp command, between two datastores on the same host (again, both of them iSCSI).
Then we lost the original VMs, and were in need of the backed-up ones.
And these don't work anymore, complaining about corruption of the VMDK files.
So, to recap:
I tried manually editing the VMDK file to add the ddb.thinProvisioned = "1" line, but this didn't fix the problem. I tried inflating the virtual disk, cloning it and converting it: nothing works, every command complains about the disk being corrupted.
I'm in quite a struggle to bring these VMs up again; can someone please help?
There seem to be two distinct problems here, and I don't think they're related -
First one is the size on disk vs the type of VMDK file - "thick" just means that the space that could be consumed for the VMDK will be reserved on disk for that VMDK, it doesn't necessarily mean that it's already been written. For instance, you could have a 10GB VMDK file that is "thick", but only 4GB of it actually using the space on disk. If you "eagerzerothick" the same VMDK file, then it will consume the full 10GB because it will write zeroes to the rest of the VMDK file. Thin provisioned means that if it's only taking up 4GB on the disk, then it will only reserve 4GB on the disk, and you can put more VMDK's on that datastore than you have physical space (giving you both the ability to over-provision as well as potentially run out of physical space in the datastore). More info can be found on disk types here: http://www.vmware.com/pdf/vsphere4/r41/vsp_41_esx_server_config.pdf - go to page 245 to read about Virtual Disk Options (or if you're going to be running 5.0 they will have an updated doc with the new disk options).
The corruption problem is likely unrelated - here are some questions that will help get you the right answer to fix this issue: