Skip to content

Latest commit

 

History

History
115 lines (71 loc) · 3.06 KB

README.pod

File metadata and controls

115 lines (71 loc) · 3.06 KB

NAME

virt-backup - backup libvirt domains

SYNOPSIS

virt-backup OPTIONS domainname [[blkdev] ...]

ARGUMENTS

domainname

The domain you want to back up.

blkdev

EXPERIMENTAL: If you want to backup only a specific disk of the domain, specify its name here. Multiple names can be given separated by spaces.

OPTIONS

-h

Show usage

-m

Show manpage

-c [libvirt-uri]

Use hypervisor at [libvirt-uri] instead of the default.

-v

Be chatty. But you knew that, didn't you?

DESCRIPTION

virt-backup is used to backup a virtual machine (domain) managed by libvirt. It will archive the configuration, and disks as seperate files in a directory you specify. Depending on the backup mode (see "Backup Modes") and wether the domain is running, the domain's state (RAM) will be archived as well.

This script may be executed on a different machine than the hypervisor, in which case you must make sure that the paths as seen by the hypervisor are accessible in the same form on the machine the script runs on.

About logging

virt-backup by default keeps very silent, writing just both start and end as informational level messages to your syslog and stdout.

Any problems will be written on stdout and sent with the appropiate level to syslog as well. Note that any error messages generated by external tools are redirected to an seperate logfile.

Selecting verbose mode will print a lot more informational messages on stdout, but these will not be sent to syslog nor recorded.

Backup Modes

Please note: Depending on your libvirt and hypervisor version (and combinations thereof), some of these modes may not be supported. Consult with the according documentation, and test first. (Since there are a lot of possible combinations, virt-backup cannot [yet] do this for you).

shutdown

Properly shutdown the domain prior to backup, restart it afterwards. This requires that you have set up your hypervisor to be able to signal the domains OS to do a regular shutdown (qemu-ga, ACPI, ...)

suspend

halt the domain prior to backup, backup both RAM and disk, resume it afterwards. Backup is consistent, in a live state. dowtime for the duration of the backup. You need some kind of proper timekeeping in your domain, or else the time will be way off after resuming.

snapshot-libvirt

NOT YET IMPLEMENTED take a live snapshot of the domain with libvirt, backup both RAM and disk, and discard the snapshot afterwards. backup is consistent, in a live state. No measurable downtime.

snapshot-dm

NOT YET IMPLEMENTED halt the domain, write out RAM to disk, then take a devicemapper snapshot and resume the domain. backup both disk and ram, and discard the snapshot afterwards. Backup is consistent, in a live state, very short downtime. This requires the path where the domain's disk reside to be mounted through the devicemapper (or LVM).

EXIT CODES

Any exit code >0 signifies an error, and a possibly unsucessful backup. Check the error log.