I don't think you completely understand how Linked Clones work, you will not be able to merge the individual LC's into the base image as each LC uses the base image as an OS references and all differentials of each VM is written to it's individual delta file. The commonality between all the LC's is the common base OS, if you try to merge you'll probably lock the rest of the LC's out from functioning.
You may want to go through some of the VMware View 3 documents that describe Linked Clones in greater detail to get a better understanding and here is a quick snippet when View 3 was released that gives you some high level information:
http://vmetc.com/2008/12/07/vmware-view-30-perspective-from-the-implementation-angle/
From my previous post you have 2 options, If you're looking to preserve user's data you'll need to create a second data disk that is attached to each VM
OR you use full clones and not Linked Clones, remember LC's aren't for everyone, depending on your use case. Non-persistent LC's are great in a lab environment and this is something that I've worked on with my colleague Tuan at UCSB ResNet:
http://communities.vmware.com/docs/DOC-9201
When creating Linked Clones, the base image must be
off this is the same exact requirement in VMware View 3, you will not be able to Link from a running VM as the disk is locked and you'll need to take a snapshot. One big question that comes up is how do you patch Linked Clones, currently if you have a master image of WinXP-SP2 and you have 20 LC's linking off that base image, if you want to go to WinXP-SP3, you'll need to update your master and redeploy the 20 LC's again as the changes to the base are different from when you created the LC's originally. In VMware View 3, you provide a master image, that master image is actually fully cloned into what they call a
replica, from this replica your LC's are then linked. This then allows you to keep sort of a master template in a sense because your image is not being linked, it's cloned and then linked.
Here is another page of diagrams that might have with the concept:
http://rodos.haywood.org/2008/12/storage-analysis-of-vmware-view.html
View 3 will automatically help with this process and there is a recompose operation that aids in this when you need to create a new pool based on a new base/parent image.
Hopefully this answered your question and I do suggest going over some of the documentation on how LC's work and that should give you a better idea on how you potentially might implement this in code using the VI API
=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at:
http://engineering.ucsb.edu/~duonglt/vmware/
vGhetto Script Repository
http://twitter.com/lamw
If you find this information useful, please award points for "correct" or "helpful".