i'm trying here to implement pre/post-snapshot scripts for backuping up some Linux-based VMs using VCB. i need to quiesce databases inside VM during snapshotting. according to VM backup guide i need to create following scripts inside VM:
during snapshotting VMware Tools should run these scripts automatically. i have tried it with different Linux flavors and these scripts are totally ignored. they are just not launched at all.
am i missing something? VMware tools are installed inside VM. scripts have execute permissions set.
Which version of VCB and ESX are you using?
Recent version use another location for those scripts.
Seems that your script are in a right position (page 52 of http://www.vmware.com/pdf/vsphere4/r40/vsp_vcb_15_u1_admin_guide.pdf)
Have you make chmod a+x to your script.
Can you run them from shell?
Are VMware Tools installed?
yes, as i already mentionaed in my initial post vmware tools are installed and all execute permissions are set. and yes, these scripts run successfully from command line.
i have tested this with 2 different Linux VM-s with different Linux flavor (one 32-bit RedHat and 64-bit Debian) and even in totally different environments. and in both environments result is the same. those scripts are totally ignored.
i have seen from VCB backup logs (in verbose mode) that if script execution fails it returns error (in Windows). i even put "exit 1" command to the end of one script (for test) and no results in logs at all. so seems that it does not even try to launch it.
Sorry no other ideas.
Try to check again your vcbMounter command line or try with a Windows VM to see if scripts works in this kind of VM.
know this is an old post, but i'm currently running into this.
have a solaris vm running on an esxi 3.5 using latest patches and vmwaretools version.
scripts are located in /usr/sbin and security is set to 777 for testing:
-rwxrwxrwx 1 root root 36 May 30 12:24 /usr/sbin/post-thaw-script
-rwxrwxrwx 1 root root 36 May 30 12:23 /usr/sbin/pre-freeze-script
using veeam backup but this should not make a big difference. i can see the snapshot creation in virtual center and watch the backup running in veeam.
the scripts contain the following code
echo PRE: $1 $2 $3 >> /tmp/bck.log
echo POST: $1 $2 $3 >> /tmp/bck.log
expected to find /tmp/bck.log but nothing here. looks like my scrips are completely ignored ...
tried to copy the scripts over into /etc/vmware-tools but no success here also?
to answer my own question:
got response from vmware support. prefreeze and postfreeze scripts are NOT SUPPORTED on SOALRIS!
prefreeze and postfreeze scripts are supported on windows and linux guests only!
all other guest OS don't support the use of this scripts.
this is true for esx 3.5 and also for esx 4.x!
I just want to add my notes to this issue for those who are trying to get this to work.
To create the pre-freeze-script and post-thaw-script on Linux, do the following:
1. Create /usr/sbin/pre-freeze-script
$ sudo echo "echo \"\$(date) pre-freeze\" >> /tmp/snapshot.log" > /usr/sbin/pre-freeze-script
2. Create /usr/sbin/post-thaw-script
$ sudo echo "echo \"\$(date) post-thaw\" >> /tmp/snapshot.log" > /usr/sbin/post-thaw-script
3. Change the owner
$ sudo chown root.root /usr/sbin/pre-freeze-script /usr/sbin/post-thaw-script
4. Change the permissions
$ sudo chmod 0700 /usr/sbin/pre-freeze-script /usr/sbin/post-thaw-script
5. Test by creating a snapshot in vcenter (make sure you CHECK "Quiesce guest file system" and UNCHECK "Snapshot the virtual machine's memory")
6. Look in the log file when the snapshot is complete (with memory option turned off, the snapshot should be very quick) you should see 2 new lines
$ cat /tmp/snapshot.log
I tested this on ESXi 5.1 in the following guest OS's:
RHEL 6.6 64-bit
Ubuntu 14.04 64-bit
Ubuntu 14.04 32-bit
The one piece that was causing the scripts to NOT be triggered for me was the "Snapshot the virtual machine's memory" option when creating the snapshot in vcenter. As soon as I unchecked that and checked the quiesce option, it started working perfectly.