Comprehensive data protection for all workloads
Post Reply
jessethomas
Influencer
Posts: 11
Liked: 4 times
Joined: Feb 01, 2012 4:01 pm
Full Name: Jesse Thomas
Contact:

Pre-freeze & Post-thaw Scripts [Linux]

Post by jessethomas » 3 people like this post

I wanted to post this here in case anyone else can benefit from my experience.

We recently began doing Veeam backups/replicas of a Red Hat 6 server that requires freeze/thaw scripts because of a database application that it hosts.

We created the scripts referencing the documentation (http://helpcenter.veeam.com/backup/80/v ... ts_vm.html), but they would always show as 'Error: Script finished execution with unexpected exit code: 1' in the Veeam UI. This would happen even with all but the most basic commands in the script, when hard-coding a successful exit-code (exit 0) and even when our own logging indicated that the script was executing successfully. Each time this occurred, we would also see '[ScriptInvoker] Exception thrown during script execution (SSH).' in the VM's "task log".

After much troubleshooting and with the assistance of Chris Vollentine from Veeam Support (case#: 00964208), we were able to determine that if the script, or any commands in it, generate any output back to Veeam, it will be interpreted as a false-failure. We were able to get things working by making sure any/all commands in our script redirected all output to /dev/null (> /dev/null 2>&1 &).

With this in place, the scripts would execute successfully and report as such in the UI.
Shestakov
Veteran
Posts: 7328
Liked: 781 times
Joined: May 21, 2014 11:03 am
Full Name: Nikita Shestakov
Location: Prague
Contact:

Re: Pre-freeze & Post-thaw Scripts [Linux]

Post by Shestakov »

Hello Jesse,
Thanks a lot for helping us to improve the product!
I`ll sent your observations to our QA team for an additional research(probably Chris has already done it, but I`ll check).
bbibber
Enthusiast
Posts: 28
Liked: 6 times
Joined: Mar 06, 2015 8:29 pm
Full Name: Guy Schellens
Location: Mechelen, Belgium
Contact:

Re: Pre-freeze & Post-thaw Scripts [Linux]

Post by bbibber »

Very useful :-)

Linux scripts are uploaded over SSH. We backup Linux servers on a network that's not reachable by the Veeam backup software. I presume these scripts won't work then? Would it be hard to implement VIX the same way as for Windows machines?

I guess in that case I can still use the pre-freeze/post-thaw scripts invoked by VMware-tools?

Sincerely
Guy
jessethomas
Influencer
Posts: 11
Liked: 4 times
Joined: Feb 01, 2012 4:01 pm
Full Name: Jesse Thomas
Contact:

Re: Pre-freeze & Post-thaw Scripts [Linux]

Post by jessethomas »

@Shestakov - thanks! I believe Chris was also going to do the same.

@bbibber - Based on what was happening in our environment, I believe VIX is guest-agnostic and can/will be used for Linux machines as well, if the SSH-method doesn't work for any reason (bad username/password, no connectivity, etc.). However, I didn't see specific mention of this in the documentation (possible I missed it, and/or was not looking in the correct place).

I also believe you can still use the "vmware" method of creating /usr/sbin/pre-freeze-script.sh and /usr/sbin/post-thaw-script.sh, which will be called whenever a snapshot is created (via Veeam or otherwise), however, we wanted to additional logging in Veeam so we would know if execution was successful.

For more info: https://pubs.vmware.com/vsphere-50/inde ... A79D2.html
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Pre-freeze & Post-thaw Scripts [Linux]

Post by veremin »

Yep, pre-freeze and post-thaw scripts should work for Linux VMs over VIX without issues. If that doesn't happen, you should open a ticket with our support team. Thanks.
bbibber
Enthusiast
Posts: 28
Liked: 6 times
Joined: Mar 06, 2015 8:29 pm
Full Name: Guy Schellens
Location: Mechelen, Belgium
Contact:

Re: Pre-freeze & Post-thaw Scripts [Linux]

Post by bbibber »

The credential test of our Linux servers we want to reach over VIX fails.

In the documentation there is no mention this works.
http://helpcenter.veeam.com/backup/80/v ... ts_vm.html
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Pre-freeze & Post-thaw Scripts [Linux]

Post by veremin »

Test credentials should verify both type of connections network and networkless. So, if connection over VIX failes, there must be something wrong with provided credentials or one of the requirements isn't met. Can you tell us the exact error you got?
bbibber
Enthusiast
Posts: 28
Liked: 6 times
Joined: Mar 06, 2015 8:29 pm
Full Name: Guy Schellens
Location: Mechelen, Belgium
Contact:

Re: Pre-freeze & Post-thaw Scripts [Linux]

Post by bbibber »

Hi Vladimir
I'll give you more details about the errors tomorrow. I was wondering if the problem could have something to do with the way vmware-tools is installed on our Linux guests?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Pre-freeze & Post-thaw Scripts [Linux]

Post by veremin »

Is it VMware Tools or Open-VM ones?
bbibber
Enthusiast
Posts: 28
Liked: 6 times
Joined: Mar 06, 2015 8:29 pm
Full Name: Guy Schellens
Location: Mechelen, Belgium
Contact:

Re: Pre-freeze & Post-thaw Scripts [Linux]

Post by bbibber »

Hi Vladimir,
(edited this post with new info)
This is VMware tools.

I got a look at the details. When I initiate a "Guest Credentials Test" in our Backup Job, it only tries to use VIX when I supply Windows credentials (Connecting to guest OS via VIX, user .... Error ... ). If I use Linux credentials it only tries to connect with SSH, this doesn't work as the VM's are on an isolated network.
Anguel
Expert
Posts: 193
Liked: 18 times
Joined: Apr 16, 2015 9:01 am
Location: Germany / Bulgaria
Contact:

Re: Pre-freeze & Post-thaw Scripts [Linux]

Post by Anguel »

jessethomas wrote:After much troubleshooting and with the assistance of Chris Vollentine from Veeam Support (case#: 00964208), we were able to determine that if the script, or any commands in it, generate any output back to Veeam, it will be interpreted as a false-failure. We were able to get things working by making sure any/all commands in our script redirected all output to /dev/null (> /dev/null 2>&1 &).

With this in place, the scripts would execute successfully and report as such in the UI.
I also spent hours with troubleshooting and came to a similar conclusion, BTW I am on Hyper-V.
I have written about this in my blog if anyone is interested:
http://techie-blog.blogspot.de/2017/11/ ... ecute.html

Sorry, but I really find Veeam docs insufficient on Linux VM topics.

Anguel
Post Reply

Who is online

Users browsing this forum: No registered users and 199 guests