Vous êtes sur la page 1sur 43

Setting Up VMware Consolidated Backup

Table of Contents
1. Introduction .............................................................................................. 3
2. Understanding VCB .................................................................................. 3
2.1 Limitations of VCB .................................................................................................................................... 4
2.2 VCB Operations ........................................................................................................................................ 4
2.2.1 Freeze VM (Pre-backup) .............................................................................................................................. 4
2.2.2 Invoke Backup Software ............................................................................................................................... 4
2.2.3 Cleanup ........................................................................................................................................................ 4
2.3 Comparison of backup methods ............................................................................................................... 5
2.4 Custom VM Quiesce Scripts..................................................................................................................... 6
2.5 VCB Commands ....................................................................................................................................... 7
2.5.1 vcbMounter Command Syntax ..................................................................................................................... 8
2.6 VCB Modes ............................................................................................................................................ 10
2.7 Disk Export Flags ................................................................................................................................... 11

3. Installation Sequence ............................................................................. 12


3.1 System Requirements ............................................................................................................................ 12
3.2 Setting up VMware Tools ....................................................................................................................... 12
3.3 Create a VCB User ................................................................................................................................. 13
3.4 Pre-Configuring the VCB Proxy .............................................................................................................. 13
3.4.1 Disable automatic drive letter assignment .................................................................................................. 13
3.4.2 Enable Unsigned Driver Installation............................................................................................................ 14
3.5 Install the Backup Software .................................................................................................................... 15
3.6 Install the VCB Framework ..................................................................................................................... 15
3.7 Install the Integration Kit ......................................................................................................................... 17
3.8 Install VMware Converter ....................................................................................................................... 17
3.9 Attach the LUNs ..................................................................................................................................... 17

4. System Configuration ............................................................................. 18


4.1 Password Security .................................................................................................................................. 18
4.2 The config.js File .................................................................................................................................... 18
4.2.1 Syntax ........................................................................................................................................................ 19
4.3 Configure Backup Software .................................................................................................................... 19

5. Backing Up VMs ..................................................................................... 20


5.1 FullVM Type Backups............................................................................................................................. 20
5.2 File Type Backups .................................................................................................................................. 21

David Convery Pg. 1 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
6. Recovering VMs and Files ...................................................................... 22
6.1 Recovering VMs ..................................................................................................................................... 22
6.2 Recovering Files ..................................................................................................................................... 26
6.2.1 File Level Restore from FullVM Backups .................................................................................................... 26
6.2.2 Restoring from File Level Backups ............................................................................................................. 28

7. Appendix A - Architecture Design Considerations .................................. 29


7.1 Sizing Considerations ............................................................................................................................. 29
7.2 SAN Connections ................................................................................................................................... 29
7.3 Best Practices ......................................................................................................................................... 30

8. Appendix B - Troubleshooting ................................................................ 31


8.1 Four steps to effective troubleshooting .................................................................................................. 31
8.2 Troubleshooting Methods ....................................................................................................................... 31

9. Appendix C - Using VCB in a VM with Hot-Add mode ............................ 32


9.1 Requirements for Hot-Add Mode ............................................................................................................ 32
9.2 Setting Up a VCB Proxy for Hot-Add Mode............................................................................................ 32
9.3 Using VCB in Hot-Add Mode .................................................................................................................. 33
9.3.1 FullVM type backup .................................................................................................................................... 33
9.3.2 File type backup ......................................................................................................................................... 34

10. Appendix D - Performing FullVM Backups on Selected VM Disks .......... 36


10.1 Data Drive Using an RDM in Physical Compatibility Mode .................................................................... 36
10.1.1 VCB FullVM Type Backup with SAN-Based Data Backup.......................................................................... 36
10.1.2 VCB FullVM Type Backup with Client Based Data Backup ........................................................................ 36
10.2 Data Drive Using and RDM in Virtual Compatibility Mode or a VMDK .................................................. 37
10.2.1 Mixed VCB FullVM Type and File Type Backup Methods .......................................................................... 37
10.3 Performing FullVM Type Backups on Selected Disks ............................................................................ 38

11. Appendix E - Sample Backup Scripts ..................................................... 42


11.1 Generic FullVM Backup Scripts .............................................................................................................. 42
11.1.1 Generic FullVM Pre-Backup Script ............................................................................................................. 42
11.1.2 Generic FullVM Post-Backup Script ........................................................................................................... 42
11.2 Generic File Level Backup Scripts ......................................................................................................... 42
11.2.1 Generic File Level Pre-Backup Script ......................................................................................................... 42
11.2.2 Generic File Level Post-Backup Script ....................................................................................................... 42

12. Appendix F - Reference Documents ....................................................... 43

David Convery Pg. 2 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
1. Introduction
This document provides the generic steps necessary to configure the VMware Consolidated Backup Framework
for use with your backup software. It is not a guide for installing your backup software and will only discuss
generalized settings that may be required in your backup software.

Note: This is not an official VMware whitepaper or document. Please use at your own discretion.

This document assumes the following versions are being used:


vCenter 2.5 (Any update level)
ESX 3.5 (Any update level)
VCB 1.5 proxy server
VMware Converter 3.0.3 or above (Version 4.0.0-146302 is used in this document).
Most of this document will center on the use of a Fibre Channel SAN. It is also recommended that the VCB Proxy
Server also be configured as a media or tape server, which means that it should have direct access to the tape
drives or Virtual Tape Library (VTL). This allows for backups in a more efficient manner. Alternative VCB modes
will be discussed where appropriate.

Please refer to the documentation referenced at the end of this guide for further information.

2. Understanding VCB
The following are some point about the VCB Framework:
Most major backup applications integrate with VCB providing you with a fast and efficient way of backing
up data in virtual machines.
VCB eliminates the need for having a backup agent installed in each virtual machine you want to protect.
VCB supports file-level full and incremental backups for Windows VMs and image-level backups for VMs
running any OS.
You can use VCB against a single ESX or ESXi server or with a VirtualCenter Server.
VCB is NOT a stand-alone backup application, however you could create stand alone scripts and
schedule them to run VCB based backups to local staging disk on a VCB Proxy
VCB is a framework that can enable “LAN-Free” backups of virtual machines.
VCB provides the backup software with a way to access data stored in virtual machine disk images stored
on VMFS
VCB can use iSCSI or SAN based LUNs as long as the VCB proxy has access to them.
VCB can connect to the ESX hosts via the LAN for local or NAS based VMs
VCB can be installed on a VM for iSCSI SAN, NBD or Hot-Add modes

David Convery Pg. 3 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
2.1 Limitations of VCB
VCB Has several limitations that could prevent successful backups. They are as follows:
In SAN mode, the VCB proxy must have access to all of the LUNs that contain VMs to be backed up.
VCB cannot back up RDMs in physical compatibility mode.
VCB cannot perform file level backups of non- Windows VMs.
VCB cannot backup VMs using cluster services, such as MSCS.
For FullVM type backups, copy speed to the Holding Tank is limited to about 1GB per minute. This is
actually a limitation within “cmd.exe” and not VCB.

2.2 VCB Operations


The first step of the backup process is to call vcbMounter. The framework and integration kits include a javascript
facility. This allows the pre- and post-backup scripting functionality of the backup software to call vcbMounter and
initiate the process to perform a VCB backup.

