Comparison of solutions for backup of virtual machines from VMware, Veeam, Acronis and Symantec. Virtual machine backup VMware ESXi Vmware virtual machine backup

To organize an automatic backup system virtual machines, running on the VMWare ESXi server, we will use free utility MKSBackup, which you can download (at the time of writing, the latest available version is MKSBackup 1.0.4 dated January 24, 2013). This utility is a kind of front end that integrates with various scripts backup, including GhettoVCB(VM backup script written in perl and maintained by enthusiasts). GhettoVCB allows you to online mode create backup copies of running virtual machines. A VM backup is created by creating a snapshot of it.

Important. GhettoVCB does not work with virtual machines with their own photographs. To perform a backup of a virtual machine, all snapshots must be deleted (for example, through Snapshot Manager).

MKSBackup is one of the few backup tools that allows you to perform online backup of virtual machines. MKSBackup can be used to backup virtual machines running on both commercial editions of VMware ESXi and free VMware Hypervisor. The utility is developed in Python and is cross-platform. The MKSBackup utility does not have a graphical interface, works via the command line, and is configured through configuration files.

Naturally, the convenience and manageability of the solution for organizing backup of VMWare virtual machines based on MKSBackup is lower than that of commercial products, but is largely compensated by its free nature, ease of configuration and speed of deployment.

Installing the MKSBackup backup script

Configuring virtual machine backup settings

The next step is to configure the backup settings for virtual machines running on the ESXi server. Configuration is carried out by editing the mksbackup.ini configuration file (located in the C:\Magik folder by default).

Open the mksbackup.ini file in any text editor. The structure of the file consists of several sections, the name of each section is enclosed in square brackets.
Section:

In this section you can set notification parameters for e-mail. We are not interested in this, so we will leave it

Next section. This section represents the backup task and describes the various parameters that ensure that virtual machines are backed up in Windows environment. In our example, the task looks like this:

Program=ghettovcb host=10.10.1.89 port=22 login=root password=LI&f3ccc23 local=C:\magik\vmware global_conf=ghettoVCB.conf vm_list=vm1_https winXPtest destination=C:\magik\$(vm) scp_bin="D: \Install\Putty\pscp.exe" -scp -r

Let's take a closer look at the task parameters:

program– backup program, leave ghettovcb

host– name/ip of the ESXi host on which the virtual machines are running

port– port for access (default port 22 – SSH protocol)

login– username with access rights to the ESXi server (by default this is root, but for security purposes it is better to create a separate user on the ESXi server)

password– user password

local– local directory in which the backup script and its configuration are stored

global_conf– file with ghettoVCB script settings

vm_list– a list of virtual machines for which you need to create backup copy. If you need to back up all virtual machines, this parameter should be left empty. If you need to exclude some virtual machines, use the vm_exclude parameter.

destination– the parameter allows you to specify the type of operation to be performed. It could be

  • backup – perform a simple backup (no need to specify a destination)
  • copy – perform a backup and copy the resulting files to the specified directory
  • move - perform a backup and move the resulting files to the specified directory

Let's focus on the move option, as it is more optimal. In this case, local backups of virtual machines will be created on the ESXi host, which will then be transferred to the computer running the script.

mon-sun – it is assumed that the script can be executed daily (we will leave it this way, since we will set the frequency of running the backup through the Windows scheduler).

In addition, we will indicate the directory into which VM backups will be moved (C:\magik). The $(vm) parameter indicates that a separate directory with its name will be created for each virtual machine, where the virtual machine files will be stored.

Note. Detailed description The configuration settings of the script and its syntax are given on the developer’s website.

scp_bin– path to the scp utility

Important. Make sure the SSH daemon is enabled on the ESXi server.

VM_BACKUP_VOLUME=/vmfs/volumes/msa2000/backup VM_BACKUP_ROTATION_COUNT=3

VM_BACKUP_VOLUME– a directory on the ESXi server in which copies of virtual machines will be saved (naturally, there should be enough space on the VMFS partition free space)

VM_BACKUP_ROTATION_COUNT– the number of local copies to be stored (in our example, the last 3 backup copies will be stored)

All that remains is to use the plink utility (also included with Putty) to save the host key in the local ssh cache. For example, like this:

PLINK.EXE [email protected] ls /

