jharper1
Contributor
Contributor

vcbSnapAll switch examples?

VMWare documentation on vcbSnapAll is lacking. Anyone have any examples of how they use this to snap to a local partition? I keep getting I want to backup all guests to a SMB mount /mnt/backups.

0 Kudos
13 Replies
UserF
Contributor
Contributor

vcbSnapAll uses the same command line options as vcbMounter. Just type vcbSnapAll and it states this fact.

An example of snaping to a local partition is:

vcbSnapAll -a poweronstate:on -r /tmp/backup (local ext3)

or

vcbSnapAll -a poweronstate:on -r /vmfs/volumes/storage1/backup (local vmfs)

subdirectories based on the virtual machine name will be created under the ./backup directory for each vm, for example

/tmp/backup/vm1

/tmp/backup/vm2

...

0 Kudos
admin
Immortal
Immortal

i got a little extra question.. four our backup strategy we want to use the SnapAll command to backup to a location...

this seems to work the first time. but the second time it fails with the message directory already exits.. is there a paramters where i can say 'overwrite' ?

(or edit the SnapAll (vcbMounter) scripts so they will check if the folder exits and if so continue?

thx

0 Kudos
jharper1
Contributor
Contributor

I must have something wrong in /etc/vmware/backuptools.conf

vcbSnapAll -a poweronstate:on -r /backups

I get the following:

Unspecified error during backup. Please refer to logs.

0 Kudos
UserF
Contributor
Contributor

Did you look in the /var/log/vmware/vcbSnapAll-nnnn/machinename-failed (or -ok)

Should tell you more about the failure if you have anything in the log. If you dont you still have a problem with the command, though it looks good to me. If all your vm's were powered off you still should get status info showing 0 machines with matched.

I think from what I am seeing you probably have a issue with your backuptools.conf, post an example and maybe we can fix. Otherwise there are some good posts regarding the VCHOST and other parameters which tripped me up. I resorted to VCHOST=localhost and using root account & pw to get working for testing.

0 Kudos
UserF
Contributor
Contributor

I had the same problem and have not yet tried to resolve as still testing. There is a way to deal with this on the vcbRestore utility by using -b prompt|overwrite|keep|abort that you might try. Otherwise you will want to add something in the script to deal with it, not sure if you care about the directory existing if you are just going to overwrite. I would suggest a clean up process prior to running if the -b switch doesnt work. If it does please post so I will know!

0 Kudos
jharper1
Contributor
Contributor

No info in /var/log/vmware/vcbSnapAll-XXX logs at all.

Any thoughts?

My backuptools.conf

#

\# Configuration file for all the vcb* wrapper scripts.

\# You can override the settings in this file using command line

\# arguments.

#

\# Also, all vcb utilities can be pointed to a different config file

\# by setting the VCB_CONFIG_FILE environment variable.

#

#

\# URL for the VC SDK instance to connect to. The format is

\#

#

\# Example: NAS share labelled "esxnas42" mounted on "/mnt/nas/42":

\# \[esxnas42]= /mnt/nas/42

#

\# DATASTORE=/etc/vmware/datastore.cat

##

\## Default settings for importing legacy VMs that have been backed up

\## with "vmsnap.pl" on ESX 2.5.x.

##

\# Datastore path and directory under which the VM is going to be

\# restored. You can use %VMNAME% to indicate the legacy VM's name

\# in the path

\# DSPATH="\[vol0] %VMNAME%"

\# The host the virtual machine is going to be associated with.

\# The default setting associates the VM with the host the restore

\# is being run on.

VMHOST=dalesx2

\# Resource pool the VM is part of. You can use %VMHOST% to specify the

\# host name the VM is going to be associated with.

\# You can use the "resourcepools" command of "vcbUtil" to get a list of

\# all known resource pools on the VC/ESX server.

\# RESOURCEPOOL="/ha-folder-root/ha-datacenter/ha-folder-host/%VMHOST%/Resources"

\# VC folder in which the virtual machine is going to be placed in.

\# User permissions are associated with folders.

\# You can use the "vmfolders" command of "vcbUtil" to get a list of

\# all folders that can hold virtual machines.

\# FOLDERPATH="/ha-folder-root/ha-datacenter/ha-folder-vm"

0 Kudos
UserF
Contributor
Contributor

The only thing I see that doesnt match mine is the following:

VMHOST=dalesx2

whereas I have:

VMHOST=`hostname`

which I am sure is the default. Try changing this back and see what happens, otherwise the only thing I can think of is that you make sure the password is correct (I am sure it is but something to doublecheck)

0 Kudos
gdeloz
Contributor
Contributor

Hello,

vcbSnapAll -a poweronstate:on -r /backups[/i]

You should better try

vcbSnapAll -a powerstate:on -r /mnt/backups[/i]

If you want full information about this command check the Virtual Machine Backup Guide, Appendix A Using Service Console to Back Up and Restore Vitual Machines

Hope it helps

0 Kudos
jharper1
Contributor
Contributor

Seems to be working now...

I did the following:

1. Changed TEMPDIR=/tmp to /backups/tmp

2. Tried to run a vcbSnapAll and it failed.

3. Changed back to TEMPDIR=/tmp

4. Tried to run a vcbSnapAll it worked like a champ!

5. Slammed my head on the desk.

0 Kudos
keeneye
Contributor
Contributor

Did you ever get this issue worked out? I have the same issue and can't come up with a solution.

TomVDB wrote...

i got a little extra question.. four our backup strategy we want to use the

SnapAll command to backup to a location...

this seems to work the first time. but the second time it fails with the

message directory already exits.. is there a paramters where i can say

'overwrite' ?

(or edit the SnapAll (vcbMounter) scripts so they will check if the folder

exits and if so continue?[/i]

Thanks!

Ed

0 Kudos
RSP
Contributor
Contributor

The statement should be:

vcbSnapAll -a powerstate:on -r /tmp/backup

and not

vcbSnapAll -a poweronstate:on -r /tmp/backup

0 Kudos
beerorkid
Contributor
Contributor

here is the script I use to run a backup this way. It runs nightly via cron

#!/bin/bash

PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin";

rm -rf /mnt/backups/backupdsk/ESX1/*

/usr/sbin/vcbSnapAll -a powerstate:on -r /mnt/backups/backupdsk/ESX1 #> /dev/null 2>&1

0 Kudos
gdesmo
Enthusiast
Enthusiast

Is vcbSnapAll no longer available in 1.0.3? I do not see the cmd available on my vcb proxy unber C:\Program Files\VMware\VMware Consolidated Backup Framework

0 Kudos