2.2.1 Freeze VM (Pre-backup)


The vcbMounter or vcbSnapshot command is used to create a VM snapshot so that the base disk is frozen and
all subsequent disk activity is written to a delta. The following lists the sequence of events:
1. (Optional) Pre-freeze: script to quiesce any applications in Guest
2. VMware Tools: quiesce file system using SYNC driver or VSS driver (Windows only)
3. Freeze VM and create VM snapshot
4. Thaw VM– disk activity resumes and is written to buffer (disengage SYNC driver if applicable)
5. (Optional) Post-thaw: script to un-quiesce applications

File Level Backups (Windows only) FullVM Backups

Mount volume(s) to virtual disk partition(s) Export VM as VM backup to “holding tank”

Wait for VM export to “holding tank” to complete

(VM snapshot is not committed nor deleted) Commit post-VM snapshot disk activity and
delete VM snapshot

2.2.2 Invoke Backup Software


Backup application accesses mounted VM virtual Backup application accesses mounted VM virtual
disk(s), traverses VM file system, and copies disk(s), traverses VM file system, and copies
selected files selected files

2.2.3 Cleanup
Dismount mounted VM virtual disk(s) (optional) Delete FullVM backup files

Commit post-VM snapshot disk activity and delete


VM snapshot

David Convery Pg. 4 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
2.3 Comparison of backup methods

File Level Backups (Windows only) FullVM Backups

Advantages: Advantages:
No disk space is required for staging The entire VM is backed up
File level recovery is simple The backup includes Windows system state
files
Simple disaster recovery
Ease of management

Disadvantages: Disadvantages:
The backup does not include Windows Sufficient disk space is required for holding
system state files tank
Requires a base VM for recovery in case of File level recovery involves restoring the VM
catastrophic failure files to a staging area and mounting the
VMDK file to extract data.
Not compatible with non-Windows systems
No ability to leverage differential incremental
backups.

David Convery Pg. 5 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
2.4 Custom VM Quiesce Scripts

3.5 U1 and Earlier 3.5 U2 and Later

%WINDiR%\pre-freeze-script.bat %ProgramFiles%\VMware\VMware Tools\backupScripts.d


%WINDIR%\post-thaw-script.bat

/usr/sbin/pre-freeze-script /usr/sbin/pre-freeze-script
/usr/sbin/post-thaw-script /usr/sbin/post-thaw-script

All custom scripts placed in the backupScripts.d directory will be analyzed during both the pre-freeze AND post-
thaw events. This means that logic needs to be placed in the script so that the desired result is gained. If no “IF’
statements are contained in the scripts, they will be executed during both the pre-freeze and post-thaw events,
which could be undesirable.

A script should contain statements similar to the following:


IF “%1%” == “freeze” goto doFreeze
goto postThaw

:postThaw
IF “%1%” == “thaw goto doThaw
goto fail

:doFreeze
net stop mysql
goto EOF

:doThaw
net start mysql
goto EOF

:fail
echo “$ERRORLEVEL% >> vcbError.txt

:EOF

David Convery Pg. 6 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
2.5 VCB Commands
Command Purpose

vcbMounter • VM mount utility

• Primary VCB command to initiate a VM snapshot to export a VM for full backup


(type:fullvm) or mounting VM disks for file-level access and backup (type:file)

mountvm • VMDK mount utility

• Search for VMs visible to VCB proxy and obtain basic VM identification information

vcbSanDbg • SAN Troubleshooting Utiltiy

• Use to display path information to the VMFS data stores on the VCB Proxy

vcbSupport • Creates a support bundle

• Use to create a zipped bundle of log files to submit to support

vcbVmName • VM locator utility


• Search for VMs visible to VCB proxy and obtain basic VM identification information

vcbSnapshot • VM snapshot utility


• Create, delete, find, or get properties of VCB VM snapshots
vcbExport • VM disk export utility
• Export a virtual disk from VM snapshot
vcbCleanup • Perform cleanups after failed backup jobs

The vcbMounter utility is invoked by the backup software integration kit. The integration kit is a zipped set of
scripts used to act as a bridge between the backup software and the VCB Framework. The vcbMounter utiltiy will
create a VM snapshot and export the VM to the VCB proxy. This utility will be reviewed in detail later.
The mountvm utility is useful for mounting VMDK files. This utility can be invoked for file level restores of FullVM
backups.
The vcbSanDbg utility will show you identification information about all of the mass storage attached to the VCB
Proxy. It will indicate weather the disk contains a VMFS partition and will also report its UUID.
The vcbSupport utility will capture the output of the vcbSanDbg utility along with the logs and system info of the
VCB proxy. This should be gathered and uploaded to the support web site if an issue arises and support is
needed.
The vcbVmName utiltiy is useful for troubleshooting “VM not found” types of errors. It will report identification
information about VMs, such as UUID and MOREF.
The vcbSnapshot and vcbExport utilities will give more granular control of the process if required.
The vcbCleanup utility is a script that will unmount VMs and delete snapshots. It is useful for cleaning up after
failed backup jobs.

David Convery Pg. 7 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
2.5.1 vcbMounter Command Syntax
Usage:
vcbMounter -h <url> -u <username> [-p <password>] <operation> [<mode>]
[<verbosity>]
<url> := <hostname>[":"<port>]
<operation> := <mount_op> | <file_umount_op> | <auto_umount_op>
<verbosity> := -L (0-6)
<mode> := -m "cos"|"nbd"|"nbdssl"
<mount_op> := -a <VM> <mountPoint> [<flavor>][<datastores>]
<file_umount_op> := -d <VM> <SsId> <mountPoint>
<auto_umount_op> := -U <mountpoint_dir>

<VM> := <moref>|<uuid>|<ipaddr>|<...> [-c <cacheFile>]


(See VM Backup guide for complete list of search
criteria.)
<mountPoint> := -r <dir>
<flavor> := -t "fullvm"
<datastores> := -C <datastore_catalog_file>
<SsId> := -n "ssid:"<Sdk-MoRef>
<export-flags> := -M (0|1) -F (0|1)

vcbMounter is invoked by the integration module. It is a component of the VCB Framework.


The command line switches “-h” “-u” and “-p” are always required. They designate the host (Virtual Center, ESX
or ESXi), user and password, respectively. Default port is 443 if not specified.
The <operation> is mount (-a), unmount (-d) or auto_unmount (-U). Using the auto_unmount method is easiest.
You just need to specify the mount point. A catalog file within the mount point will provide all of the required
information.
The <verbosity> designation is useful for troubleshooting. Setting this to level 6 creates a verbose log.
When performing a mount operation, you must specify the VM by ipaddr, uuid, or moref. The ipaddr flag is used
with the integration kit. When using the ipaddr flag, specify either the IP address or FQDN. When using the
ipaddr:fqdn method, the VM must have been powered on with Vmware tools active at least once.
Specify a mount point after the –r switch. This will need to have sufficient space to accommodate all of the files
associated with a VM if you plan on performing a FullVM backup.
Mode switches:
The mode switches can be san, nbd, nbdssl, hotadd or cos. The differences between these modes is explained in
the next section.
Export Flags:
-M: If set, the disk is exported into a single (monolithic) file. When turned off (default), the disk is split into multiple
2GB files.
-F: If set, the disk is exported as "flat" disk, with no optimizations. When turned off (default), the exported disk
files will be more compact as unused space in the disk image is not included in the exported file.

