VMware Cloud Community
Massimo1980
Contributor
Contributor

Very strange problem with thin/thick VMDKs

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:

  • VM created with thin-provisioned disk -> working
  • VM physically moved between two datastores -> disk shows as thick but behaves as thin, yet VM works fine
  • VM physically copied between two datastores -> disk behaves the same, VM doesn't work anymore

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?

0 Kudos
1 Reply
thecakeisalie
Enthusiast
Enthusiast

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:

  • Do you get a specific error message when you try using the restored VMDK files? 
  • Were the VM's running on snapshots when you originally backed them up (i.e. did you take a quiesced snapshot with your backup software first?)
  • Can you post the filelist (ls -lth) from that directory, and cat the vmdkfilename.vmdk file and post that output here (don't cat the -flat file Smiley Happy)
  • What type of backup did you take (i.e. which software did you use, if any; how did you get the files copied back?)
  • Are both the *.vmdk and *-flat.vmdk files in the directory?
  • Did you SCP the files over, or just copy them from the datastore browser?
  • When you view the VMDK file in the datastore browser, which icon does it have beside the VMDK file?
0 Kudos