So I’ve been trying to use the vmkfstools utility to generate an ESX compatible vmdk file, using commands like this:
vmkfstools -i /var/tmp/pt.vmdk /vmfs/volumes/storage1/ptvmware.dsk
…but then I get this error:
Destination disk format: VMFS thick
Cloning disk ‘/var/tmp/pt.vmdk’…
Failed to clone disk : There is not enough space on the file system for the selected operation. (13)
This had me stumped for ages, because the vmdk file I am trying to convert is only 500MB and I have 26GB free on my ESX server. I know that’s not really a lot for ESX, but this is only a test server, and there is plenty of space to hold the converted vmdk file.
Then I suddenly remembered, ESX pre-allocates all disk space when the VM is created, while VMware Workstation allows it to start small and it grows as space is needed.
So I asked the guy who created the vmdk image what size disk he configured it with – he configured it to use an 80GB SCSI disk, so when the vmkfstools utility tries to expand it I obviously run out of room!
So then I read about a tool called VMware Converter which you can get from VMware here:
This tool allows you to expand and shrink partitions inside a vmdk file so that you can make the overall vmdk file smaller. Ok, cool, I thought, so I can shrink one of the partitions to make it small enough to fit on my ESX server. Except it won’t do it! Damn. The option to resize the partition is greyed out and it won’t let me change it.
Speaking to the guy who created the VM, it seems it’s partitioned with xfs and reiserfs partitions and I have a feeling that the VMware Converter can only handle ext3 filesystems. I haven’t found any conclusive proof yet but that is my suspicion.
Unfortunately it’s going to be difficult to get the VM rebuilt as it’s an image of an appliance that contains an 80GB disk, so I’ll probably just have to find a bigger disk somewhere for my ESX server. Maybe we have one in a server I can nab! Roll on Monday!