In the previous chapter, we covered tests as a must-have prerequisite for automated deployment. Now, let's take a closer look at the other part: deployment and reproducibility of the production environment.
Modern virtualization technologies allow us to create cheap virtual machines; this is essentially an emulated computer running on a real computer, with an operating system, I/O, and everything else. From the viewpoint of a program that runs inside a VM, it is almost indistinguishable from the real computer, at least if the program does not touch low-level interfaces, which is highly unlikely if you do regular web development.
Since everything on a virtual machine is controlled by the host, memory, CPU, storage, everything, we can make snapshots of the virtual machine. Later, we can use those snapshots to transition the VM from one...