Книга: Mastering VMware® Infrastructure3

Using VCB for File-Level Backups

Using VCB for File-Level Backups

For Windows virtual machines, and only for Windows virtual machines, VCB offers file-level backups. A file-level backup is an excellent complement to the full virtual machine or the single VMDK backup discussed in the previous sections. For example, suppose you built a virtual machine using two virtual disks: one for the operating system and one for the custom user data. The operating system's virtual disk will not change often with the exception of the second Tuesday of each month when new patches are released. So that virtual disk does not need consistent and regular backups. On the other hand, the virtual disk that stores user data might be updated quite frequently. To get the best of both worlds and implement an efficient backup strategy, you need to do a single VMDK backup (for the OS) and file-level backup (for the data).

Perform the following steps to conduct a file-level backup using VCB:

1. Log in to the backup proxy where VCB is installed.

2. Open a command prompt and change directories to C:Program FilesVMwareVMware Consolidated Backup Framework.

3. Use the vcbVmName tool to enumerate virtual machine identifiers. At the command prompt, type:

vcbVmName <IP or name of VirtualCenter> -u <username> -p <password> -s ipaddr:<IP address of virtual machine to backup>

4. From the results of running the vcbVmName tool, select which identifier to use (moref, name, uuid, or ipaddr) in the vcbMounter command.

5. As shown in Figure 10.49, type the following at the command prompt:

VcbMounter -h <IP or name of VirtualCenter> -u <username> -p <password> -s ipaddr:<IP address of virtual machine to backup> -t file -r <VCB proxy backup directory>

6. Browse to the mounted directory to back up the required files and folders.

7. After the file- or folder-level backup is complete, use the following command, shown in Figure 10.50, to remove the mount point:

mountvm -u <path to mount point>

8. Exit the command prompt.


Figure 10.49 A file- or folder-level backup begins with mounting the virtual machine drives as directories under a mount point on the VCB server.


Figure 10.50 After performing a file-or folder-level backup using the vcbMounter command, the mount point must be removed using the mountvm command.

Sticky Snapshots

If a snapshot refuses to delete when the mountvm -u command is issued, it can always be deleted from the snapshot manager user interface, which is accessible through the VI Client. 

Real World Scenario

VCB with Third-Party Products

Once you have mastered the VCB framework by understanding the VCB mounter commands and the way that VCB works, then working with VCB and third-party products is an easy transition. The third-party products simply call upon the VCB framework to perform the vcbmounter command. All the while the process is wrapped up nicely inside the GUI of the third-party product. This allows for scheduling the backups through backup jobs.

Let's look at an example with Symantec Backup Exec 11d. Once the 11d product is installed, followed by the installation of VCB, a set of integration scripts can be extracted from VCB to support the Backup Exec installation. When a backup job is created in Backup Exec 11d, a pre-backup script runs (which calls vcbmounter to create the snapshot and mount the VMDKs), and once the backup job completes, a post-backup script runs to unmount the VMDKs. During the period of time that VMDKs are mounted into the file system, the Backup Exec product has access to the mounted VMDKs in order to back them up to disk or tape, as specified in the backup job. See the following sample scripts, which perform a full virtual machine backup of a virtual machine with the IP address 192.168.4.1.

First, the pre-backup script example:

"C:Program FilesVMwareVMware Consolidated Backup Frameworkbackupexecpre-backup.bat" Server1_FullVM 192.168.4.1-fullvm

Now, the post-backup script example:

"C:Program FilesVMwareVMware Consolidated Backup Frameworkbackupexecpost-backup.bat" Server1_FullVM 192.168.1.10-fullVM

Notice that there is no reference to vcbmounter or the parameters required to run the command. Behind the scenes the pre-backup. bat and post-backup.bat files are reading a configuration file named config.js to pull defaults for some of the parameters for vcbmounter and then using the information given in the lines shown earlier. When vcbmounter extracts the virtual machine files to the file system of the VCB proxy, the files will be found in a folder named 192.168.4.1-fullvm in a directory specified in the configuration file. A portion of the configuration file is shown here. Note that the file identifies the directory to mount the backups to (F:mnt) as well as the VirtualCenter server to connect to (vc01.vlearn.vmw) and the credentials to be used (administrator /Password1):

/*
* Generic configuration file for VMware Consolidated Backup (VCB).
*/
/*
* Directory where all the VM backup jobs are supposed to reside in. 
* For each backup job, a directory with a unique name derived from the
* backup type and the VM name will be created here.
* If omitted, BACKUPROOT defaults to c:mnt.
*
* Make sure this directory exists before attempting any VM backups.
*/
BACKUPROOT="F:mnt";/*
* URL that is used by "mountvm" to obtain the block list for a
* disk image that is to be mounted on the backup proxy.
*
* Specifying this option is mandatory. There is no default
* value.
*/
HOST="vc01.learn.vmw";
/*
* Port for communicating with all the VC SDK services.
* Defaults to 902
*/
// PORT="902";
/*
* Username/password used for authentication against the mountvm server.
* Specifying these options is mandatory.
*/
USERNAME="administrator"; PASSWORD="Password1";

The combination of the configuration file with the parameters passed at the time of execution results in a successful mount and copy of the virtual machine disk files followed by an unmount.

Depending on the size of the virtual machines to be backed up, it might be more feasible to back up to disk and then create a second backup job to take the virtual machine backups to a tape device.

Оглавление книги


Генерация: 1.287. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз