Snapshots in virtual infrastructure.
Snapshots in virtual infrastructure.
What is it? How it works? Advantages and disadvantages.
In the comments to the previous article, a question was received from Alexey An about what snapshots are.
In this article I will try to disclose the meaning of this word, the principles of work, as well as the pros and cons of using snapshots in a virtual infrastructure.
Snapshot – technology for creating a snapshot of the state of a virtual machine.
What is meant by these words?
As was mentioned in previous articles, a virtual machine is a process with set of files, including a virtual disk file, RAM, as well as a file describing the set of devices used by the virtual machine.
The technology for creating snapshots implies instant freezing of the state of these files, i.e. when creating a snapshot, new, absolutely empty files of virtual disk space and RAM are created, where the write and read processes are redirected. The primary files goes into read-only mode.
Thus, all new changes are recorded only in the newly created files and, if necessary, all changes can be canceled literally in a matter of seconds (sometimes minutes).
The scope of snapshots is extremely wide:
- server administration, when updating critical operating systems, you can use snapshot to check if the update works correctly
- software development lifecycle where a test site can be reset to a “clean installation”
- backup, where incremental (intermediate) backups can be done as a series of snapshots (not recommended to use for a long time)
- it training labs where students can conduct laboratory work and return the training ground to its original state for the following students
Pros of snapshots:
The main advantage of snapshots is their speed.
Also, the ability to organize horizontal and vertical chains of snapshots can be very useful in the development when applying several options for changes.
And the main scenario for using snapshots was, is and will be laboratory training grounds for practicing the practical skills of students of specialized courses.
Cons of snapshots:
With all these advantages, snapshots are a big headache for the administrator of the virtual infrastructure:
- Snapshots tend to grow uncontrollably, and they grow in blocks, each time in the size of one block of the logical volume on which they are located.
- Uncontrolled growth of snapshots can lead to overflow of the logical volume.
- Snapshots are not limited to the allocated size of the virtual disk, so the chain of snapshots can easily exceed the allocated volume.
Earlier snapshots also imposed a restriction on the use of certain technologies, for example, for VMWare virtual machines with snapshots could not be transferred using VMotion technology.
Nowadays, in most cases, the situation has changed and this is no longer a problem. Thanks Askar Kopbayev for this information
Also, when using a large number of snapshots, the performance of the virtual operating system decreases, as well as the performance of storage systems, as the number of read operations increases in proportion to the number of snapshots.