+title: OpenVZ + BackupPC
+linktitle: ovzbpc
+parent: TOP
+ctime: 2008-06-09
+
+Repositories: [backuppc](http://repo/gitweb/?p=backuppc.git;a=tree),
+[ovz](http://repo/gitweb/?p=ovz.git;a=tree),
+[esata](http://repo/gitweb/?p=esata.git;a=tree).
+
+# OpenVZ
+
+TMI hosts its compute resources on DELL PE1800 servers configured as a cluster
+of [OpenVZ](http://www.openvz.org) Hardware Nodes (HN's), which host multiple
+OpenVZ Virtual Environments (VE's). Open VZ VE's are virtual machines
+virtualized at the operating system. The downside is that all VE's must be
+Linux instances capable of running on the OpenVZ kernel. The upside is that
+far more OS virtualized instances can reside on a given set of hardware
+compared to virtualizers like VMWare and Xen, which (para-)virtualize hardware.
+
+# BackupPC
+
+TMI uses [BackupPC](http://backuppc.sourceforge.net) for backup services across
+our company, including notebooks, workstations and servers (OpenVZ VE's). We
+are especially happy with BackupPC and how it is integrated into our server
+environment. Each HN is backed up as a separate host, but none of the data
+for any VE's it may be hosting. Each VE is also backed up, each as a separate
+host. Our HN's use LVM, and our add-on scripts allow for backup of any VE with
+minimal downtime. The scripts actually shut down the VE, create a snapshot of
+the HN volume on which the VE's filesystem is stored, restarts the VE,
+completes the over-the-net BackupPC backup operation, then removes the snapshot.
+By shutting down the VE, we ensure the integrity of the backup without
+requiring application specific tools like database hotcopy scripts. By using
+LVM, the VE downtime is typically less than 90 seconds. We backup every system
+every evening.
+
+# Off-site backups
+
+BackupPC maintains an on-disk archive of de-duplicated backups for all hosts.
+We maintain off-site backups by cloning the BackupPC archive to removable
+eSATA disks. For fastest recovery, we run BackupPC in a VE within our
+server infrastructure, so what we clone to an external disk is the entire
+BackupPC VE filesystem. We also keep a second partition on each removable
+disk, which contains, essentially, our HN operating system. eSATA connections
+make this backup operation very fast. And because a human must connect an
+external drive prior to the backup, that person can also provide the necessary
+key that allows the external drive filesystems to be cryptographically secure.
+We clone the BackupPC archive once per week, and rotate several external
+drives through the off-site location.
+
+# Recovery
+
+A word about recovery: great. This combination of technologies allows the
+recovery of any system, directory, or file stored within the BackupPC archive
+over the network. The data need not be recovered to the same machine from
+which it was backed up, nor does it need to be placed in the same directory.
+Restore operations are done via a web interface, and the interface does not
+have to be accessed from the machine to which the data are to be restored.
+
+Disaster recovery is also a big plus. The entire TMI infrastructure can be
+reconstructed onto new hardware from just one off-site archive drive.
+
+# TMI code
+
+TMI maintains a number of code repositories containing scripts, etc. for
+integrating OpenVZ and BackupPC. Please be aware that these are formulated
+somewhat specifically for our environment. But if you have a similar setup,
+they should be usable with minimal massaging. Someday, someone here will take
+the time to merge this stuff into a single repo and document it better.
+
+# BackupPC scripts
+
+The [BackupPC scripts repository](http://repo/gitweb/?p=backuppc.git;a=tree)
+includes:
+
+* BackupPC_ovz. Installed on an HN, it allows BackupPC to backup from and
+ restore to any VE hosted on any HN in the cluster. When VE's are migrated
+ between HN's, the backup configuration does not need to change.
+
+* Holger Parplies' BackupPC_verifyPool.
+
+* See the [README](http://repo/gitweb/?p=backuppc.git;a=blob;f=README;hb=HEAD)
+ in the repository for more information.
+
+# OpenVZ scripts
+
+The [OpenVZ scripts repository](http://repo/gitweb/?p=ovz.git;a=tree)
+includes:
+
+* bpcdump. Similar in concept to vzdump. Although fairly general in nature,
+ we use it only for backing up the BackupPC VE, whose filesystem is on a
+ private LVM LV (logical volume), to an eSATA drive.
+
+* bpcbackup. A script that runs from crontab on one or more HN's to launch
+ the bpcdump program. Since all our HN's are configured the same, each has
+ an eSATA port and can be used to perform a backup of the BackupPC VE.
+
+* See the [README.recover](http://repo/gitweb/?p=ovz.git;a=blob;f=README.recover;hb=HEAD)
+ file for mroe information.
+
+# eSATA scripts
+
+The [eSATA scripts repository](http://repo/gitweb/?p=esata.git;a=tree)
+contains the esata script, which wraps the `scsiadd` utility for properly
+handling esternal drives on the Dell PE1800 and PE1900 platforms. Newer
+hardware and better Linux kernel support should someday make scripts like this
+unnecessary. See the included
+[README](http://repo/gitweb/?p=esata.git;a=blob;f=README;hb=HEAD) file for
+more information.