5.3 Backing up Virtual Machines

There are a number of options you can use to take a back up of a virtual machine. This section discusses some of them and the pros and cons for each.

One of the main points that should be considered when backing up a virtual machine, is whether you can shut down the virtual machine during the back up. Backing up a running virtual machine allows the machine to be available for use, but does not allow for a back up that is consistent or easy to restore. Creating a back up of a running virtual machine is similar to taking a back up of a running database without putting the tablespaces in back up or read-only mode. The first couple of blocks you back up from a the virtual machine are likely to be out of sync with the last blocks of your back up. If and when you try to restore a back up taken from a running virtual machine, you may not be able to rebuild the machine due to disk errors.

You can install back up software in the virtual machine, for example Oracle Secure Backup. This allows you to safely back up a running virtual machine. The ease by which you can restore the virtual machine from the back up depends on the software used.

The following table discusses some virtual machine back up options, with some high level benefits and disadvantages of each method. This is not an exhaustive list of all the options that may be available.

Table 5.1 Virtual Machine Backup Options

Backup OptionBenefitsDisadvantages

Install back up software in the virtual machine and back up to an external source.

Virtual machine can be running.

Fine grained control of files backed up.

 

Create a back up of the virtual machine from the storage repository (see Repository Exports Perspective).

Consistent virtual disk status.

Virtual machine must be stopped.

Create a cold clone of the (stopped) virtual machine (see Clone a Virtual Machine or Template, then back up the clone from the storage repository (see Repository Exports Perspective).

Consistent virtual disk status.

Virtual machine must be stopped.

Create a hot clone of the (running) virtual machine (see Clone a Virtual Machine or Template, then back up the clone from the storage repository (see Repository Exports Perspective).

Virtual machine can be running.

Inconsistent virtual disk status. Virtual disks may need to be recovered using a disk repair utility.

May cause data loss or corruption.

Only available on OCFS2-based file systems (iSCSI or fibre channel-based storage).

Should not be used for virtual machines running an Oracle Database (instead use the rman utility or similar).

Create a back up of the entire storage repository (see Repository Exports Perspective).

Back up all virtual machines at once.

Consistent virtual disk status.

Virtual machines must be stopped.


The two recommended strategies for backing up a virtual machine are to:

  • Shut down the virtual machine and create a cold clone, then back up the clone files from the storage repository.

  • Shut down the virtual machine and back up the virtual machine files from the storage repository.

These two options create a safe back up, with the virtual disks in a stable and consistent state. To restore the virtual machine, import the virtual machine into the storage repository (see Import Virtual Machine).