Submitted by ghomem on Mon, 04/15/2013 - 16:39
We are running Cloudmin Pro and would like to know if there is a way to perform snapshots on the existing VMs.
I found the "clone" option but it seems that it actually duplicates the machine, which means it doubles the taken space (which is already very large as Cloudmin enforces pre-allocation).
Snapshots are a feature of VMWare Server 2.0, for example, which enable save+rollback to a certain know good state. Seems that the qcow2 image format supports a similar feature (savevm) but I'm not sure of how robust that is.
Snapshots are an important feature of virtualization systems.
Can you comment on this?
Status:
Closed (fixed)
Comments
Submitted by ghomem on Mon, 04/15/2013 - 17:40 Comment #1
Snapshots could at least be "emulated" by using regular copies plus some kind of GUI controlled automation
The rollback would just copying the "snapshot" over the original VM.
Submitted by JamieCameron on Mon, 04/15/2013 - 19:04 Comment #2
This could be implemented using LVM snapshots, which can be done instantaneously and only store the diffs between the LV at the time the snapshot was written and the current state.
What features do VMware snapshots provide - is their size or lifetime limited in some way, or does each consume the same amount of disk space as the VM?
Submitted by ghomem on Mon, 04/15/2013 - 19:56 Comment #3
AFAIK the free VMWare versions provide only a single snapshot per VM, so you get:
When the snapshot is taken is consumes the amount of space the VM was consuming (it is a copy of the vm hard disk), and the "live" VM starts consuming zero, because its hard disk, once a snapshot is taken, stores only diffs between the current state and the snapshot. As the live VM grows in difference from the snapshot, its size may grow arbitrarily.
http://blogs.vmware.com/vipowershell/2010/09/snapshot-size.html
We don't know about LVM since we haven't used it so far.
Submitted by ghomem on Mon, 04/15/2013 - 20:08 Comment #4
Free VMware versions snapshots allow you to store one safe returning state, revert to that state and overwrite that state with the current state.
Other VMWare versions may allow for several snapshots.
Here is the explanation about sizes: http://blogs.vmware.com/vipowershell/2010/09/snapshot-size.html
We've never used LVM so I don't know how its snapshots work. Note that snapshots are per VM, not per filesystem.
Submitted by JamieCameron on Mon, 04/15/2013 - 22:43 Comment #5
That sounds like a nice feature - I will look into implementing it.
It will require that VMs be created using LVM though, as KVM doesn't have built-in disk snapshotting .. so we would have to rely on LVM's snapshot feature. We recommend using LVM to store VM disk images anyway, as it avoids the overhead of using disk image files on the host filesystem.
Submitted by ghomem on Tue, 04/16/2013 - 04:41 Comment #6
Sorry for the duplicated comments. The server was giving error 500 yesterday and apparently failed to accept comments.
Regqrding LVM, I don't see how it saves overhead! It is an extra layer on top of the server fs. Regarding the implementation, that would be great. If you need further comments let me know.
Submitted by ghomem on Tue, 04/16/2013 - 10:00 Comment #7
Nice discussion on LVM snapshots:
http://serverfault.com/questions/41020/is-this-how-lvm-snapshots-work
Snapshots seem to be only useful for VMs that don't store files, so the changes don't make them overgrow.
VMs shouldn't store files anyway... Snapshots are great to store configuration states that would be time take consuming to redo manually, in case of an accident.
Submitted by andreychek on Tue, 04/16/2013 - 07:40 Comment #8
No problem regarding the duplicate comments -- one of your comments had been incorrectly marked as spam, and that was causing additional posts to throw a 500 error.
I marked your one post as ham, and deleted the duplicates. Sorry for the hassle!
Submitted by JamieCameron on Tue, 04/16/2013 - 09:41 Comment #9
If we were to implement this VM snapshot feature, I would most likely do it using an LVM snapshot that is the same size as the VM disk - that way it will be guaranteed to have enough space to store all possible changes. Although that could be made optional for admins who want cheaper (but possibly shorter-lived) snapshots.
Submitted by JamieCameron on Sat, 05/04/2013 - 13:41 Comment #10
FYI, snapshotting has been implemented for Xen and KVM systems in Cloudmin, and will be included in the upcoming 7.1 release. It requires that the VM's disk be on LVM though, and that the host system's kernel supports snapshot merging.
Submitted by ghomem on Sun, 05/05/2013 - 17:04 Comment #11
That's very nice!
Is CentOS6 is fully supported for snapshots, ie, does it have the right kernel and LVM versions?
Submitted by JamieCameron on Sun, 05/05/2013 - 20:41 Comment #12
Yes, CentOS 6 has the kernel support needed by default.
Submitted by ghomem on Mon, 05/06/2013 - 02:09 Comment #13
Excellent. We will try this soon, in the next Cloudmin install.
Submitted by Issues on Tue, 05/21/2013 - 23:21 Comment #14
Automatically closed -- issue fixed for 2 weeks with no activity.