Running a backup of virtual machines on a VMWare ESXi host

Let's test the backup script. To do this, open a command prompt with administrator rights and run the command:

C:\Magik\MKSBackup\mksbackup.exe -v -c C:\Magik\mksbackup.ini backup VMWARE_FROM_WINDOWS

Where is the key –v shows what needs to be displayed detailed information,-c path to the settings file mksbackup.ini, backup– means that you need to start a backup, at the end the name of the task from the file is indicated mksbackup.ini(in our example, the task is VMWARE_FROM_WINDOWS).

If everything is configured correctly, the utility will begin to display detailed information about the backup process to the console (the backup process is quite lengthy, so you shouldn’t expect it to finish quickly).

The backup process can be tracked by the appearance of snapshot creation/deletion events in the console VMware vSphere.

During script execution, folders containing virtual machine files will appear in the destination directory.

After execution test copy You can move on to automating the process of creating backup copies. To do this, let's create a new Windows scheduler task.

Let's create a task named “Backup ESXi”, which runs on Fridays and runs the command: C:\Magik\MKSBackup\mksbackup.exe -v -c C:\Magik\mksbackup.ini backup VMWARE_FROM_WINDOWS

In the task settings, do not forget to specify that it needs to be run with administrator rights (the “Run with highest privileges” option).

Note. If the task will be run on behalf of another account(not the one under which testing was performed), you must remember that the cache of the new account will not contain the required key. To solve the problem, you need to run the above plink command from a new account.

Disadvantages of this this method backup virtual machines:

  • enough low speed creating backups
  • a large amount of free space required to store VM backups

These disadvantages are compensated by its free nature, but for large solutions it is preferable to use commercial backup products, such as Veeam or HP DataProtector.

Good afternoon, dear readers, not so long ago, we discussed the process of cloning Hyper-V virtual machines, today we will analyze its main competitor, namely the ESXI hypervisor, in which we will also produce cloning a VMware virtual machine. The process itself is not complicated, but it can be difficult for beginners system administrators raise a number of questions that I will answer in this article.

Cloning principle

Cloning is the creation of an exact copy of a virtual machine, both with the same settings and with the necessary changes. It is very convenient, as for testing purposes, when you need to make the necessary changes, but you do not know how the virtual machine will behave; by making a copy of it, you will find out and be able to avoid downtime of services. What cloning methods exist:

  • Copying virtual machine files (in a switched off state), from the minuses, you need to re-create it in the inventory and slip the existing ones onto the disk.
  • Using VMware vCenter Converter Standalon e, this is an option when there is no vCenter Server. The principle there is simple, you install it in a virtual machine and make a clone of it, as if it were a physical machine, everything is described in detail in the link above.
  • Using virtual machine backup tools "Veeam Backup Replication"
  • Using vCenter Server.

Below I will describe the first method and the last; the rest already have their own detailed articles.

Copying VM Files

Find the required ESXI host, select the one you need disk array(Datastore) and right-click on it, select “Browse Datastore” from the context menu.

Choose the desired folder and from the context menu select “Copy”, then using the built-in explorer, move it to the desired location, you can call it cloning a VMware virtual machine, for the poor.

Next, in a new location, open the folder and right-click on the file with the *.vmtx extension, this is configuration file. Essentially that's all. Personally, to access file system ESXI uses WinSCP, or you can also use the OVA template functions.

If there are snapshots in the copied VM, they must either be deleted before copying or copied along with other files, otherwise when loading the new VM there will be an error with a message stating that it is impossible to load files with snapshots.

Copying a VM using vCenter

For those comrades who centrally manage their infrastructure, this function present during installation. Its advantage is that you can clone both a running and a non-running virtual machine. Select the one you need and right-click on it, in the context menu we see the “Clone” item.

On the first window of the wizard you will be asked to select a location (Datacenter)

We indicate the destination host, if it is suitable, you will see the message "Validation succeded"

If not, you will see messages:

  • Device CD/DVD drive 1 used backing is a fixable thing, they tell you to unmount the ISO in the virtual machine.
  • Network interface “adapter name” uses network “other name” - there is no such network on the destination host, it’s okay, you’ll plug it into another one after cloning.

In the next cloning step, you need a destination for the copy of the machine.

