4 4 3 Tigon:KVM QEMU Backup

From SEPsesam
(Redirected from KVM QEMU Backup)
Jump to: navigation, search
Draft.png WORK IN PROGRESS
This page is a draft. Treat the information on this page with caution as it may be incomplete.

Copyright © SEP AG 1999-2017. All rights reserved.

Any form of reproduction of the contents or parts of this manual is allowed only with the express written permission from SEP AG. When compiling and designing user documentation SEP AG uses great diligence and attempts to deliver accurate and correct information. However, SEP AG cannot issue a guarantee for the contents of this manual.

Docs latest icon.png Welcome to the latest SEP sesam documentation version 4.4.3 Tigon. For previous documentation version(s), check documentation archive.


Overview

SEP sesam provides efficient data protection for libvirt-based KVM virtualizationby integrating into the libvirt layer of the virtualization system. Introduced in SEP sesam 4.4.3 Tigon, KVM/QEMU integration allows you to back up KVM/QEMU virtual machines on single host systems. Supported backup types are FULL and COPY.

Example configurations are single virtualization hosts running Debian, CentOS or SLES-based distributions in single instance setups that are used to virtualize systems using QEMU and libvirt. Note that high-level applications, such as OVIRT, and other cloud-based solutions, such as OpenNebula or Cloudstack are not supported.

SEP sesam KVM/QEMU integration advantages

  • Online backup of running virtual machines using snapshot technology.
  • Online backup of virtual machine configuration.
  • Restore of complete virtual machines and configuration.
  • Restore of virtual machine configuration.
  • Restore into new virtual machine instances.

Prerequisites

To ensure error-free operation of SEP sesam and improve performance, make sure that the following conditions are met:

  • Check the support matrix for the list of supported KVM/QEMU versions.
  • Make sure that you have configured KVM/QEMU with SEP sesam properly as described in the next step.

Configuring SEP sesam Client on KVM/QEMU host

In order to be able to backup the virtual machines from your KVM/QEMU hypervisor, download and install the SEP sesam Client for your distribution in use. As of SEP sesam 4.4.3 Tigon, SEP sesam client already contains all needed components for backing up the KVM/QEMU virtual machines.

The KVM/QEMU host system has to be configured as regular client in the SEP sesam Server and backup of regular files from the KVM/QEMU hypervisor must be functional.

Configuring KVM/QEMU backup task

Configuring a KVM/QEMU backup on a SEP sesam Server involves creating a KVM/QEMU backup task, setting up a backup schedule (specifying when you want to back up your data) and linking the schedule to a backup event (specifying how to back up the data and where to back it up to). For general details on backup configuration and prerequisites, see Standard Backup Procedure. However, configuring an KVM/QEMU backup differs slightly from the standard procedure and requires some KVM/QEMU-specific steps, which are described below.

Information sign.png Note
The virtual machine that you want to back up must not have any defined internal or external snapshots.
  1. From Main Selection -> Tasks -> By clients, select KVM/QEMU client and click New backup task. The New backup task window opens.
  2. Select the Source. Click the Browse button (big arrow) and select the KVM virtual machine that you want to back up from the listed virtual machines detected on the host system. By selecting the source, the backup type and task name are set automatically.
  3. Kvm task browse.jpg


    Task finished.jpg


  4. If you want to define other options (such as pre/post backup and restore commands, set encryption or compress data (do not use this option if you want to restore a single file!), consolidate individual tasks under a specific task group, assign a task to the schedule), click the corresponding tabs in the New backup task window.
    Click OK to create the task.
  5. If you want to start the newly created task immediately, right-click the name of the task and click Immediate Start. If you want to create a periodic backup, you have to create a schedule for your backup task: Click New schedule under Main Selection -> Scheduling -> Schedules and set up a schedule. For more details, see Creating a schedule.
  6. SEP Tip.png Tip
    You can also add your backup task to an existing schedule by double-clicking the backup task, selecting the tab Schedules and adding it to one or more schedules. Additionally, you can group your backup tasks to task groups. For details, see Adding a Task to the Task Group.
  7. Once you have configured a schedule, you must create a new backup event for it. For general information on creating a backup event, see Creating a backup event. Note that only FULL or COPY backups of KVM virtual machines are supported.

You can view the status of your backup jobs by selecting Last backup state in the Main Selection window. The backup status overview provides detailed information on the last run of backup jobs, including the task name, start and stop time of the last backup, backup type, data size, throughput, assigned media pool, etc.

Advanced configuration

DRBD or direct attached storage

By default, SEP sesam KVM/QEMU module only supports virtual machines with default QCOW2 or RAW devices placed in the regular file system of the virtualization host. If you want to back up a virtual machine with a direct attached storage, a few additional steps are required.

  1. To snapshot a device with direct attached storage (ISCSI LUN, DRBD device) of a virtual machine, the snapshot data must be put to the disk of the hypervisor during backup. Having only internal snapshot is not sufficient for correct back up of the virtual machines disks.
  2. In the GUI, add the following option to the second tab Options in the Save options' field:
-a snapshotdir=/path/

By adding this option, SEP sesam KVM/QEMU will place the external snapshot of the direct attached storage into this directory. Note that in this configuration it is only possible to backup the whole LUN device with non-used blocks.

Task snapshotoption.jpg


Troubleshooting

Merging and deleting left over snapshots

In case a backup may fail and a snapshot ist left behind, either use the graphical "virt-manager" tool to delete the snapshot or virsh like in the following examples:

Step 1: list available snapshots for domain:

user@hypervisor:~$ virsh snapshot-list <domain-name>
Name                 Creation Time             State
------------------------------------------------------------
Sesam_SF20173828282@XXXX       2017-07-06 08:15:11 +0200 disk-snapshot

as seen in the example there exists one leftover snapshot for this virtual machine.

Step 2: list virtual disks of domain:

user@hypervisor:~$ virsh domblklist <domain-name>
Target     Source
------------------------------------------------
sda        /path/to//Sesam_SF20173828282@XXXX.snapshot

Step 3: for each device that refers to a sesam snapshot start an block commit to merge the snapshot:

user@hypervisor:~$ virsh blockcommit <domain-name> sda --active --verbose --pivot
Block Commit: [100 %]
Successfully pivoted

Step 4: confirm the device has now switched to the original disk device:

user@hypervisor:~$ virsh domblklist <domain-name>
Target     Source
------------------------------------------------
sda        /my/original/base.img

Step 5: Delete snapshot metadata information:

user@hypervisor:~$ virsh snapshot-delete <domain-name> --metadata --snapshotname Sesam_SF20173828282@XXXX
Domain snapshot sesam_snapshot deleted


Step 6: Delete snapshot file:

user@hypervisor:~$ rm /path/to//Sesam_SF20173828282@XXXX.snapshot

See also

KVM QEMU RestoreStandard Backup Procedure