David Convery Pg. 8 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
The examples given here are to backup VMs on a SAN attached VMFS LUN that is accessible from the VCB
Proxy. The vcbMounter command can also be run from the service console.

Perform a FullVM Backup:


vcbmounter -h vc01.fqdn.com -u VCBUser -p pass -a ipaddr:vm.fqdn.com -r E:\mnt\ -t fullvm -m san
-h hostname of VirtualCenter or ESX Server
-u username with sufficient rights to perfrom backup
-p password
-a ipaddr for IP address or FQDN of Virtual Machine
-a moref for MOREF of Virtual Machine
-r VCB Mount Point
-t FullVM or File
-m SAN
Additional Options:
-M 1 (capital M) for monolithic VMDK instead of sparse (slower copy,)

Perform a File Level Backup:


vcbmounter -h vc01.fqdn.com -u VCBUser -p pass -a ipaddr:vm.fqdn.com -r E:\mnt\ -t file -m san

Unmount the VM:


vcbmounter -h vc01.fqdn.com -u VCBUser -p pass -U E:\mnt\

NOTE: the second –U is a capital U.

David Convery Pg. 9 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
2.6 VCB Modes
Connectivity is determined by using the -m "san“|”nbd”|”nbdssl”|”hotadd”|”cos” option in vcbMounter
The following options exist:
san (for SAN mode) - Back up virtual disk files residing on a shared Fibre Channel or iSCSI storage
device.
o PROS: Very efficient. No load on VM resources. No load on Management Network. Can be a VM
for iSCSI SANs.
o CONS: Requires a Fibre Channel or iSCSI SAN. Requires a physical machine for FC SANs.
Requires significant disk space for FullVM backups.
nbd or nbdssl (for LAN mode) - Use one of the following options to back up virtual disk files residing on a
storage device accessed through the Network Block Device (NBD) protocol.
o PROS: No Load on VM resources. Can be a VM. Does not require an expensive SAN. Can
backup VMs on local VMFS.
o CONS: Less efficient. Load on Management Network can cause false outages in HA
configuration.
nbd - Select if you do not need to encrypt the virtual disk data transfer.
nbdssl - Select to encrypt virtual disk data for over‐the‐network transfers. Also, you may want to
enable SSL certificate verification.
hotadd - Back up virtual disk files on any shared storage or local storage through the VCB proxy virtual
machine.
o PROS: Efficient. No load on VM resources. No load on Management Network. Works with Fibre
Channel, iSCSI, NFS and local VMFS. Uses ESX I/O stack to move data.
o CONS: Requires configuration of a “helper” VM. Uses ESX I/O stack to move data.
NOTE: If you use Consolidated Backup in the Hot‐Add mode, you need to create a shadow virtual
machine for Consolidated Backup to use internally. The shadow virtual machine has the same name
as your virtual VCB proxy with the VCB-HELPER suffix added. For example, if the name of your VCB
proxy virtual machine is BackupProxy, the shadow virtual machine should be named
BackupProxy(VCB_HELPER).

cos - Use this option to back up virtual machines whose disks are accessible to the ESX Server host
directly through /vmfs/volumes. Run the vcbMounter utility in the service console of the ESX Server host
where the virtual machines reside or on any ESX Server host which has access to the datastore where
the virtual machine disks are stored.

David Convery Pg. 10 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
2.7 Disk Export Flags
The disk export flags specify the properties of the exported disk (VMDK) files:
Monolithic: If set as “-M 1”, the disk is exported into a single (monolithic) file. When turned off (default),
the disk is split into multiple 2GB files. The 2GB files are copied slightly faster. However, the monolithic
disk files may be required depending on your backup methods. The spit files should only be used if you
plan to use VMware Converter to recover your VMs.
Flat: If set as “-F 1”, the disk is exported as "flat" disk, with no optimizations. When turned off (default),
the exported disk files will be more compact as unused space in the disk image is not included in the
exported file. If the flag is not set and your backup method is such that VMware Converter cannot be used
to recover your VMs, the vmkfstools utility will be required to uncompress the file before attaching it to a
VM.

NOTE: The compact disk format will copy only “non-zeroed” disk space. In normal file system operations, a
“deleted” file is not really deleted. Only the pointers to the file are actually removed. In order to fully remove the
files, a utility that performs secure deletes, like “sdelete” will need to be run to “zero” the free space.

Duncan Epping posted an article about how to script this in his blog:
http://www.yellow-bricks.com/2008/01/04/vmware-consolidated-backup-and-deleted-files/
He also posted an article on how to run the script using the vmrun utility in his blog:
http://www.yellow-bricks.com/2008/12/12/zero-out-all-vms-from-just-one-script/

David Convery Pg. 11 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
3. Installation Sequence
The installation steps should be followed in order to ensure a proper deployment. DO NOT ATTACH THE VMFS
OR RDM LUNS UNTIL INDICATED IN THE INSTALLATION STEPS OR DATA LOSS COULD OCCUR.

3.1 System Requirements


The VCB Proxy will experience high disk I/O during backup operations. Because of this the VCB Proxy should be
sized properly. For a sizing exercise, refer to the VMworld 2008 Breakout Session “BC2497 - VMware
Consolidated Backup: Report from the Trenches”.
The VCB Proxy system needs to be a Windows 2003 SP1 or SP2 server. Windows 2008 is experimentally
supported. Windows 2003 Enterprise Edition is recommended to allow for additional RAM.
The VCB Proxy will also need sufficient disk space (preferably SAN attached) to use as a staging area or “holding
tank”. This disk space will be used to hold files from full VM backups.
Please refer to Appendix A for VCB Proxy Server architecture design considerations.

3.2 Setting up VMware Tools


If you did not perform a “Complete” install of VMware Tools, the sync driver may not have been installed properly.
Further, if you are running ESX 3.5U2, the new VSS driver may not have installed. In the Virtual Machines that
you want to back up, start the VMware Tools installer.

Select Modify and click Next.

Make sure Filesystem Sync Driver and Volume


Shadow Copy Services Support are enabled and
click Next. After the installation completes, a reboot is
required.

David Convery Pg. 12 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
3.3 Create a VCB User
Create a VMBackup user account on the in Active Directory (preferred) or locally on the vCenter server.
Use the VCB Backup User Role in VC 2.5 or apply the following privileges:
 VirtualMachine > Configuration > Disk Lease
 VirtualMachine > State > Create Snapshot
 VirtualMachine > State > Remove Snapshot
 VirtualMachine > Provisioning > Allow Virtual Machine Download
 Virtual Machine > Provisioning > Allow Read‐only Disk Access

For Hot-Add mode, the following privileges will also be required:


 Datastore > Browse Datastore
 Virtual Machine > Configuration > Add Existing Disk
 Virtual Machine > Configuration > Remove Disk
 Virtual Machine > Configuration > Change Resource

3.4 Pre-Configuring the VCB Proxy


Use the following steps to configure the VCB Proxy prior to installing the VCB Framework.
NOTE: The VMFS and RDM LUNs that will be backed up should not be attached to the VCB Proxy until the
pre-configuration steps are taken. Failure to follow these steps could result in loss of data, especially on NTFS
RDMs.

3.4.1 Disable automatic drive letter assignment

