Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In VMWare, when a snapshot is taken, my understanding is that it creates delta disks, and any writes that occur after the snapshot is created will be written to these new delta disk images, and not the primary vmdk image. This is part of the copy on write functionality which is common between vmware,KVM, and LVM snapshots. If you revert/go to a snapshot, the corresponding deltas are ignored, and if you delete a snapshot, they are deleted so either way you are left reading and writing only to the primary vmdk file again. There is also system setting information and system state information that is saved as well.

Is this accurate, and is it fundamentally the same for LVM and KVM snapshots?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

and if you delete a snapshot, they [the deltas] are deleted so either way you are left reading and writing only to the primary vmdk file again.

Deleting a snapshot without reverting to it will cause the delta file to be applied to the VMDK. Other than that, your explanation for VMWare seems spot on. I can't help with the other platforms, though.

That said, normal copy-on-write like you'd see on a storage array or with VSS in Windows is something that writes to the actual volume after saving the snapshotted state of the data. If the VMWare snapshot were copy-on-write, it would be modifying the VMDK after populating the delta file with the old version of whatever was being written.

share|improve this answer
    
Can anyone confirm which is correct? Does it simply write any new data to the delta files, or does it copy the blocks to be changed to the delta files and write the changes to the original vmdk (and then overlay the deltas to replace those blocks with their original contents after reverting to or applying a snapshot)? –  user160910 Jul 17 '13 at 19:36
1  
"Deleting a snapshot removes the snapshot from the Snapshot Manager. The snapshot files are consolidated and written to the parent snapshot disk and merge with the virtual machine base disk." source –  Basil Jul 17 '13 at 19:47
    
Thanks! If you are deleting a snapshot, dont you not want the data? –  user160910 Jul 17 '13 at 20:24
    
If you delete a snapshot, all the writes done since the snap need to be applied to the normal vmdk. If you want to revert to the snapshot, no writes are required. –  Basil Jul 18 '13 at 13:48
    
That suggests that the Snapshots contain any writes that occur after their creation, and it suggests that they don't contain a copy of the modified blocks from the original VMDK, right? –  user160910 Jul 18 '13 at 14:04

Is this accurate, and is it fundamentally the same for LVM and KVM snapshots?

Yes and yes.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.