0

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.

1
  • so i just don't know how to activate the function that ghettoVCB backups vm's even if there are snapshots of it .. – NovaCP Jun 14 '13 at 6:49
1

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
6
  • I read the documentation and it just says nothing about backuping a vm when there are snapshots of it. The script just does not do a backup of that vm.. i have a look at the thread. problem is that when i active "ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP=1" nothing happens at all.. – NovaCP Jun 14 '13 at 7:28
  • @NovaCP "nothing" is probably not what is happening. Run the script with debugging output enabled and see if your problem matches the one described in the thread. If so, try patching the shell script as recommended. – the-wabbit Jun 14 '13 at 7:34
  • yes, it is the same problem. i edited the shell script and added the code of the other thread, i will tell you guys what happened, it's running atm. – NovaCP Jun 14 '13 at 7:39
  • it worked, but problem is that deleting the old snapshots and consolidating all snapshots is not what i want.. but probably the only thing i can get. Is there another way to backup a vm that has a snapshot without losing the snapshots that were there before? (on 4.1) – NovaCP Jun 14 '13 at 7:59
  • i could do the same thing with 4.0 too but i upgrated to 4.1 because i read somewhere that you could take a backup of the vm without losing the snapshot..but found no way. – NovaCP Jun 14 '13 at 8:02
0

What i understand from your post is you are trying to backup VM with ghettoVCB which can't recognize any VM's. So here your provided config is fine just need few modifications :
** How you are running ghetto script**

Solution:

Create a file and insert the vm name:

suppose VM name is
1. test1
2. test2
Then, inside ghetto directory:

vi backup  

test1
test2
Now run save and close file and run below command:

./ghettoVCB.sh -f backup -d dryrun  

Here -f is for take a backup of specific vm's whose name is listed in backup file which we created earlier. And -d dryrun will look for those listed VM's, are they exists or not and can be able to backup. Output will be like

-- info: ###### Final status: OK, only a dryrun. ######

Now you can proceed for backup run below command:

./ghettoVCB.sh -f backup 

Here your backup will start and save snapshot on given destination.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.