From the start menu, select “run” and enter diskpart.


Run the automount disable command to disable automatic drive letter assignment.
Run the automount scrub command to clean any registry entries pertaining to previously mounted
volumes.

David Convery Pg. 13 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup

3.4.2 Enable Unsigned Driver Installation

Right-click on My Computer and select Properties.


Click on the Hardware tab and then click the Driver
Signing button.

Select Warn and click OK.

Reboot the server.

David Convery Pg. 14 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
3.5 Install the Backup Software
Install the backup software and any required hotfixes or patches as directed by the Vendor’s documentation.

3.6 Install the VCB Framework

Download and run the latest VCB Framework installer.

Accept the EULA and click Next.

Choose the installation path and click Next.

David Convery Pg. 15 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup

Click Install.

When prompted to install the VMware Virtual Volume


Storage Bus, Click Yes.

When the installation completes, click Finish.

David Convery Pg. 16 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
3.7 Install the Integration Kit
Newer backup software versions may include direct integration with VCB. If that is the case, the integration kit is
not required. Integration kits are available for the following supported backup software:
EMC\Legato Networker
Tivoli Storage Manager
Symantec BackupExec
Symantec NetBackup
If an integration kit is required, download and unzip the integration kit to the %PROGRAMS%/VMware/VMware
Consolidated Backup Framework directory. This will result in the integration scripts being located in the proper
%PROGRAMS%/VMware/VMware Consolidated Backup Framework\???? directory. Included in the zip file is
a README-???.html file. This file will give instructions for using the proper integration kit with the supported
backup software. Typically, an install.bat file will be used to configure the integration kit.

3.8 Install VMware Converter


Download and install the latest version of VMware Converter. This will be used for restoring FullVM backups.

3.9 Attach the LUNs


Shutdown the server, configure any VMFS or RDM LUNs that will be backed up to be accessible to the VCB
Proxy by setting up SAN zoning and LUN masking. Do NOT set the LUNs as read only. The Virtual LUN driver
will mount VMFS LUNs as read only. If prompted to select an OS type for the host, select the same settings you
used for the VMware ESX (or ESXi) servers.

Restart the server. Open up the disk management console and verify that you see the LUNs as unknown
devices.

David Convery Pg. 17 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
4. System Configuration
4.1 Password Security
The config.js file is a plain-text file and could potentially contain username and password information for a service
account with access to other systems. Originally the only method was to provide security using file permissions
and limit the user privileges within vCenter. Version 1.5 introduces two methods for providing a more secure
credential facility.
The first is by moving the password information to the registry. If a username, but no password is specified in the
config.js file, VCB will check the following registry key for a password:
On x86: HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware Consolidated Backup\Password
On x64: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\VMware, Inc.\VMware Consolidated Backup\Password
If no password is specified in the registry, VCB will prompt for the password.

The second is by using the “Security Support Provider Interface” (SSPI). The advantage of SSPI is that it does not
require to be specified in a plain text file or in the registry. In order to use SSPI, the following conditions must be
met:
The HOST specification must point to a vCenter Server and not an ESX Server.
The backup software services that call the VCB Framework must use user credentials that reside on both
the VCB and the vCenter Servers (with identical passwords) or it must be a domain account.
The user account must have administrator privileges on the VCB Proxy and at least VMware
Consolidated Backup user privileges in vCenter.

4.2 The config.js File


Use Wordpad to edit %Program Files%\VMware\VMware Consolidated Backup Framework\config\config.js
The contents of the file offer some explanations of the settings. Here are some example settings:
BACKUPROOT=“e:\\mnt";
HOST=“vc.domain.com"; FQDN of the VC server or ESX host
// PORT="443"; Previous versions used port 902
USERNAME=“_sspi_”; OR “domain\\user"
PASSWORD="XXX";
//TRANSPORT_MODE="san"; OR “nbd”, nbdssl”, “hotadd”
// LOGLEVEL=6; default is 3
//SNAPSHOT_POLICY="automatic"; or manual, createonly, deleteonly
//VM_LOOKUP_METHOD="ipaddr"; or name
//PREEXISTING_MOUNTPOINT="fail"; or delete
//PREEXISTING_VCB_SNAPSHOT="fail"; or delete
//MAX_RETRIES=0;
//BACKOFF_TIME=10; between retries

David Convery Pg. 18 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
4.2.1 Syntax
// is a comment.
\\ is required in place of \ If you need to use a backslash, it needs to be a double backslash
“ ” around all answers
; is required at the end of each line

4.3 Configure Backup Software


Backup software should be configured according to the README-????.html file directions. In short, the following
settings should be adjusted:
Incremental / differential backups based on timestamp instead of archive bit
Pre- and post-backup script timeout set to at least 30-45 minutes for FullVM backups
The backup “client” will be specified as the VCB Proxy server

For file level backups, the files to be backed up will be under the mount point. In this example, the files will be
mounted as “E:\mnt\vm-fqdn.com\letters\C” and “E:\mnt\vm-fqdn.com\letters\E”.

For FullVM backups, the mount point is specified with the VM FQDN and a “-FullVM” suffix. In this example, it will
be E:\mnt\vm-fqdn.com-FullVM

David Convery Pg. 19 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
5. Backing Up VMs
5.1 FullVM Type Backups

1. Open a cmd prompt and change directory to


the VCB Framework installation path
(“C:\Program Files\VMware\VMware
Consolidated Backup Framework”).
2. Use the vcbMounter.exe utility to perform a
backup.
The syntax is:
vcbMounter.exe –h <hostname> -u <user> -p
<password> -a ipaddr:<VM FQDN> -r <mount point> -t
<Type> -m <mode>

The <hostname> should be the IP address or


FQDN of the vCenter server or ESX server. If
the VMs reside on ESX servers in a cluster, it
must be the vCenter Server.
In this example, the command is:
vcbMounter.exe –h 192.168.141.10 –u vcbuser –p
vcbuser –a ipaddr:192.168.141.140 –r e:\mnt\testvcb
–t fullvm –m san

This command is case sensitive. In this example, the IP


address points to the vCenter Server. The path “E:\mnt”
must already exist on the VCB proxy. The “testvcb”
directory will be created by the vcbMounter utility and
should not be present.

3. The VM files will be copied to the “Holding-


Tank”.
4. When the VM copy if completed, the cmd
prompt will return. In the case of a FullVM
backup type, no “unmount” action is required.
5. The VM files will be available on the mount
point for backup to tape by the backup
software.

David Convery Pg. 20 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
5.2 File Type Backups
1. Use the vcbMounter.exe utility to perform a VM
mount.
The syntax is:
vcbMounter.exe –h <hostname> -u <user> -p
<password> -a ipaddr:<VM FQDN> -r <mount point> -t
<Type> -m <mode>

The <hostname> should be the IP address or


FQDN of the vCenter server or ESX server. If
the VMs reside on ESX servers in a cluster, it
must be the vCenter Server.
In this example, the command is:
vcbMounter.exe –h 192.168.141.10 –u vcbuser –p
vcbuser –a ipaddr:192.168.141.140 –r e:\mnt\testvcb
–t file –m san

This command is case sensitive. In this example, the IP


address point to the vCenter Server. The path “E:\mnt”
must already exist on the VCB proxy. The “w2k3VM”
directory will be created by the vcbMounter utility and
should not be present.

2. The VCB Proxy will now have access to the


files on “ <mount point>\letters\<drive letter>. In
this example, they are available on
E:\mnt\testvcb\letters\c.
3. The files are now available on the mount point
for backup to tape by the backup software.

4. Use the vcbMounter.exe utility to “unmount” the


VM files.
The syntax is:
vcbMounter.exe –h <hostname> -u <user> -p
<password> -U <mount point>

Please note that the second “-U” is capitalized


and indicates “unmount”.
In this example, the command is:
vcbMounter.exe –h 192.168.141.10 –u vcbuser –p
vcbuser –U E:\mnt\testvcb

David Convery Pg. 21 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
6. Recovering VMs and Files
The most important task that must be mastered is the ability to recover a VM or a file in case of a disaster.
Without this ability, the backups would be a waste of time. Luckily, with VMs, the task is fairly straight forward. It
does involve a few more steps when compared to recovering from a traditional, client-based backup. But you will
find that the process of recovering complete VMs will allow for shorter recover times. A recovery from a FullVM
backup is simple when compared to the process of creating a new VM, installing the OS and backup client, then
recovering the system. Even with deploying from a template, it can be a daunting task if faced with the need to
recover multiple VMs.

6.1 Recovering VMs


In a full disaster of a VM (or site) the most efficient method is to recover the VM from a FullVM backup. Use the
following process to recover a VM:

1. Restore the VM files using your backup


software.

2. Start VMware Converter.


3. Select Connect to local server.
4. Click Login.

5. Click Convert Machine.

David Convery Pg. 22 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup

6. The Conversion Wizard will start.


7. For source type, select Backup image or
third-party virtual machine.

8. Click Browse.

9. Select the .vmx file for the VM to be recovered.

10. Click Next.

11. The destination type should already be


VMware Infrastructure virtual machine.
12. Enter the IP address or FQDN for the vCenter
server.
13. Enter credentials for a user that is a member of
the Administrators Role in vCenter.
14. Click Next.

David Convery Pg. 23 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup

15. Enter the VM object name (This can be


different than the original name for testing
purposes).
16. Select a datastore and confirm that enough
free space exists.
17. Click Next.

18. Review the settings.


19. If you would like to change anything, click on
the Edit link next to that item (in this example,
we will be changing the disk size and network).
If you do not wish to make changes, skip to Step
24.

20. (Optional) To change disk size, change the


data copy type to Select volumes to copy.

21. (Optional) Under target size, select <Type size


in GB>.

David Convery Pg. 24 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup

22. (Optional) Enter the new disk size.

23. (Optional) Edit any other settings you wish to


change. In this example, we are performing a
recovery test, so we are changing the network
to avoid conflict.

24. Review the settings and click Finish.

25. You can monitor the progress in the console.

David Convery Pg. 25 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup

26. When completed, review the log highlights.


27. Your VM is now recovered and is ready to be
powered on.

6.2 Recovering Files

6.2.1 File Level Restore from FullVM Backups

1. Restore the VM files using your backup


software.

2. Open a cmd prompt and use the mountvm.exe


utility to mount the VMDK file(s).
The syntax is:
mountvm.exe –d <path to vmdk> –d <path to
vmdk> -cycleId <mount point>

In out case we are mounting a single VMDK,


so the command is:
mountvm.exe –d E:\mnt\w2k3VM-FullVM\scsi0-0-0-
w2k3.vmdk –cycleId c:\mnt\w2k3vm-disk

Note that the path “C:\mnt” must already exist.


The mountvm utility will create the “w2k3vm-
disk” directory and should not be present.

David Convery Pg. 26 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup

3. The files will be located under <mount


point>\letters\<drive letter>. In this example,
they are located under “C:\mnt\w2k3vm-
disk\letters\c”

4. Map a network drive to the target machine.


Right click on “My Computer” and select Map
Network Drive.

5. Enter the path to the target machine.


6. Uncheck Reconnect at logon.
7. If required, click the different user name link.

8. If required, enter user credentials with write


and create permissions.

9. The mapped drive will now open in Windows


Explorer.

10. Explore to the files that you wish to recover


from the <mount point>.
11. Highlight the files, then right click and select
Copy.

David Convery Pg. 27 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup

12. Use Windows Explorer to browse to the proper


directory on the target machine.
13. Right click and select Paste.

14. The files will be copied to the target location.

15. Use the mountvm.exe utility to unmount the


VMDK file(s).
The syntax is:
mountvm.exe –u <mount point>

In this example, the command is:


mountvm.exe –u C:\mnt\w2k3vm-disk

16. The mount point is now removed. If desired,


the mapped drive to the target may also be
removed.

6.2.2 Restoring from File Level Backups


1. Restore the files to the holding tank using the backup software.
2. Restore the files to the target machine by following steps 3-16 above.

David Convery Pg. 28 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
7. Appendix A - Architecture Design Considerations
7.1 Sizing Considerations
The Holding tank must be of sufficient size to accommodate all of the VMs in a backup job and allow for sufficient
staging time when finial destination is slow tape. Basically, you need enough holding tank space to accommodate
all of the VMDK files as well as space for logs, vmx, etc. Since this is just a temporary staging area or an
archiving area, tier 3 or lower end disk can be used.
For performance, consider the following:
Number of VMs
Size of VMs
Spare IOPs available per LUN
Spare Fibre Channel Capacity
Throughput to the holding tank
Fibre Channel port speed
Speed of the service processors on the switch and array
Speed of the target devices
Backup Software Tweaks
o Streaming speed to final target
o Number and Size of data buffers
o Number of simultaneous streams

7.2 SAN Connections

The diagram on the left illustrates how the BL465 should be connected to the SAN. When using blade servers, it
is important to remember that the number of HBAs is usually limited to two. Care should be taken in the way that
tape drives, staging LUNs and datastores are presented. On standard servers, multiple fibre channel adapters
should be used to create single paths to each target. An example of this is illustrated in the diagram on the right.
Since this is a backup system, plan for performance rather than redundancy, especially in a blade environment.

David Convery Pg. 29 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
7.3 Best Practices
In a SAN environment, the backup proxy server must run on a separate physical machine.
Be sure the machine you use as the backup proxy server is running a supported operating system - Windows
Server 2003 Service Pack 1 (32-bit or 64-bit) or Windows Server 2003 R2 (32-bit or 64-bit). See the VMware Web
site for the most current list of supported operating systems..
VMware recommends that you use the backup proxy server as the backup or media server for your backup
software.
Install third-party backup software appropriate for the operating system. Install 32-bit backup software on a 32-bit
operating system or 64-bit backup software on a 64-bit operating system.
Your backup software controls most data-transfer operations on the backup proxy server. Consult your backup
software vendor’s documentation for guidance on sizing and tuning the backup software for best backup
streaming speed.
Be sure to disable automatic drive letter assignment on the backup proxy server, following the detailed
instructions in the Virtual Machine Backup Guide. Failure to perform this configuration step can cause data
corruption for virtual machines using raw device mapping.
If you are using your third-party backup software to write to tape, try running multiple jobs in parallel in your
backup software supports parallel jobs. Check the backup software documentation for guidance on the number of
parallel jobs you can run with good performance.
If you are performing full image backups, or if the target to which you are writing backup data is a disk, consider
putting the target volume on your SAN rather than on a local disk. When data is coming from a relatively fast SAN
to a slower local disk, writes to the local disk become a bottleneck.
Also consider dedicating different HBAs for reading data from the VMFS and writing it to the holding tank, as
discussed in the SAN Connections section.
Be sure you configure the file config.js, following the detailed instructions in the System Configuration section.
Refer to the integration module documentation for your particular backup software for more details.
Some backup software can configure the VCB backup environment for you. If using newer versions of backup
software, the integration kit may not be required.
Make sure you monitor all backup jobs for success. If a backup job doesn’t properly finish or is aborted, you may
have left the VM in a snapshot and/or mounted state. This should be addressed as soon as you can. Usually,
running the “vcbCleanup.bat” utility will clear the mounts and the snapshots. If the snapshot cannot be deleted
using the vcbCleanup utility or VI Client, You may need to do it from the console. Using “vmware-cmd <config
file> removesnapshots”.
Create a test installation on non-production systems first. Make sure you can consistently backup AND
RECOVER files and VMs.
When you perform a first backup for a virtual machine, the virtual machine has to be powered on, otherwise the
backup fails.
When installing VMware Tools perform a “COMPLETE” install or the sync drivers are skipped (3.5U1 and earlier)
A driver signing policy of “Do Not Allow Installation” will result in failed disk mounts.

