个人工具

UbuntuHelp:OpenVZ/VZDump

来自Ubuntu中文

跳转至: 导航, 搜索

Introduction

`VZDump` is a utility to make consistent snapshots of running OpenVZ containers. It basically creates a tar archive of the container's private area, which also includes the CT configuration files.

Download

VZDump can be obtained from Proxmox website.

Usage

`vzdump` can create backups in several ways. To get all available options, use:

# vzdump
usage: /usr/sbin/vzdump OPTIONS [--all | VPSID]

	--exclude VPSID		exclude VPSID (assumes --all)
	--exclude-path REGEX	exclude certain files/directories
	--stdexcludes		exclude temorary files and logs

	--compress		compress dump file (gzip)
	--dumpdir DIR		store resulting files in DIR
	--tmpdir DIR		store temporary files in DIR

	--mailto EMAIL		send notification mail to EMAIL.
	--quiet			be quiet.
	--stop			stop/start VPS if running
	--suspend		suspend/resume VPS when running
	--snapshot		use LVM snapshot when running
	--size MB		LVM snapshot size

	--node CID		only run on pve cluster node CID
	--lockwait MINUTES	maximal time to wait for the global lock
	--stopwait MINUTES	maximal time to wait until a VM is stopped
	--bwlimit KBPS		limit I/O bandwidth; KBytes per second

	--restore FILENAME	restore FILENAME

Special notes on LVM based deployments

`vzdump` is able to backup the running containers with 0 downtime once using lvm snapshots capabilities. Use: `--suspend` option to enable the use of the lvm snapshots. (!) Warrning: to be able to use `--suspend` option, you should have the `--dumpdir` argument pointing to a location different from the current LVM VG. Also, you should leave at least 512Mb (1G will surely be fine) of free space inside the containers LVM VG. Otherwise you won't be able to get `--suspend` for backups. Here is an example of an OpenVZ partitioning under Ubuntu 8.04.3: