Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

21.2. Preparing for Disaster Recovery


If at all possible, it is best to prepare for situations where your equipment will be compromised due to weather, or other reasons. It is highly recommended that you perform a backup of the following files and directories on your host physical machine:
  • From the /etc/libvirt directory, all files.
  • From the /var/lib/libvirt directory, back up the following items:
    • The current dnsmasq DHCP leases found in /var/lib/libvirt/dnsmasq
    • The running virtual network configuration files found in /var/lib/libvirt/network
    • Guest virtual machine files created by virt-manager when saving the current state of a guest, if there are any. These can be found in the /var/lib/libvirt/qemu/save/ directory. If the virsh save command was used to create virtual machines, the files can be found in the location specified for virsh save by the user.
    • The guest virtual machine snapshot files, created by the qemu-img create and virsh snapshot-create commands and found in the locations specified for the commands by the user.
    • Guest virtual machine disk images created by virt-manager, if any, which can be found in the /var/lib/libvirt/images/ directory. If the virsh pool-define command was used to create virtual storage, the image file can be found in the location specified for virsh pool-define by the user. For instructions on how to back up the guest image files, use the steps described in Procedure 21.1, “Creating a backup of the guest virtual machine's disk image for disaster recovery purposes”.
  • If you are using bridges, you will also need to back up the files located in /etc/sysconfig/network-scripts/ifcfg-<bridge_name>
  • Optionally, the guest virtual machine core dump files found in /var/lib/libvirt/qemu/dump can also be backed up to be used for analysing the causes of the failure. Note, however, that these files can be very large for some systems.

Procedure 21.1. Creating a backup of the guest virtual machine's disk image for disaster recovery purposes

This procedure will cover how to back up several different disk image types.
  1. To back up only the guest virtual machine disk image, back up the files located in /var/lib/libvirt/images. To back up guest virtual machine disk images with LVM logical volumes, run the following command:
    # lvcreate --snapshot --name snap --size 8G /dev/vg0/data
    This command creates a snapshot volume named snap with a size of 8G as part of a 64G volume.
  2. Create a file for the snapshots using a command similar to this one:
    # mkdir /mnt/virt.snapshot
  3. Mount the directory you created and the snapshot volume using the following command:
    # mount /dev/vg0/snap /mnt/virt.snapshot
  4. Use one of the following commands to back up the volume:
    1. # tar -pzc -f /mnt/backup/virt-snapshot-MM-DD-YYYY.tgz /mnt/virt.snapshot++++++++++++
    2. # rsync -a /mnt/virt.snapshot/ /mnt/backup/virt-snapshot.MM-DD-YYYY/
Red Hat logoGithubRedditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

© 2024 Red Hat, Inc.