Friday, September 19, 2008

VCB basic usage - VM full backup with vcbMounter

Let's choose the virtual machine called vcb-backup and perform its backup. Before we proceed, we should stop to explain that VCB is capable of doing two types of backup:
  1. full backup
  2. file-level backup
The file-level backup is available for Windows operating systems only. The full backup means to backup virtual machine images. You can use it with every type of virtual machine.

Next thing, we need to remember to choose the right transport mode:
  1. SAN mode - bypassing VCB proxy via FC or iSCSI SAN (LAN-free backup)
  2. Hot-Add mode - VCB proxy in a virtual machine
  3. LAN mode - backup over LAN network
In SAN mode, both ESX host and VCB proxy has to have access to the shared storage. The backup is completely offloaded from the ESX host which provides virtual machine disks and their snapshots only. The whole process is moved to the VCB proxy which reads disks directly from the SAN. The Hot-Add mode is interesting in that way, it is able to access virtual machine disks directly but without the SAN. If the VCB proxy is virtualized, it is hot added virtual machine disks. Nothing suprising, VMware ESX is capable of hot-adding disks to a virtual machine. The drawback is that you need to have one virtualized VCB proxy on each ESX host so that it can backup all virtual machines hosted on them. The LAN mode uses network protocols to access the virtual machine disks. By the way, the SAN mode is supported by VCB and VMware ESX natively. The remaining two modes requires VMware ESX(i) 3.5 or later.

The vcbmounter command is used for virtual machine backup. The following command will initiate a full backup of vcb-backup virtual machine in LAN mode:
vcbmounter -h VC_IP -u VC_USER -p VC_PASS -a name:vcb-backup \
-r c:\mnt\vcb-backup -t fullvm -m nbd
The -r parameter defines a directory of backup location. The -m parameter specifies transport mode (available values are san, hotadd, nbd/nbdssl). The directory can't exist. It is created on demand. The command should produce the following output when it finishes:
Copying "[system-raid1] vcb-backup/vcb-backup.vmx":
Copying "[system-raid1] vcb-backup/vcb-backup.nvram":
Copying "[system-raid1] vcb-backup//vmware.log":
Converting "c:\mnt\vcb-backup\scsi0-0-0-vcb-backup.vmdk" (compact file):

As you can see, the VCB proxy is copying virtual machine disks to the defined local storage. More precisely, the ESX host provides virtual machine snapshots to the VCB proxy which copies them to the local storage (you can check it with snapshot manager - there will be a snapshot called _VCB-BACKUP_). After that, you can backup them with your favorite backup software. Or you can access them with mountvm command.


Anonymous said...

Finally someone demistifies it. Ever other egghead overcomplicated the topic. You done well to make it simpler. Cheers.

Adam Collyer said...

It's too bad that VCB is being discontinued after vSphere 4.1 - it is a really nifty tool!

I developed the basic usage you described further into a script that queries a host (or vCenter server) for a list of VMs and backs up each in turn using vcbMounter. Have a look, while it's still relevant :)