David Convery Pg. 30 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
8. Appendix B - Troubleshooting
8.1 Four steps to effective troubleshooting
• Check Obvious Entries in LOGS
• Use a Search Engine
• Search or Post on VMTN Communities
• Start a Support request on line and post the vcbSupport bundle
• http://support.vmware.com/selfsupport/

8.2 Troubleshooting Methods


When you perform a first backup for a virtual machine, the virtual machine has to be powered on, otherwise the
backup fails.
When installing VMware Tools perform a “COMPLETE” install or the sync drivers are skipped (3.5U1 and earlier)
A driver signing policy of “Do Not Allow Installation” will result in failed disk mounts.

Using the “-L 6” option will produce more robust logs. This can also be set in config.js as LOGLEVEL=“6”;
vcbmounter -h vc01.fqdn.com -u VCBUser -p pass -a ipaddr:vm.fqdn.com -r E:\mnt\ -t fullvm -m san –L 6
vcbmounter -h vc01.fqdn.com -u VCBUser -p pass -a ipaddr:vm.fqdn.com -r E:\mnt\ -t file -m san –L 6

Check The Logs:


 vmount service logs are usually in C:\WINDOWS\Temp (%TEMP) called vmware-vmount[*].log
 You can look at vstor log files for the vLUN's in C:\WINDOWS\Temp called vmware-vlun[*].log

Use vcbSanDbg for a quick view of the SAN from a VCB perspective. Look for:
“warning Could not scan for partitions on device. No VMFS names will be associated with this device.”
“info Lun does not contain any VMFS/LVM signatures.”

Use vcbSupport to generate a set of log files for submission to VMware Support or for your own analysis.

David Convery Pg. 31 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
9. Appendix C - Using VCB in a VM with Hot-Add mode
When version 1.5 was introduced, the ability to run VCB in a VM using “Hot-Add” mode was introduced. This
allows you to leverage VCB for any datastore, without the need for a physical machine or a SAN connection. In
contrast to the “NBD” and “NBDSSL” modes, which use the Management Network to perform backups, “Hot-Add”
mode uses the hypervisor I/O stack. It does this by creating linked clones to the source VM disks after the
snapshot is created. These linked clones are attached to a “Helper VM” and then backed up.
Hopefully, this section will clarify the requirements and process for using VCB in Hot-Add mode.

9.1 Requirements for Hot-Add Mode


In addition to the system requirements for VCB in general, the use of “Hot-Add” mode presents additional
requirements:
The VM running VCB must reside on an ESX server with access to all datastores that contain VMs to be
backed up. In the case of local datastores, a VCB Proxy will be required on each ESX server with a local
datastore containing VMs to be backed up.
For FullVM type backups, sufficient disk space is required in the “Holding Tank” to accommodate the VM
files.
A “Helper VM” must be created with the same access conditions outlined above. The helper VM should
be configured as follows:
o Create a blank VM, with the same VM name as the VCB Proxy with “(VCB-HELPER)” appended
to the name. For example, if the VCB Proxy VM is named “BackupProxy”, the helper VM should
be named “BackupProxy(VCB-HELPER)”.
o No operating system is required.
o No vDisks are required.
The VMware Consolidated Backup Role should have the following privileges added:
o Datastore > Browse Datastore
o Virtual Machine > Configuration > Add Existing Disk
o Virtual Machine > Configuration > Remove Disk
o Virtual Machine > Configuration > Change Resource

9.2 Setting Up a VCB Proxy for Hot-Add Mode


The following outlines the steps required to set up VCB for Hot-Add mode:

1. Create a Windows 2003 VM and install the VCB Framework as outlined in Section 3.

2. Create a new, blank VM as outlined above.

David Convery Pg. 32 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
9.3 Using VCB in Hot-Add Mode

9.3.1 FullVM type backup


6. Open a cmd prompt and change directory to
the VCB Framework installation path
(“C:\Program Files\VMware\VMware
Consolidated Backup Framework”).
7. Use the vcbMounter.exe utility to perform a
backup.
The syntax is:
vcbMounter.exe –h <hostname> -u <user> -p
<password> -a name:<VM Name> -r <mount point> -t
<Type> -m hotadd

The <hostname> should be the IP address or


FQDN of the vCenter server or ESX server. If
the VMs reside on ESX servers in a cluster, it
must be the vCenter Server.
In this example, the command is:
vcbMounter.exe –h 192.168.141.10 –u username –p
password –a name:w2k3VM –r E:\mnt\w2k3VM –t fullvm
–m hotadd

This command is case sensitive. In this


example, the IP address point to the vCenter
Server. The path “E:\mnt” must already exist
on the VCB proxy. The “w2k3VM” directory will
be created by the vcbMounter utility and
should not be present.

8. Several tasks will appear in vCenter under


Recent Tasks.

9. The VM files will be copied to the “Holding-


Tank”.
10. When the VM copy if completed, the cmd
prompt will return. In the case of a FullVM
backup type, no “unmount” action is required

David Convery Pg. 33 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup

11. The VM files will be available on the mount


point for backup to tape by the backup
software.

9.3.2 File type backup


1. Use the vcbMounter.exe utility to perform a
VM mount.
The syntax is:
vcbMounter.exe –h <hostname> -u <user> -p
<password> -a name:<VM Name> -r <mount point> -t
<Type> -m hotadd

The <hostname> should be the IP address or


FQDN of the vCenter server or ESX server. If
the VMs reside on ESX servers in a cluster, it
must be the vCenter Server.
In this example, the command is:
vcbMounter.exe –h 192.168.141.10 –u username –p
password –a name:w2k3VM –r E:\mnt\w2k3VM –t file –
m hotadd

This command is case sensitive. In this example, the


IP address points to the vCenter Server. The path
“E:\mnt” must already exist on the VCB proxy. The
“w2k3VM” directory will be created by the vcbMounter
utility and should not be present.

2. The VCB Proxy will now have access to the


files on “ <mount point>\letters\<drive letter>.
In this example, they are available on
E:\mnt\w2k3vm\letters\c.
3. The files are now available on the mount point
for backup to tape by the backup software.