In the last step, you will be asked if you want to apply custom settings to the clone. Customize is additional customization, allowing you to set a huge number of settings. By selecting "Do not customize" you will complete the cloning wizard process.

If you want to understand in more detail the processes of setting up and ensuring comprehensive security of local and network infrastructure built on the Linux OS, I recommend that you get acquainted with OTUS. The course is not for beginners; you must pass it to enroll.

If you have not yet configured the free hyper-v hypervisor, I recommend that you read my material on this topic -. If you already have it configured and the question arises about how to backup it quickly, conveniently and for free, then I recommend using the free HV Backup utility.

HVBackup utility description for hyper-v

The main goal of the HVBackup project was to create a free, simple and effective solution for backing up hyper-v virtual machines running both in single mode and in a cluster.

The utility works on all versions operating system, beginning with Windows Server 2008 onwards, both in graphical mode and Server Core installations. The utility also supports the free edition of the Hyper-V Server hypervisor.

HVBackup supports app consistent and crash consistent hyper-v backups using VSS built into the system. There are many commercial solutions based on the same method of backing up virtual machines, but among the free ones I know of only this product.

Company codeplex, the manufacturer of the program, claims that it regularly uses HVBackup in its infrastructure, which guarantees high quality work and timely corrections or changes.

The program can be launched from command line , called from Powershell scripts, or be built into any .Net application via the appropriate library.

The operating principle of this utility is quite simple. The program creates a separate zip archive for each virtual machine, which includes all information related to it.

System requirements:
.Net Framework 3.5

Installing .Net Framework 3.5 on the command line

To install .Net Framework 3.5 you need to run the following commands in Powershell.

Windows Server or Hyper-V Server 2012:

Install-WindowsFeature NET-Framework-Core

Windows Server 2008 or 2008 R2 (not core):

Ocsetup NetFx3

Windows Server (core) or Hyper-V Server 2008 / 2008 R2:

Ocsetup NetFx3-ServerCore

HVBackup usage example

Perform a full VSS backup of all host virtual machines:

HVBackup -a -o d:\vm-backup

Perform a full VSS backup of the list of virtual machines (you must use quotes if the machine names contain spaces). The backup is performed on a remote server:

HVBackup -l "VM1,VM2" -o \\backup-server\wm-backup

Make a full backup of virtual machines, the list of which is contained in a text file (each VM on a separate line):

HVBackup -f list.txt -o d:\wm-backup

Script for automatic backup

If you want to schedule automatic execution backup, it is most convenient to make a simple bat file for these purposes and plan its execution. Let's create backup-all.cmd the following content:

Set BCKPATH="\\backup-server\wm-backup" rem net use %BCKPATH% /user: Pushd %BCKPATH% && forfiles.exe -m *.zip -d -7 -c "cmd /c del @path" popd HVBackup.exe -a -o %BCKPATH% 1> log_out.txt 2> log_err.txt

This script will delete all virtual machines before performing a backup zip files older than 7 days in the specified directory. You can edit the paths and parameters to suit your needs.

Now let’s create a scheduled task on the server to periodically perform backups using the script we created earlier:

Schtasks.exe /create /tn HVBackup /tr c:\backup-all.cmd /sc DAILY /ru /rp/st 01:00:00

If you need to delete a task:

Schtasks.exe /delete /tn HVBackup /f

Immediate execution of the task:

Schtasks.exe /run /tn HVBackup

HVBackup Command Line Options

Usage: HVBackup.exe

-b, --backup
Run backup (default).
-r, --restore
Perform recovery.
-f, --file
Text file, containing a list of virtual machines, one on each line.
-l, --list
List of virtual machines for backup.
-a, --all
Backup all virtual machines on the server.
-n, --name
If specified, only the listed virtual machines are backed up.
-g, guide
If specified, a backup of the listed virtual machines is made by GUID.
-o, --output
Required parameter. The final folder for archives. Can be in the form of a local or network path.
--outputformat
Virtual machine archive name format. (0) machine name, (1) machine GUID, and (2) current date and time. Default: "(0)_(2:yyyyMMddHHmmss).zip"
-s, --singlevss
Make one snapshot for all virtual machines.
--help
Display help for commands:

Conclusion

That's all. The only note is that I did not test the performance drop during backup. I didn't notice any slowdowns in the operation of the virtual machines. But they were all unloaded. The time it takes to perform a backup on each machine is significant. But, of course, it depends on many factors.

