Contacts

How to copy ESXI virtual machines with VIM. Comparison of solutions for Backup virtual machines from Veeam, Acronis and Symantec. VMware Recovery from BWEB Management Suite Interface

Consider and compare two ways of backup virtual machines VMware.

Initial data

Test stand It is two ESXI hypervisors on the Fujitsu Primergy BX2560 M2 server connected via SAN (two ports of 8 Gbit / S) and LAN (two ports of 10 GBIT / S). ESXI and VSCA 6.5 version. For ESXi discs are presented to the Fujitsu Eternus DX8700 S2 data storage system. As a backup storage system, we use the EMC Data Domain 6300 connected via SAN (four ports of 8 Gbit / s). To run backup, in order to save time, we use the ready-made Backup EXEC tool, the system control server is installed on the HP Proliant BL460C Gen8 physical server and also has a connection to SAN and LAN network in two ports.

For testing, three virtual machines were created: VM1 (146GB), VM2 (157GB) and VM3 (284GB). Testing procedure will look like this: Perform three times Full Backup. Each system, after that we calculate the average backup speed (GB / MIN) for each method.

The Backup Exec system has four ways to gain access to the virtual machine data, for the physical server it is SAN, LAN (NBD), NBDSSL and the fourth if the Backup Exec server is installed on the virtual machine, hotadd. We test the option when Backup Exec is installed on a separate physical server, compare the pros and cons of the san and lan backup.

The Backup Exec setting is quite simple and consists of the following steps:

  1. Select existing or create a new task for performing virtual machine backup.
  2. Open the properties of this task
  3. Go to the tab Virtual Machines\u003e VMware subsection
  4. Mark the connection method you need (it is permissible to activate all four ways at once and set their order use)


Method first: Backup virtual machines for SAN


In order for Backup Server to perform a Bacup of Virtual Machines to SAN, it must first be presented to the same LUN (s), which were presented with ESXI. In this case, Backup Server, using the VStorage API, requests information from VCenter, in which LUN is VMDK virtual Machines, makes a snapshot (snapshot) disc and takes it to SAN.

As a result, the experiment is average.

Method Second: Backup Virtual Machines for LAN (NBD)


In this mode, Backup Server requests the VCenter about what ESXI is a virtual machine, the machine is being needed, a snapshot is made and executes it on a local network with an ESXI server on Backup Server.

As a result of the second experiment, the average.

Conclusions, pros and cons

If you build up with a modern infrastructure using zero network hardware from throughput 10 Gbit / s, the use of backup in the data connection mode on a local network (NBD) is likely to be more efficient in cost and time. In the case when the network between ESXI and Backup Host is 1 Gbit / s, and the necessary equipment for connecting to SAN is already there, then the first method will be more efficient and fast.

The main plus of the san backup execution is that data transmission does not load local network And it is performed at a sufficiently high speed, but in the case of the 10 Gbit / s network, it is no longer such a clear advantage, because even with relatively large amounts of information, the backup window takes not a significant time.

The main advantage of the lan backup execution is the ability to use cheaper equipment as a storage system. And as the test showed, building modern network 10 Gbit / s equipment will provide a faster backup than 8 Gbit / S SAN.

Recovery to SAN virtual machinery with thick disks is performed quickly enough, but it is better to refuse from recovery with thin disks. It often ends with an error or failure.

From the general practice, we can say that to restore the virtual machine to always use the local network and do not rub the old virtual machine, but try to restore it to a new place.

Information used in the article is taken from official sources.

A small test:
Local network is gigabit.
To local storage (hardware RAID 10 of 4 disks 10K) - "Time DD if \u003d / dev / zero of \u003d / vmfs / volumes / data / vmfs / volumes / datastore / temp bs \u003d 1m count \u003d 1k" 8 seconds.
On "Linux" Storage (software RAID 0 of 3 disks 7,5K) - "Time DD if \u003d / dev / zero of \u003d / VMFS / VOLUMES / LINBACKUP / TEMP BS \u003d 1M COUNT \u003d 1K" 12 seconds.
On Windows Storage (Hardware RAID 5 of 10 10K 10K) - "Time DD if \u003d / dev / zero of \u003d / VMFS / VOLUMES / ZERO OF \u003d / VMFS / VOLUMES / WINBACKUP / TEMP BS \u003d 1M COUNT \u003d 1K" 1 minute 44 seconds (shocked) .

