VMware Cloud Community
jonb157
Enthusiast
Enthusiast

Creating a VM from a delta

Is this possible? Basically want to take a "snapshot file" and create a separate VM instance from it. If you powered off the VM, could you copy the delta file to a new location, rename it to a flat file, create a new VM and point it to that file? Or is that just crazy voodoo?

0 Kudos
5 Replies
jonb157
Enthusiast
Enthusiast

I guess I should explain why I want to do this. We have a production server that has a snapshot. They want a "test VM" to play with that has the exact same snapshots. However when you do a clone in VC, you lose the snapshots; or Ghost or Platespin for that matter. You end us losing the snapshot hierarchy that you had on the source VM.

0 Kudos
admin
Immortal
Immortal

No you can't just rename a -delta.vmdk to a -flat.vmdk, because the delta is a bitmap of the changes that have occured to the base -flat.vmdk on it's own it is meaningless.

To achieve what you want, power off the VM, use vmkfstools -i to make copies of the base VMDKs and all the delta's (always point at the .vmdk header files not the -flat.vmdk or -delta.vmdk when working with vmdk files). Then copy the .vmx and .vmsd files over, edit the .vmx file to reflect the new paths where you cloned the vmdk files too, likewise with the .vmsd, and change the name in the .vmx. Then register the VM with a host, power it on, and when asked create a new UUID. Voila, you have a clone with the snapshot tree intact, it's a manual process, but not too difficult.

0 Kudos
jonb157
Enthusiast
Enthusiast

You the man! I'll give this a try. thanks again. One other question, why doesn't VmWare let you do this through Virtual Center? It basically sounds like a clone, but clones don't support snapshots. So when I do the import with vmkfstools I just point at the "base .vmdk" and it will import everything including the deltas?

Message was edited by:

jonb157

0 Kudos
admin
Immortal
Immortal

So when I

do the import with vmkfstools I just point at the

"base .vmdk" and it will import everything including

the deltas?

No, you'll need to clone each vmdk manually, the base and all of the delta's.

0 Kudos
pgregg
Contributor
Contributor

Try using my vmclone.pl (perl script) - It takes care of all the manual work of renaming and cloning a VM - including the snapshot deltas. No guarantees (but it works for me):

http://www.pgregg.com/projects/vmclone/

0 Kudos