Is it possible to copy a snapshot and associate it to another VM (which has same configuration)?

23,639

Solution 1

No, it's not feasible.

Direct your manager to Understanding virtual machine snapshots in VMware ESXi and ESX (1015180), which goes a little beneath the surface on the snapshotting process. The important things to note in there are:

  1. The disk chain - snapshots are delta disks (disks composed of the changes only), so "associating" a snapshot with a different VM would not result in valid data for the virtual disk, as there are undoubtedly differences at the block level between the two machines' disks.

  2. The VM snapshot database. Snapshot information is stored in a database file (vsdb), which is written and read through a VMWare API.

  3. The warning at the bottom:

    Caution: Manually manipulating the individual child disks or any of the snapshot configuration files may compromise the disk chain. VMware does not recommend manually modifying the disk chain as it may result in data loss.

Solution 2

No, because snapshots are block-level delta disks so this has no way of working. Think of a snapshot like a "transparency" that goes over the original disk. If the original changes, then the snapshot will make no sense and the machine will be in an inconsistent state.

This isn't a small topic, but essentially, when a snapshot is made - from that point onwards the original disk is "sealed" and changes are written to the snapshot.

For completeness, I know for a fact that you can do what you want, manually, by copying snapshot files and altering the meta-data, however

  1. It's unsupported
  2. It's so not recommended that it's not funny
  3. The VM probably won't work, and even if it boots, the chances of "finding" an issue further down the line is huge

Solution 3

Tell your manager that VM-level snapshots are permanently associated with their source virtual machine. When you take a VMware snapshot, all changes are applied to a new .VMDK file. Even if you say that the systems are identical in initial installation, there are still block-level differences between them.

This would never work.

Hopefully you documented the steps needed to install and configure the application. You may need to duplicate your effort and install again. One consideration is if you're using a licensed edition of VMware... If you have vCenter in place, you can clone the system running the software you've installed to a new virtual machine.

Share:
23,639

Related videos on Youtube

Samselvaprabu
Author by

Samselvaprabu

I am mainly working as a Build and integrator. I am maintaining ESXi servers and doing little bit of Configuration management activities (Base Clearcase and clearcase UCM) as every build and integrator.

Updated on September 18, 2022

Comments

  • Samselvaprabu
    Samselvaprabu over 1 year

    I am having two virtual machines with same OS and software list. (In fact they were cloned).

    Now I have installed an application in a VM and taken a snapshot.

    Is it possible to copy this snapshot and associate with the another VM?

    (So that i don't need to spend the effort again. I know i can clone but if i can just paste and associate the snapshot it would be better ) .

    If not possible , little explanation about why it is not possible would be more helpful. (I need to answer my manager)

    • Philip
      Philip about 11 years
      Why not take a snapshot and clone that?
    • Snellgrove
      Snellgrove about 11 years
      If you are happy with the snapshot, you can probably just commit it to disk and then clone the server. I've not tested or tried it, but you may even be able to clone the server while it has a snapshot (but I doubt it)
    • HopelessN00b
      HopelessN00b about 11 years
      @ChrisS unless things have changed dramatically since last week (or I'm misremebering), you can't clone a snapshot - you are forced to commit all snapshots to disk before doing a clone.
  • Snellgrove
    Snellgrove about 11 years
    You could clarify your post, by saying that the changes are block level, so the changes that go over the original disk are sub-file level, so will very likely break stuff.
  • FooBee
    FooBee about 7 years
    The question is about ESXi, not Workstation.