Installing and Configuring VMware Virtual Consolidated Backup – VMware VCB

VCB or Virtual Consolidated Backup is the ideal way to back up VMware's virtual environment. In this document, we'll show you how to configure VCBs to back up the virtual machines you're interested in, are complete copies of the VC or copies of their contents. We will also integrate VCB with Symantec Backup Exec.

VMware Consolidated Backup is an easy-to-use, centralized backup program that incorporates the best features of both options. Provides file-by-file backup without the need for a backup agent, and supports incremental and full file protection.

This would be the VCB scheme. We have one or more ESX Hosts with their virtual machines and storage. VCB relies on snapshots to take a 'photo’ of the virtual machine in question and copies this data to the location we provide. We will note that the VCB server must be a physical server, with Windows. Ideally, this server should have at least one HBA to connect directly to the storage, as copying over Ethernet can be sweaty. Once we have the(s) MV(s) Mounted(s) We'll simply use an alternative method to put them on a tape drive or in another location, is an external USB drive… after the copying will be the dismantling of the.

The first thing is to get VCB on the official VMware website (HTTP://www.vmware.com/download/) once we have registered or logged in with our VMware accounts, we started the installation of VMware Consolidated Backup Framework. “Next”,

We must accept the license agreement “I accept the terms in the license agreement” & “Next”,

The default installation path will be “C:Program FilesVMwareVMware Consolidated Backup Framework” & “Next”,

Click on “Install” to install VCB now!

… wait a few seconds while it installs…

“Finish”, Installation ready.

GOOD, now before you go ahead and install the application to integrate with Symantec Backup Exec, We see the commands we can use to make copies of our virtual machines. We can use this to make copies with scripts or backup applications that allow us a pre-task and a post-area. To see all the possibilities we have, we run from an MSDOS window in “C:Program FilesVMwareVMware Consolidated Backup Framework” The vcbMounter.exe command /?. With this we will see all the possibilities, To mount a full 'FullVM' virtual machine’ called 'XPe01’ on the VirtualCenter server '10.130.48.88’ in the 'C directory:TempXPe01-fullVM and Fiber Network's Backward’ the following command would be executed: vcbMounter.exe -h HOST_ESX/VIRTUAL_CENTER -u USERNAME -p PASSWORD -a name:NOMBRE_MV -r DIRECTORIO_DESTINO -t TIPO_COPIA(fullvm/file) -m TIPO_RED(SAN/NBD). This would be the Pre-task.

…we wait while copying this full MV…

List, only the used data of the VM will copy us, not the entire disk. GOOD.

If we open the destination directory we can verify that we already have the machine here, Now we would simply make a copy of this content to another location with some task, be another HD, Be a tape drive…

Once we have it mounted on that route, we run a copy with a backup program or a simple MSDOS COPY, or with NTBackup…

…we wait while it backs us up to another location…

List!

Post-copy to another HD or tape, We must dismantle the above, To do this, we execute in “C:Program FilesVMwareVMware Consolidated Backup Framework”: vcbMounter.exe -h HOST_ESX/VIRTUALCENTER -u USERNAME -p PASSWORD -U DIRECTORIO_DONDE_SE_MONTO. This could be the post-task of a backup.

… wait a few seconds while it disassembles… (Let's go, that will delete that directory),

List,

Now, We can take advantage of some scripts (made by a colleague) to automate all of this, if we don't have a backup application as God commands, we can always resort to this, Super Useful. There are several executables, that some call each other to make a backup of several virtual machines, in a specified order in a text file called 'VMs.txt', Below I show these scripts in order of being called. The first file will be called BkpVMs.cmd with the content:

@ECHO OFF
REM ***
REM *** Total, Copy and dismount virtual server images based on the VMs.txt list
REM ***
FOR /F “eol=;” %%i IN (VMs.txt) OJ montaVM.cmd%%i

The second file, montaVM.cmd will mount the virtual machines that the previous command passes to it:

@ECHO OFF
REM ***
REM *** Receives as a parameter %1 The name of the virtual machine, as it is known in the Virtual Center.
REM ***
REM *** Note that the variable %VCBBASE% has the value: “c:Program FilesVMwareVMware Consolidated Backup Framework”
REM ***
REM *** Create the snapshot of the virtual machine %1 and mounts it in the SAN (Luna VMBackup)
REM ***
ECHO %1;%DATE%-%TIME%;Home montaVM >> LOGBkpVMs.LOG
“%VCBBASE%vcbmounter” -h VIRTUALCENTER. DOMAIN. ESO -u USERNAME -p PASSWORD -a name:%1 -r X:PATH%1-fullVM -t fullvm -m san
ECHO %1;%DATE%-%TIME%;End of VM Mounts >> LOGBkpVMs.LOG
REM ***
REM *** Run the VM copy %1
REM ***
ECHO %1;%DATE%-%TIME%;Start CopyVM >> LOGBkpVMs.LOG
CALL copiaVM.cmd %1
ECHO %1;%DATE%-%TIME%;End of VM copy >> LOGBkpVMs.LOG
REM ***
REM *** Disassemble from the virtual machine %1
REM ***
ECHO %1;%DATE%-%TIME%;Start dismountingVM >> LOGBkpVMs.LOG
desmontaVM.cmd %1
ECHO %1;%DATE%-%TIME%;End dismantlesVM >> LOGBkpVMs.LOG

The 'copiaVM.cmd’ Make the copy we are interested in, in the EJEMPLO1 we see a copy with NTBACKUP, in the EJEMPLO2 makes a copy with a COPY. It contains the following:

@ECHO OFF
REM ***
REM *** Receives as a parameter %1 The name of the virtual machine, as it is known in the Virtual Center.
REM ***
REM *** Example 1:
REM *** C:WINDOWSsystem32ntbackup.exe backup X:PATH%1-FullVM /a /v:No /r:No /rs:No /hard carry:Off /m normal /j Bkp_%1 /l:s /f RUTA_FICHERO.bkf
REM ***
REM *** Example 2:
REM *** copy X:PATH%1-FullVM TARGET

Once you have copied you must unmount the previously mounted directory with the 'desmontaVM.cmd', Your Content:

@ECHO OFF
REM ***
REM *** Receives as a parameter %1 The name of the virtual machine, as it is known in the Virtual Center.
REM ***
“%VCBBASE%vcbmounter” -h VIRTUALCENTER. DOMAIN. ESO -u USERNAME -p PASSWORD -U X:PATH%1-FullVM

These are some scripts that we can use to make backups of our virtual machines.

Another way to make copies is with the 'file' parameter’ when mounting virtual machines, Let's see an example.

It mounts your virtual hard drive as a virtual device…

We see that the command is executed in a few seconds and mounts the virtual hard drives that it has in the directory that we have specified.

If we access with a browser, We will see the contents of your virtual hard drives, now with a backup application we can make copies of the contents of the virtual machine without having to make a complete backup of the VM.

And after the copy we make, remember to disassemble it!

List.

Integrate VMware Consolidated Backup with Symantec Backup Exec,

Well, In this part of the document, We show how VCB integrates with Symantec BackupExec. To do this,, We must download this file (HERE) and unzip it into “C:Program FilesVMwareVMware Consolidated Backup Framework” under the name of “backupexec”.

List of files…

We go to that route by MSDOS to “C:Program FilesVMwareVMware Consolidated Backup Frameworkbackupexec” and we executed 'install.bat'.

He asks us if the VCB directory is correct, We check if it is, and hit Enter.

pulmos 'y',

We press 'and’ to view the configuration file.

We go through the entire file and configure the parameters correctly, File example.


  /*
 * 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:DIRECTORIO";
/*
 * 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="virtualcenter.dominio.local";
/*
 * 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="user";
PASSWORD="contraseña";
/*
 * SNAPSHOT_POLICY determines how disk snapshots for backup are being created:
 * +) "automatic"
 *    A snapshot is being generated automatically by the Legato Networker
 *    Interoperability Module right before backup and it is being removed
 *    automatically right after backup.
 * +) "manual" -
 *    Exactly one snapshot named "_VCB-BACKUP_" must already exist for
 *    each protected VM. The snapshot is mounted/unmounted on the proxy,
 *    but the snapshot is neither created nor deleted by the Legato Networker
 *    Interoperability Module. - This can be used to have external tools
 *    manage backup snapshot.
 * +) "createonly"
 *    The Legato Networker Interoperability Module will create the snapshot
 *    for each VM right before it gets backed up, but will not remove the
 *    snapshot after unmounting.
 * +) "deleteonly"
 *    The Legato Networker Interoperability Module assumes that the snapshot
 *    named "BACKUP" has been created beforehand. The snapshot will be deleted
 *    automatically after backup.
 *
 *    This is useful when Legato Networker should still be used in the protected
 *    VM to get application-consistent snapshots that are obtained from within
 *    the VM. See README-legato.html for more details.
 *
 * The default option is "automatic"
 *
 */

//SNAPSHOT_POLICY="automatic";

We edit it at will, we save it and close it.

Eye! Before continuing, we must create the directory where the virtual machines will be mounted, in my case I have signed him that it will be 'F:Mnt', So I create this directory for me to mount there. I take this opportunity to create a directory to save a backup copy of the VM's in it, since I don't have a computer with tapes to copy there, I think 'F:VMBACKUPS'.

In Symantec Backup Exec I'm going to create a folder so I can make the copies there, It's supposed to be on an external drive ;),

I give him a name, in this example case 'VMBackup’ which will refer to 'F:VMBACKUPS’

Well, We continue with the configuration wizard, We indicate that 'n’

He asks us if we want to see the help, Anyway, Even if it's your first time I recommend it, s/n,

Ok, we close the DOS window…

Once VCB is installed and configured for our Symantec Backup Exec, we need to restart the BackuExec services, for this, in the Symantec Backup Exec console, We're going to “Tools” > “Backup Exec Services…”

Select our server and click “Restart all services”

…We wait while you restart them…

GOOD, we have to set up the PreTask command, for this we are going for a console from DOS to “C:Program FilesVMwareVMware Consolidated Backup Frameworkbackupexec” and we run the following command: 'pre-backup.bat NOMBRE_DE_TAREA NOMBRE_MV-fullVM’ and we execute it. If the command runs well, copy the command to a Notepad,

We see that where we have indicated the VCB configuration file, the virtual machine that we indicate is being mounted.

Once assembled, we must dismantle the VM, for this from the same DOS console, We run 'post-backup.bat NOMBRE_DE_TRAEA'. If the command runs well, copy the command to Notepad,

GOOD, Now that everything works, we are going to Backup Exec to create a copy task where we execute this PreTask, Copying and PostTask. Envelope “Task Settings” > “New task”

In the part of “Configuration” > “General” we must first indicate the 'Task Name'’ with the same one that we have just indicated in the Pre and Post task commands. In “File Backup Method” Select “Full backup files – Use Modification Time” and uncheck the check of “Use Windows Change Journal if available”.

More, in “Pre-task and post-task commands” We must indicate the same as before:

Pre-task command: 'pre-backup.bat NOMBRE_DE_TAREA NOMBRE_MV-fullVM’
Post-task command: 'post-backup.bat NOMBRE_DE_TRAEA’

Eye, Now we must go to “Selections” to select what we want to back up, but we will not find it since the VM we want to copy is not assembled, So we have two options, or we execute in DOS the command to mount it; or in “View selection details” we introduce the path where the VMs will be assembled by hand. We configure all the other settings that interest us, such as where to save the backup, programming… Click on “Send” to store it.


We started it…

And during copying we check how the VM is assembled, is stored on your device and finally the VM is automatically disassembled.

If we open the VMware VirtualCenter console with the VMware Infrastructure Client, We will see in the taskbar that snapshots are being created and subsequently deleted, this is because VCB is supported by this technology.

If we modify the PreTask parameter and remove the -fullVM parameter, it will not mount the entire virtual machine, if we don't see the content of it, just to back up your data,

Pre-task command: 'pre-backup.bat NOMBRE_DE_TAREA NOMBRE_MV’

When we mount the virtual machine in this way, We would see the contents of your mounted virtual hard drives.

How to recover a virtual machine when we have made a backup with VCB,

¿interesting, No? 😀

Simply, we will use VMware Converter (We can rely on http://www.bujarra.com/?p=1093) to import it, we open the VMware Virtual Center console, over a right-click host or cluster > “Import Machine…”

“Following”,

“Other”,

We select the VMX file that we have miraculously saved, it has to be a UNC route! We provide a username and password to access the resource, “Following”,

“Following”,

“Following”,

We indicate the name of MV that you had before, we select the target DataCenter, “Following”,

Select the LUN where it was or shared storage, “Following”,

We check that you have all OK network adapters and on your corresponding network, “Following”,

“Following”,

“Following”,

“End”,

We check on the taskbar that the VM we had backed up is importing back into our virtual environment,

List! All that's left is to tear it off!!!!


Recommended Posts

Author

nheobug@bujarra.com
Autor del blog Bujarra.com Cualquier necesidad que tengas, Do not hesitate to contact me, I will try to help you whenever I can, Sharing is living ;) . Enjoy documents!!!