There is a good opportunity to combine HVBackup and . For example, make archives locally on a server with hyper-v, mount to linux server folder and using rsync to pick up zip files with virtual machines. Or immediately make a backup copy to Linux samba, for example. The link above has an example on this topic.

Online course Linux Security

If you want to understand in more detail the processes of setting up and ensuring the security of local and network infrastructure built on the Linux OS, I recommend that you get acquainted with online course " Linux Security» in OTUS. The training lasts 3 months, after which successful course graduates will be able to undergo interviews with partners. The course program is developed in the form of a series of practical workshops and is aimed at trained students who already have knowledge and experience in Linux administration. What you'll learn:
  • Apply the best global practices and information security standards (Debian, RedHat, MitRE);
  • Use tools to detect and exploit vulnerabilities in the Linux OS;
  • Install and configure network systems detecting and preventing attacks;
  • Work with monitoring and containerization systems based on Docker;
Test yourself on the entrance test and see the program for more details.

Handy Backup can use two methods to create VMware backups: internal and external.

Internal method

A copy of Handy Backup is installed on a VMware virtual machine running Windows or Linux. Operating Handy Backup on a virtual machine is no different in principle from using a similar solution on “physical” computers.

External method

Handy Backup runs on a virtual server VMware machines to copy images of specific VMware instances as regular files. Handy Backup uses a special plugin to back up VMware machines and arrays, running in “hot” mode (without stopping the VMware machine).

How to save a VMware virtual machine image

The VMware backup image is copied using a specialized tool. Using the VMware plugin settings, it is also possible to stop the copied VMware machine and then restart it for a “cold” copy.

  1. Open Handy Backup and create new task by pressing Ctrl+N or selecting a menu item. Select a backup task.
  2. In Step 2, select the plugin " VMware Workstation".

  1. Double click on the line “ New configuration” to select the VMware access configuration.
  2. In the dialog that opens, make a choice between the modes " Hot" (backup without stopping the machine) and " Enable suspend" (with stopping the virtual machine to obtain its exact image).

  1. Next, select in the dialog the specific machine image to which this configuration will be applied.

  1. Click OK and continue creating the task as usual.

The above sequence of steps will stop and then restart VMware virtual machines without any additional intervention.

Many users who start using virtualization tools from VMware sooner or later wonder how to create a copy of a virtual machine (clone it) in the free version of VMware ESXi. If you have a commercial edition of VMware vSphere and a vCenter management server, then you can clone a VM simply from the machine’s context menu:

However, things are a little more complicated if you have free version VMware ESXi Free (aka vSphere Hypervisor). Here's how you can go:

This tool allows you to create a virtual machine on the target host (namely our free ESXi), install the Converter itself inside the machine, and create a clone of it as physical system. Moreover, in the process of cloning (“migration”), both systems are preserved, and various settings, such as virtual disk sizes, system name, etc., can be customized.

2. Use software for backup and recovery.

Unfortunately, you won't be able to use the excellent Veeam Backup and Replication product for free ESXi, but there are some products that can do this. For example, Trilead VM Explorer and Unitrends.

First, we create a backup copy of the machine, and then restore it in parallel with an existing VM.

3. You can simply copy the virtual machine and its disk.

The first option of this method is simple - copy the folder from the VM (you can use WinSCP or FastSCP to access the ESXi file system). Next, add the VM to the ESXi environment with the *.vmx file via context menu and the item "Add to inventory":

The second option is to use the vmkfstools utility. It allows you to clone virtual machine disks by specifying various parameters of the target disk. For example, this command creates a clone of a virtual disk, but the target disk will be in a thin format (that is, growing as it is filled with data):

vmkfstools -i /vmfs/volumes/storage/server1/server1.vmdk /vmfs/volumes/storage/server1_clone/server1_clone.vmdk -d thin

You can do a lot of things using this utility; more details about it are written in KB 1028042. Next, we create a new VM and attach the resulting virtual disk to it. Don't forget to change the machine name and network identification!

There is also a way to clone a VM using (vMA) and vSphere CLI (vCLI) as written in KB 1027872, but it requires deploying vMA and is not worth the hassle of cloning a single VM. But for regular machine cloning, be sure to study this KB.

Please enable JavaScript to view the