Results speak for themselves. Yes, on Win-repository RAID 5, but it is unlikely to be one to blame for this result.

With storage disassemble, now you need to automate backup. The best free tool is the GhettovCB script to use it, you need to access the ESXI host on SSH. As it turned out, there is a very simple way to enable and turn off access directly from Vshere Client: Configuration\u003e Software\u003e Security Profile\u003e Properties ...\u003e Remote Tech Support (SSH)\u003e Options ...\u003e Start or Stop. According to these screenshots I think it will be clearer:

Download last version script. You can go "Tru" way to do as written on the script page in the "Setup:" section, but I did it easier - unpacked the archive on my computer, instead of editing the configuration file - edited the script itself, copied it to the local storage (via Browse DataStore ").

Here are the main parameters:

VM_BACKUP_VOLUME - path to the backup folder, in my case / VMFS / Volumes / LinBackup
Disk_backup_format - disk format, Thin for backups is best suited
VM_BACKUP_ROTATION_COUNT - the number of stored backups (for each virtual machine), I have 2
Adapter_Format - adapter type, I have lsilogic

The remaining parameters can not be edited, but if it is interesting - on the script page, all parameters are described in detail, the truth in English, almost all parameters are painted in Russian.

So, the script is copied to the local storage, connect the SSH, to transfer the script somewhere closer to the root, for example, in /ghettovcb/ghettovcb.sh, if you do not need to back all the virtual machines - you need to create a file with a backbone virtual list:
CD / GhettovCB.
VI Vmlist.
Click "A" enter the names of virtuals, each on new string, Press "ESC" and save the changes ": WQ" or to exit without saving ": Q"

Rings must be "\\ n", when transferring "\\ R \\ n" the script will give an error, so you should not create a list in notepad, followed by copying to the repository, if you have never used NotePad + or EMEDitor and do not know what it is "\\ n" and "\\ r \\ n" - Better Create a list in VI.

We try to start the script:

./ghettovcb.sh -f ./vmlist -l ./log.txt

./ghettovcb.sh -f ./vmlist -g ./ghettovcb.conf -l ./log.txt
The script manages, giving a lot of information if you see at the end of the output "###### Final Status: all vms backed up ok! ######" means everything is fine, otherwise we read log.txt and deal with what they did not So.
Now you need to create a schedule for backups.
CD / VAR / SPOOL / CRON / Crontabs
CHMOD U + W ROOT
Vi Root.
Click "A", we write a schedule, only taking into account - the time is indicated in UTC, i.e. For Moscow, this is a local time minus three hours
00 20 * * * /ghettovcb/ghettovcb.sh -f / ghettovcb / vmlist -l / vmfs / volumes / linbackup / logs / `date +% f`.txt
or if you created a configuration file
00 20 * * * /ghettovcb/ghettovcb.sh -f / ghettovcb / vmlist -g /ghettovcb/ghettovcb.conf -l / vmfs / volumes / linbackup / logs / `date +% f`.txt
Click "ESC" and saved ": WQ"
in custody
chmod u-w root

Now daily at 20:00 on UTC (at 23:00 in Moscow) will be launched a script, the logs of its execution will be saved to the storage in the Logs folder, a separate log for every day.

By logs, my backup goes about 4 hours, I considered the speed - approximately 4GB per minute, i.e. Approximately 70MB per second, not very bad. The storage of 2.7TB is enough for storing two copies of each virtual, this is quite enough, plus there is a free space, and it is necessary, because First, the third backup is made and only after its creation is removed the oldest copy.
Well, another stone in the "Windows" storage facility - I tried to make backups with a script on it, Storage was simply fell off, well, the actual script completed with an error. I understand that the whole thing in invalid configuration NFS entries, but the settings were default and disappeared into the "tuning" did not really like it.

The experiment was successful, you can buy a server with good discs, RAID 10 is planned for 5TB, this should be enough for future virtuals with a margin.

Tags: vmware, vsphere, ESXI, Backup, backup

There is an excellent free script for backing up virtual machines on the VMware ESXI server, and it works on fREE version ESXI 4 and 5 versions without installing any additional priblud type VMA, etc. The problem is only that the instruction is not entirely accurate there, so I talked with this script for a long time, so that he still earned in automatic mode ...

I will not write in detail in detail as a connection to ESXI on SSH, I will not write down only the steps of the setup, with which everything worked with me.

First, you swing the script on the link above and fill on the server, you need to pour right in the archive! The easiest way to do it through the vsphere client. I have two disks on my server - on one cars work, and on the other there are all sorts of ISO images and backups themselves. Called discs, respectively, DataStore1 and Datastore2. All backups, script and configs lie in the Backup folder. Still note that the names of files and folders are case-dependent, so if the folder is called backup., and you write in the script Backup., I will not work!

  1. Pour the archive with a script here / VMFS / Volumes / DataStore2
  2. Further in SSH cD / VMFS / VOLUMES / DATASTORE2 - Go to the script directory
  3. Unpack the script from the archive tAR -ZXVF_File_Archiva name.tar.gz.
  4. Vsphere to rename the unpacked folder into something easier, for example, just backup.
  5. Now let's go to this folder - cD Backup.
  6. Create a folder for storing individual configs inside it. mkdir BackupConfig
  7. Now B. BackupConfig We throw the right individual configs for machines, if they do not need and all machines need to be backing with the same settings, you can leave it empty
  8. Fix vi editor variables in configuration file, the main thing is the path of the backup, i.e. The first line is changed to such: VM_BACKUP_VOLUME \u003d / VMFS / VOLUMES / DATASTORE2 / Backup, Well, then see what you still need - vI Ghettovcb.conf.
  9. Create script StartBackup.sh. (2 lines) - vI StartBackup.sh.
    2nd line where the challenge of the script itself can be removed upon itself
    CD / VMFS / VOLUMES / DATASTORE2 / Backup

    ./ghettovcb.sh -a -g ./ghettovcb.conf -c backupconfig -l ghettovcb.log
  10. Perform chmod + x ghettovcb.sh
  11. Perform chmod + x StartBackup.sh

1 stage completed! Now if you run StartBackup.sh.Bacup will begin. At the time of debugging, you can change the 2nd string on something like this ./ghettovcb.sh -a -g ./ghettovcb.conf -c backupconfig -l ghettovcb.log -d Dryrun - This will allow you to start the script and track the progress without copying the disks. To backups have been done more efficiently and quickly, I recommend setting the disk type in the settings. thin..

Configuring CRON (for automatic script run)

  1. Give permission to write to the file cHMOD + W.
  2. Add vi vi in / var / spool / cron / crontabs / root
    15 0 * / 3 * * /vmfs/volumes/DataStore2/Backup/startBackup.sh
    Run at 00:15 night every three days. I have a time zone +4 Moscow, i.e. In fact, the script starts at 4:15 in the morning, it will be seen by the date of change of the log via VSphere. Of course, time and frequency can choose others.
  3. Now you need to execute two commands to restart CRON
    kill $ (Cat /Var/run/crond.pid)
    crond.
  4. Add with VI 3 lines to the easiest file /etc/rc.local
    It is necessary, because after rebooting the server, the contents of the file from the 2nd point with the start of our script will be restored to the previous state, so in RC.Local, we specify that after rebooting you need to execute the following commands - Stop CRON, add a string for automatic launch Script and Running CRON.
    / BIN / KILL $ (Cat /Var/run/crond.pid)

    / bin / echo "15 0 * / 3 * * /vmfs/volumes/datastore2/backup/startbackup.sh" \u003e\u003e / var / spool / cron / crontabs / root
    crond.
  5. Now execute the command /sbin/auto-backup.sh.To make sure that all our changes have been preserved.

Small explanation - why you need to create a script StartBackup.sh.and not just take and its contents to put in / var / spool / cron / crontabs / root? There is some restriction on the size of this file and part of the strings in it simply will not work, although you can try to do and so, at first I worked, but then, apparently, some patches came out and stopped. Moreover, it is just more convenient - if you need to change the backup schedule, you just rule the file StartBackup.sh. and do not need dancing with a tambourine around Cron with his restart and making the same changes to /etc/rc.local.

PS: time goes, everything changes, the script itself changes, ESXI5 has already come out, so somewhere, something can not work already

Appendix: Cron Syntax

The CRON team looks like this:

1 2 3 4 5 /vmfs/volumes/DataStore2/Backup/startBackup.sh

Where,
1: Minutes (0-59)
2: Watch (0-23)
3: Days (0-31)
4: Months (0-12)
5: Day of the week (0-7)

A few examples:

  1. Running in 5 minutes first night, every day
    5 0 * * * /vmfs/volumes/DataStore2/Backup/startBackup.sh
  2. Run at 2:15 every first day of the month
    15 14 1 * * /vmfs/volumes/DataStore2/Backup/startBackup.sh
  3. Run at 22:00 every working day
    0 22 * \u200b\u200b* 1-5 /vmfs/volumes/Datastore2/Backup/startBackup.sh
  4. Running at 23 minutes after midnight and then every two hours (2:23, 4: 23 ... etc.), every third day
    23 0-23 / 2 * * * / 3 /vmfs/volumes/DataStore2/Backup/startBackup.sh

On the this moment There are several program manufacturers for storagesuch as paid and free. We decided that free programs Or uncomfortable in use (complex installation, constant threat of failure, lack of own interfaces), or there are no essential options backup. In this case, it is necessary to purchase paid programwhich, unlike free, will be fully workable with all the basic features of the backup. Below is a list of the best, according to experts, backed solutions:

    Veeam Backup & Replication 5

These programs are basic backup programs using most users:

    Data Recovery with Vcenter Server Support

As already written in the past, this is the surest way to create a backup machine if Vcenter Serve bought no desire or means to deal with this issue. Customizable this technology Pretty easy full guide You can find from the following link:

This solution works both with VCenterServer, and without it, but there will be no ability to set up a backup backup. We will look at all the main features just below when we compare all products.

    This product is now quite popular, since the type of licensing of this product (licensed by sockets) for servermen with low-power servers will be extremely profitable. Below we consider several configurations of the servers and consider the price characteristics. Also, this product supports the instantaneous data recovery option after a failure due to its VPower technology.

    Recently, recently produces a means for backup in virtual environments. In addition, Symantec is the only one of all the bacap solutions uses V2P technology (converting a virtual environment to physical servers). True, VCenter has such technology, but not within the framework of backup technology

    But on this capabilities, Acronis is not limited. Acronis included in the Acronis Backup & Recovery 10 AdvancedServer Virtualedition package, this is a consolidation of servers to transfer systems from physical on virtual platforms, moreover, with a built-in task scheduler. As a result, we have that this program Performs 2 basic functions:

    • Emergency Recovery Systems

      Server consolidation

    Main advantages Compared to other technologies:

      The ability to work, both with physical servers and in a virtual environment, which allows at the initial stages of the company's development to combine consolidation at high reliability estimates

      Wide range of supported storage devices backups (up to optical devices and magnetic tapes)

      Creating an Acronis Secure Zone partition on the same VM server, which allows you to restore the machine in a short time, and this section will be protected by deduplication mode on another server

      If the backup is one of our main goals, regardless of the price, we will undoubtedly choose between the decisions of the Veeam company, Acronisi Symantec. Both of these products are leaders of backup and storage, and also have a number of individual advantages.

      In the choice between these technologies, it is necessary to draw a line in several distinctions:

      1. Licensing type

        Characteristics

        Bacup volume and frequency

      For different type Licensing is worth deciding what the most suitable for us. If we have powerful servers with large quantity sockets under the processor, it is worth incurring in favor of Acronis Symantec. If we have a lot of weak servers with small quantity Sockets, the best option will be veeam.

      It is also necessary to understand what we need, that is, what requirements we will make to backup, the presence of those functions that are especially important to us.

      A very important factor, with what frequency and at what time we will make a backup. If we need to create backup machines for the entire infrastructure, and the frequency is unimportant, it is one (we put a backup scheduler at night). It's completely different if we have one priority machine, creating a backup for which we need from a period of a few minutes (it will already be necessary for a backup throughout the day).

      After determining for a particular case of all these parameters, it will be easy for us to decide for yourself which product suits us more.

Free Backup (backup) virtual machines based on VMware ESXI

For VMware Esxi. question virtual Machine Backup It is especially acute. Additional free software is inconvenient due to limited functional. Therefore, our backup. will be based on free scriptghettovcb. . This is the best option of existing scripts, although it has a funny name and the whole project as a whole - www.virtuallyghetto.com, author William Lam.. Its algorithm is to create a snapshirt and cloning VM.

To configure a full-fledged backup scheme, we will need:

  • Nfs.server for storing files;
  • connecting to Ssh. to ESXI;
  • script ghettovcb.sh. Added to the ESXI server (to the root or folder of the future backup). This is done through SFTP.any way convenient for you, for example, FileZilla;
  • we give the rights to perform a copied script;

Now stay in more detail at each of the items. To enhance the speed and fault tolerance of the file server / backup server, it is better to use RAID10. Preferred in this case are Linux OS (Debian, Ubuntu, "convenient to you") and file system XFS.because In such configuration, the recording speed (primary priority for fast backup) will be higher.

Already exist with us, but you can also do everything in vSphere Client.: Configuration\u003e Software\u003e Security Profile\u003e Properties ...\u003e Remote Tech Support\u003e Options ...\u003e Start or Stop.

Go to the script configuration ghettovcb.sh., the main parameters that we need:

VM_BACKUP_VOLUME - path to backup folder, in my case / VMFS / VOLUMES / DATASTORE1 / Backup
Disk_backup_format - disk format, Thin for backups is best suited
VM_BACKUP_ROTATION_COUNT - the number of stored backups (for each virtual machine), I have 3
Adapter_Format - adapter type, in my case - Lsilogic

The remaining parameters are responsible for copying files over the network and e-mail notifications. More configuration parameters are described on the developer website.!

If you need to copy not all virtual machines, then a file with a list of VM included in backup is created. Create such a file in VI:

  • go to the script folder - CD / GhettovCB or Backup
  • vI Vmlist.
  • click "A" enter the names VM (each name on the new line)
  • click "ESC" and save the changes - ": WQ" (without saving ": Q")

Run the script:

  • ./ghettovcb.sh -a -l ./log.txt - Start copying all machines, entry logfile in the same directory
  • ./ghettovcb.sh -f ./vmlist -l ./log.txt - Running the machines specified in the VMList file, logs are saved in the same directory
  • ./ghettovcb.sh -f ./vmlist -g ./ghettovcb.conf -l ./log.txt - analogously, only using .Conf file

A row with the inscription will signal the correct execution of the script: "###### Final Status: all vms backed up ok! ######. If this is not - check the logs, syntax of commands and ways to files.

To add a string to start on a schedule (in Cron), you need to edit the file "/etc/rc.local.d/local.sh", following:

  • go to the /etc/rc.local.d/local.sh catalog
  • cHMOD U + W Local.sh
  • open File Editor - VI Local.sh
  • enable Editing the "I" or "Insert" key
  • add before the EXIT0 string as follows:

/ BIN / KILL $ (Cat /Var/run/crond.pid)
/ bin / echo 0 20 * * * /vmfs/volumes/datastore/script/ghettovcb.sh -a -l /vmfs/volumes/backup/log/log.txt \u003e\u003e / var / spool / cron / crontabs / root
/ BIN / CROND

  • in this case, specify the schedule (time is indicated in UTC, i.e. for MSK -3 hour), i.e. "00 20 * * *"
  • press "ESC" and persist - "SHIFT +:" and "WQ"
  • at the end, I perform chmod u-w local.sh

Thus, at 23:00 MSC will be backup of virtual machine files. In our case, there will be 3 copies.

Setting backup For Esxi through ghettovcb.sh. Completed.



Did you like the article? Share it