VMware Cloud Community
budbeacham
Contributor
Contributor

Why two .vmdk files in a VM directory

I have the the task of automating the creation of test beds for our product testing.   This means creating up to 128 virtual machines per host, and then removing them when done.  Google research shows this to be relatively easy.  I just need to create a basic .vmx file, and the appropriate .vmdk file (Linux, Windows, etc.), and then copy/rename the .vmx to the new VM directory on the datastore.  Using vmkfstools I just clone the .vmdk to the new datastore location with its new name.

This will all be done via a Python program and a vMA on each ESXi host.

What could be simplier?  Well, nothing ever works like the documentation says.  The problem is the VM I want to use as my master VM to copy/clone has two .vmdk files.  One is a few hundred bytes, and the other is large, as expected.

551 May 23 16:11 linux_host2_vm13.vmdk

and

5368709120 May 23 16:11 linux_host2_vm13-flat.vmdk

What the heck!!!!

No where can I find any info on why there are two .vmdk files, or if both are needed.

Why are there two .vmdk files?

Do I need to clone both files?

Any help is appreciated.  Thank you.

Tags (2)
Reply
0 Kudos
5 Replies
weinstein5
Immortal
Immortal

The two represent the same disk and both are needed - the smaller of the two files contains meta data about the virtual disk - the larger file contains the actual data of the disk ans is named -flat.vmdk

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
Reply
0 Kudos
budbeacham
Contributor
Contributor

Okay.  Thank you.

So, I assume the procedure is clone both and give them the new VM name.

Reply
0 Kudos
weinstein5
Immortal
Immortal

That is correct -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
Reply
0 Kudos
a_p_
Leadership
Leadership

For vmkfstools you only need to specify the descriptor .vmdk file (the small text file). The command will automatically clone both, the descriptor as well as the data (flat) .vmdk file.

Sample: vmkfstools -i source.vmdk target.vmdk

André

Reply
0 Kudos
budbeacham
Contributor
Contributor

This is great info.  Thanks.

Reply
0 Kudos