For a company it is vital to have a continuity plan that allows it to protect critical and operational business processes. This is how one of our clients started a consultancy process that will help avoid any interruption in the processes of their only service. The main objective is to anticipate any error about their service and have the support that allows them to continue their activity.
Some companies have a virtualized system for their operation. Virtualization is a technique that has become popular among companies, because this practice allows creating environments similar to physical ones where tests and validations are achieved without affecting an operating system or its hardware components.
There are several platforms for the administration of virtual environments, in the case of the company to which the consultancy was carried out, its virtualization tool is VirtualBox, which is recognized by the Linux community, easy to install and use.
In this case it is a machine with an Ubuntu operating system for which a hot replication was needed, that is, without downloading the virtual machine service.
The first thing that was required to be done for this project was to take a snapshot of the virtual machine. A snapshot captures the complete state of the virtual machine at the exact moment when the snapshot is made, including the state of the memory at that moment, the configuration of the virtual machine and the state of the virtual disk of that machine. In other words, a snapshot or snapshot allows you to keep all the configuration of the virtual machine including programs and applications.
Later with that snapshot, the virtual machine is cloned, this useful option of cloning the virtual machines facilitates our tests, and for this case it allowed us to carry out the process of snapshot> cloning> export, since we can not directly export the service so that the system is always on and to export the virtual machine it should be turned off.
After the virtual machine is exported, the export file must be passed to the backup machine. For that, the Rsync synchronization tool was used, which allows to synchronize a folder from the main server to the backup server. In SafeSociety we opted for this Rsync since it is a secure synchronization tool, which guarantees that the files pass without loss of packages.
It lists the synchronization of the folder with the files of the export to the backup server which are 3 files:
• A Service.ovf, which is the information of the machine
• Two more files corresponding to the hard disks of the service virtual machine
These must be imported into the VirtualBox virtualization tool of the backup server, that is, they were mounted in the VirtualBox. The whole process from the snapshot is done through scripts that are executed from the Linux cron.
With tasks scheduled at certain times, the first script to run is synchronizer. This makes the process of snapshot> clone> export> and executes the Rsync command and in the backup server it is executed at two and a half hours from the Linux cron also the import script.
Additionally, the project required a synchronization of the backups of the database to a NAS (Network Attached Storage), also known by the terms “storage connected to the network”. These backups are programmed at 8 o’clock at night to a specific folder, so another script was made to run at 11:00 pm using also the Rsync and synchronize the backups to the folder on the NAS of the company. On the other hand, that script is also executed from cron.
However, the contingencies and problems during the execution of the project are not lacking. Later that day, the hard disks of the main and backup server will be filled with the files that result from the snapshots, the clone, and the export. In that sense, to solve the problem what he did was another script but this time in Python, which does a debugging of these files.
In this process, it basically consists of taking and looking at the virtual machines that are there at the moment of adding a new virtual machine, and adding it to a list. From there, take the oldest virtual machine from the list and delete the files from the snapshots, the clone, and the files that result from the export. This is done on the main server and backup to keep the storage on the disk regulated.
Finally, to know the operation of the whole process, a current monitoring system was set up in Zabbix, where the CPU load, the CPU jumps, the use of RAM memory, the network traffic of input and output, the status of the hard disk in storage term and the status of the service and the SSH service.