David Convery Pg. 34 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
4. Use the vcbMounter.exe utility to “unmount”
the VM files.
The syntax is:
vcbMounter.exe –h <hostname> -u <user> -p
<password> -U <mount point>

Please note that the second “-U” is capitalized


and indicates “unmount”.
In this example, the command is:
vcbMounter.exe –h 192.168.141.10 –u username –p
password –U E:\mnt\w2k3VM

5. The VM files will be removed from the <mount


point>.

David Convery Pg. 35 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
10. Appendix D - Performing FullVM Backups on Selected VM Disks
In some cases, performing FullVM type backups on selected virtual disks may be desired. A good example is a
file server with a large data drive. For DR purposes, you want to take an image backup of the C: drive to capture
the system state. But, the data drive is large and image level backups are impractical, so you will take file level
backups. There are a few methods to accomplish this and they are explained below.

10.1 Data Drive Using an RDM in Physical Compatibility Mode


In this scenario, your VM uses a VMDK for the C: drive and an RDM in physical compatibility mode for the data
drive. With VCB 1.5, an RDM in physical compatibility mode is ignored. This is because a snapshot cannot be
taken of the disk. This allows the generic framework settings to be leveraged for all backup methods. There are a
few methods of backing up in this scenario:

10.1.1 VCB FullVM Type Backup with SAN-Based Data Backup


For this, the C: drive is backed up with VCB at an image level. File level backups of the data drive are completed
using a SAN-based mirror or snapshot of the LUN. A good example of mirroring is EMC Timefinder or Mirror
Clones on an HP EVA. A backup is made of the mirror or snapshot using tools provided by the array vendor.
PROS:
o No backup client required in the VM
o Easy recovery
o LAN-Free backup (For SAN and Hot-Add mode)
CONS:
o Cost of array based backup tools
o Complex backup scripts required for SAN based mirroring or snapshots

10.1.2 VCB FullVM Type Backup with Client Based Data Backup
For this, the C: drive is backed up with VCB at an image level. File level backups of the data drive are completed
using a backup client.
PROS:
o Easy backup and recovery
o No array-based tools required
CONS:
o Backup client required
o Requires network bandwidth for client-based backups
o Relatively longer backup times

David Convery Pg. 36 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
10.2 Data Drive Using and RDM in Virtual Compatibility Mode or a VMDK
In this scenario, your VM uses a VMDK for the C: drive and an RDM in virtual compatibility mode or a VMDK for
the data drive. This allows VCB to create a snapshot of the data drive and leverage VCB file level backups. Since
a FullVM type backup of the data drive is not desired, the vcbSnapshot and vcbExport utilities will need to be
used to back up specific drives. The file type backups can selectively back up files from the data drive by
specifying the appropriate mount point in the backup software. The process is described in Section 10.3.

10.2.1 Mixed VCB FullVM Type and File Type Backup Methods
The vcbVmName, vcbSnapshot and vcbExport utilities are used to perform a FullVM type backup of the C: drive.
The vcbExport utility is used to back up the files on the data drive. The backup software is set up to backup files in
the <Mount Point>\letters\d directory, or to the drive letter that points to the data drive.
PROS
o No backup client required in the VM
o LAN-Free backup (For SAN and Hot-Add mode)
o No array-based tools required
CONS
o Complex backup scripts required
o The VMX and Catalog files are not created
o Manual recovery process
It is important to note that this process will not export the VMX file or a catalog file. These files are required by
VMware Converter to import the VM back into vCenter or an ESX server. In order to recover using the VM from a
backup using this method is to copy the VMDK manually into the datastore using scp. A new VM will need to be
created and pointed to the VMDK file. An alternative would be to use scp and manually copy the VMX and VMXF
files to the VCB proxy.

David Convery Pg. 37 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
10.3 Performing FullVM Type Backups on Selected Disks
The process for performing FullVM type backups of selected disks requires the use of the vcbVmName,
vcbSnapshot and vcbExport utilities. It is a straight-forward process when done manually:

1. Use the vcbVmName.exe utility to query for


information about a VM.
The syntax is:
vcbVmName.exe –h <hostname> -u <user> -p <password>
-s name:<VM Name>

The <hostname> should be the IP address or


FQDN of the vCenter server or ESX server. If
the VMs reside on ESX servers in a cluster, it
must be the vCenter Server.
In this example, the command is:
vcbVmName.exe –h 192.168.141.10 –u username –p
password –s name:w2k3VM

This command is case sensitive. In this example, the IP


address points to the vCenter Server. We are querying
for information about the VM object named “w2k3VM”.
The “moref”(vm-18) is required for the vcbSnapshot
utility.

2. Use the vcbSnapshot.exe utility to quiesce I/O


and perform a VM snapshot.
The syntax is:
vcbSnapshot.exe –h <hostname> -u <user> -p
<password> -c moref:<SDK-MoRef>

The <hostname> should be the IP address or


FQDN of the vCenter server or ESX server. If
the VMs reside on ESX servers in a cluster, it
must be the vCenter Server. The <SDK-
MoRef> comes from the vcbVmName utility.
In this example, the command is:
vcbSnapshot.exe –h 192.168.141.10 –u username –p
password –c moref:vm-18

This command is case sensitive. In this example, the IP


address points to the vCenter Server. The MoRef of the
VM is “vm-18”. You will notice that, after the snapshot
is created, a Snapshot ID (SsId) is returned. In this
case, it is snapshot-178. This will be required for the
next command.

David Convery Pg. 38 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
3. Use the vcbSnapshot.exe utility again to query
for information about the VM snapshot that was
just taken.
The syntax is:
vcbSnapshot.exe –h <hostname> -u <user> -p
<password> -l moref:<SDK-MoRef> ssid:<SsId>

The <hostname> should be the IP address or


FQDN of the vCenter server or ESX server. If
the VMs reside on ESX servers in a cluster, it
must be the vCenter Server. The <SDK-
MoRef> comes from the vcbVmName utility.
The <SsId> comes from the previous
command.
In this example, the command is:
vcbSnapshot.exe –h 192.168.141.10 –u username –p
password –l moref:vm-18 ssid:snapshot-178

This command is case sensitive. In this example, the IP


address points to the vCenter Server. The MoRef of the
VM is “vm-18”. The Snapshot ID is “snapshot-178”.You
will notice that the paths to the VMDK files are listed.
The disk with the SCSI0.0 designation is the C: drive
for this VM and will be required for the next command.
scsi0.0:[iSCSI_Volume] w2k3VM/w2k3VM.vmdk

David Convery Pg. 39 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
4. Use the vcbExport.exe utility to export the
VMDK file to the <mount point>.
The syntax is:
vcbExport.exe -d <mountpoint>/directory/filename –s
blklst://<SsId>/<Path to VMDK>@<hostname>?
<user>/<password>

The <mountpoint>/directory is the location on


the VCB proxy for the VMDK File. The <SsId>
is the Snapshot ID and <Path to VMDK> is the
path from the previous command. The
<hostname> should be the IP address or
FQDN of the vCenter server or ESX server. If
the VMs reside on ESX servers in a cluster, it
must be the vCenter Server.
In this example, the command is:
vcbExport.exe -d E:\mnt\w2k3VM-
Selective\w2k3VM.vmdk –s blklst://Snapshot-
178/[iSCSI_Volume] w2k3VM/w2k3VM.vmdk @
192.168.141.10?username/password –M 1

