GhettoVCB snapshot failures on ESXI 4.0 – 4.1

ghettovcbvmware-esxi

i got a problem today. A few hours ago, i updated my esxi to version 4.1 from 4.0. My aim was to get a backup from my vm's with ghettoVCB.sh even if there are snapshots of the vm. (at 4.0 that did not work at all)

For this, i downloaded the latest version of ghettoVCB(github) and unzipped it.

The important files (chmod 777) are now unpacked in the folder: ghettoVCB-master and i edited the line VM_BACKUP_VOLUME to the path where the backups should be after running the script.

When i run the script and there are no snapshots of a vm, the vm gets "backuped" in the folder: VM_BACKUP_VOLUME=/vmfs/volumes/datastore1/BACKUP

this works.. so far..

But as i said, when there is a snapshot of a vm, i just get the messages:

2013-06-13 15:21:54 -- info: ###### Final status: ERROR: No VMs backed up! ######

(if there is at least one vm that can get backuped without a snapshot)

and:

2013-06-13 15:19:46 -- info: ###### Final status: ERROR: All VMs failed! ######

(if all vm's have got snapshots.)

I read in the internet to configre in ghettoVCB.conf and ghettoVCB.sh following to 1 instead of 0:

ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP=1

but that won't change anything.

Best Answer

Have you read the documentation for this feature? It would not back up snapshots but consolidate them and back up the VM afterwards, so you probably do not want to use it anyway:

However, I decided to support this use case as it was recently brought to my attention that some of the commercial backup solutions that support VMs with existing snapshots just consolidate all snapshots prior to backup. If this feature is enabled, it will consolidate ALL existing snapshots on the VM prior to running a backup.

If this is really what you want to have, the VMWare communities have a thread which describes a problem looking similar to yours and proposes a code change to the script which is meant to fix the problem:

#        elif ls "${VMX_DIR}" | grep -q "\-delta\.vmdk" > /dev/null 2>&1; then
#            if [ ${ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP} -eq 0 ]; then
#                logger "info" "Snapshot found for ${VM_NAME}, backup will not take place\n"
#                VM_FAILED=1
#            fi
        elif [[ -f "${VMX_PATH}" ]] && [[ ! -z "${VMX_PATH}" ]]; then
            if ls "${VMX_DIR}" | grep -q "\-delta\.vmdk" > /dev/null 2>&1; then
                if [ ${ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP} -eq 1 ]; then
                    logger "info" "Snapshot found for ${VM_NAME}, consolidating ALL snapshots now (this can take awhile) ...\n"
                    $VMWARE_CMD vmsvc/snapshot.removeall ${VM_ID} > /dev/null 2>&1
                else
                   logger "info" "ERROR: Snapshot found for ${VM_NAME}, backup will not take place\n"
                   exit 1
                fi
            fi