This command is case sensitive. In this example, the IP


address points to the vCenter Server. We are exporting
the w2k3VM.vmdk file. This information is acquired
from the previous command. The “-M 1” export flag is
required, but not shown in the screen shot. This is
required to produce a monolithic, single file backup of
the disk. Using the “-M 1” flag will allow for
uncompressing the VMDK using the vmkfstools utility in
ESX server. If you are using ESXi server, then you
must also include the “-F 1” flag so the disk is not
compressed because the vmkfstools utility is not
available on ESXi server.

5. Once the export is competed, the cmd prompt


is returned.

David Convery Pg. 40 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
6. Use the vcbSnapshot.exe utility one last time to
commit all disk writes from the delta and delete
the snapshot.
The syntax is:
vcbSnapshot.exe –h <hostname> -u <user> -p
<password> -d moref:<SDK-MoRef> ssid:<SsId>

The <hostname> should be the IP address or


FQDN of the vCenter server or ESX server. If
the VMs reside on ESX servers in a cluster, it
must be the vCenter Server. The <SDK-
MoRef> comes from the vcbVmName utility.
The <SsId> comes from the previous
command.
In this example, the command is:
vcbSnapshot.exe –h 192.168.141.10 –u username –p
password –d moref:vm-18 ssid:snapshot-178

This command is case sensitive. In this example, the IP


address points to the vCenter Server. The MoRef of the
VM is “vm-18”. The Snapshot ID is “snapshot-178”.
Once the snapshot is deleted, the cmd prompt will be
returned.

The steps outlined above could be placed into a script that is called by the backup software. A script written in
VBS was posted by Justin Turver on his VMware blog:
http://communities.vmware.com/blogs/jturver/2008/01/24/vcb-how-to-backup-a-selected-specific-disk-or-disks-
using-vcbexport-and-a-useful-script-to-do-it
The original script will exit on any error, so SSL certificate verification must be set up in ESX 3.5. See the VM
Backup Guide page 42 for information about setting this up. There is a modified script posted that suppresses
some of these errors.

David Convery Pg. 41 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
11. Appendix E - Sample Backup Scripts
VMware supports several different brands and versions of backup software with their integration kits. But these do
not allow any backup software to integrate with VCB. A “generic” integration is included with the VCB Framework,
but is not well documented. The examples below will allow you to use VCB with any backup software that
supports pre- and post- backup scripting.
NOTE: The generic framework uses the “ipaddr” lookup method and requires that you use either the FQDN or IP
address of the VM. If this method is used, forward, reverse, long name and short name lookup must be set up
properly in DNS. This can be changed to use the VM object name by editing the config.js file as outlined in
Section 4.

11.1 Generic FullVM Backup Scripts


11.1.1 Generic FullVM Pre-Backup Script
The backup software will need to be configured to call a pre-backup script. Sufficient time must be allowed for a
FullVM type backup because of the time it takes to copy the VM to the Holding Tank. A valid script would look like
this:
cd "C:\Program Files\VMware\VMware Consolidated Backup Framework\generic"
cscript pre-command.wsf "C:\Program Files\VMware\VMware Consolidated Backup Framework" %1 fullvm

The mount point in this script will become the mount point specified in the config.js file, appended by the VM
name and “-FullVM”. For example, if the mount point specified in the config.js file is “E:\mnt” and the VM name is
“vm.fqdn.com” the location for the VM files will be “E:\mnt\vm.fqdn.com-FullVM” In this example, the “%1” variable
would represent the FQDN of the VM to be backed up. The contents could be placed in a simple .cmd file and the
pre-command would look like this:
Pre-FullVM.cmd vm.fqdn.com

11.1.2 Generic FullVM Post-Backup Script


Although a post-backup script is not required to unmount the VM or delete the snapshot, it may be useful to delete
the VM files after they are archived to tape. This would apply if there is not enough disk space in the Holding Tank
to hold all of the backup files. If the post-backup script is not invoked, the VM files will remain in the Holding Tank
until manually deleted. This may be appropriate for a backup to disk scenario, to allow for faster recovery times.
The post script to delete the files would look like this:
cd "C:\Program Files\VMware\VMware Consolidated Backup Framework\generic"
cscript post-command.wsf "C:\Program Files\VMware\VMware Consolidated Backup Framework" %1-fullvm

11.2 Generic File Level Backup Scripts


11.2.1 Generic File Level Pre-Backup Script
A generic pre-backup script for file level backups would look like this:
C:
cd "C:\Program Files\VMware\VMware Consolidated Backup Framework\generic"
cscript pre-command.wsf "C:\Program Files\VMware\VMware Consolidated Backup Framework" %1 file

11.2.2 Generic File Level Post-Backup Script


A generic post-backup script is required after the files are copied to tape because the files must be unmounted
and the snapshot must be deleted. The script would look like this:
cd "C:\Program Files\VMware\VMware Consolidated Backup Framework\generic"
cscript post-command.wsf "C:\Program Files\VMware\VMware Consolidated Backup Framework" %1

David Convery Pg. 42 of 43 Version 2 Revised 14 March 2009


Setting Up VMware Consolidated Backup
12. Appendix F - Reference Documents
VMware Consolidated Backup Framework Version 1.5 Release Notes
http://www.vmware.com/support/vi3/doc/vi3_vcb15_rel_notes.html
Virtual Machine Backup Guide
http://www.vmware.com/pdf/vi3_35/esx_3/r35u2/vi3_35_25_u2_vm_backup.pdf

Systems Compatibility Guide for ESX Server 3.x http://www.vmware.com/pdf/vi3_systems_guide.pdf


I/O Compatibility Guide for ESX Server 3.x http://www.vmware.com/pdf/vi3_io_guide.pdf
Storage/SAN Compatibility Guide for ESX Server 3.x http://www.vmware.com/pdf/vi3_san_guide.pdf
Configuration Maximums for VMware Infrastructure 3
http://www.vmware.com/pdf/vi3_35/esx_3/r35u2/vi3_35_25_u2_config_max.pdf
Installation and Upgrade Guide
http://www.vmware.com/pdf/vi3_35/esx_3/r35u2/vi3_35_25_u2_installation_guide.pdf
http://www.vmware.com/pdf/vi3_35/esx_3/r35u2/vi3_35_25_u2_upgrade_guide.pdf
SAN System Design and Deployment Guides http://www.vmware.com/pdf/vi3_san_design_deploy.pdf
SAN Config Guide http://www.vmware.com/pdf/vi3_35/esx_3/r35u2/vi3_35_25_u2_san_cfg.pdf
http://www.vmware.com/pdf/vi3_35/esx_3/r35u2/vi3_35_25_u2_iscsi_san_cfg.pdf
VCB Best Practices Whitepaper http://www.vmware.com/files/pdf/vcb_best_practices.pdf
VMware Converter Release Notes
http://www.vmware.com/support/converter/doc/releasenotes_conv40.html
http://www.vmware.com/support/converter/doc/releasenotes_conv303.html
VMware Converter User Guide http://www.vmware.com/pdf/VMware_Converter_Standalone_guide40.pdf

David Convery Pg. 43 of 43 Version 2 Revised 14 March 2009