F5 Automated Backups - The Right Way
Hi all,
Often I've been scouring the devcentral fora and codeshares to find that one piece of handywork that will drastically simplify my automated backup needs on F5 devices. Based on the works of Jason Rahm in his post "Third Time's the Charm: BIG-IP Backups Simplified with iCall" on the 26th of June 2013, I went ahead and created my own iApp that pretty much provides the answers for all my backup-needs.
Here's a feature list of this iApp:
- It allows you to choose between both UCS or SCF as backup-types. (whilst providing ample warnings about SCF not being a very good restore-option due to the incompleteness in some cases)
- It allows you to provide a passphrase for the UCS archives (the standard GUI also does this, so the iApp should too)
- It allows you to not include the private keys (same thing: standard GUI does it, so the iApp does it too)
- It allows you to set a Backup Schedule for every X minutes/hours/days/weeks/months or a custom selection of days in the week
- It allows you to set the exact time, minute of the hour, day of the week or day of the month when the backup should be performed (depending on the usefulness with regards to the schedule type)
- It allows you to transfer the backup files to external devices using 4 different protocols, next to providing local storage on the device itself
- SCP (username/private key without password)
- SFTP (username/private key without password)
- FTP (username/password)
- SMB (using smbclient, with username/password)
- Local Storage (/var/local/ucs or /var/local/scf)
- It stores all passwords and private keys in a secure fashion: encrypted by the master key of the unit (f5mku), rendering it safe to store the backups, including the credentials off-box
- It has a configurable automatic pruning function for the Local Storage option, so the disk doesn't fill up (i.e. keep last X backup files)
- It allows you to configure the filename using the date/time wildcards from the tcl [clock] command, as well as providing a variable to include the hostname
- It requires only the WebGUI to establish the configuration you desire
- It allows you to disable the processes for automated backup, without you having to remove the Application Service or losing any previously entered settings
- For the external shellscripts it automatically generates, the credentials are stored in encrypted form (using the master key)
- It allows you to no longer be required to make modifications on the linux command line to get your automated backups running after an RMA or restore operation
- It cleans up after itself, which means there are no extraneous shellscripts or status files lingering around after the scripts execute
I wasn't able to upload the iApp template to this article, so I threw it on pastebin: http://pastebin.com/YbDj3eMN
Enjoy!
Thomas Schockaert
Published Mar 13, 2014
Version 1.0Thomas_Schocka1
Altocumulus
Joined May 04, 2012
Thomas_Schocka1
Altocumulus
Joined May 04, 2012
- annielee_13548NimbostratusCan I have 2 backup using this iApp ? one for locally and one for remotely ? I tried but got an error.. so can i confirm that cant be done ?
- annielee_13548NimbostratusHi Thomas, I've used your iApp on our F5 and it worked successfully. And if possible can you help me with modifying the script as i need the UCS file to be compressed to smaller size (as the smallest one we have is about 25MB) Thanks..
- Greg_Crosby_319Historic F5 AccountNice script Thomas! I had troubles when using ftp because my transfer was using ascii mode. Adding \nbinary to force a binary transfer into the iCall script procedure which creates the temporary ftp.sh script file resolved my problem. Thought it would be worth mentioning.
- whswhswhs124_98Nimbostratus'
- Evan_25555Historic F5 AccountHas anyone gotten the SMB piece to work? I'm getting errors similar to what Dan L reported some months ago. (bad decrypt 27666:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:330: while executing "exec $scriptfile" line:17))
- I've made an other version of the iApp which also fixes length problems when using SMB. Find it here: http://download.domingo.dk/data/public/c04a2a.php
- Jeff_121982NimbostratusHas anyone integrated alerting into this script? It would be nice to be able to receive some type of notification that the backups occurred as scheduled and were copied to the remote repository.
- Peter_J_146842NimbostratusHas anyone got this to work 100% properly? I am not able to restore from FTP. I have no problem with making a job FTP the UCS file (without passphrase) to a FTP server. But when I download it back to the F5, and try to restore it from the file, it fails with: Saving active configuration... Current configuration backed up to /var/local/ucs/cs_backup.ucs. tar: Skipping to next header tar: Archive contains obsolescent base-64 headers gzip: stdin: invalid compressed data--format violated tar: Child returned status 1 tar: SPEC-Files: Not found in archive tar: Error exit delayed from previous errors Fatal: executing: tar -zxf /var/local/ucs/20140919_backup_test.com.ucs SPEC-Manifest SPEC-Files Operation aborted. /var/tmp/configsync.spec: Error installing package Config install aborted. Unexpected Error: UCS loading process failed. I am not sure what this mean, but I have notices that the version is “unknown” when opening the backup file on the F5. Furthermore, if I set the job to save on F5 instead of FTP, I can restore it without problem, and the version is now shown right version. Please advice. P.S. This is testet in both version 2.0, 2.0.1-tdd and 2.0.2-tdd
- Nfordhk_66801NimbostratusDoes anyone have instructions how to set this up?
- lkchenNimbostratusThese are new 7200v's, not yet in production. They had initially come as v11.4.1, we had contracted a PS to get 3 vCMPs configured along with some initial configuration of LTM/GTM/AFM. We had discussions with them about doing the system with v11.5.1 (since there was interest in doing forward proxying on the LTM rather than load balancing to forward proxy servers behind it.) We were strong recommended to not do it, as they considered 11.5.1 too buggy. But, we pushed for it anyways. Though seems there have been other useful things from 11.5.1, like being able to turn appliance mode on for the vCMPs (and being able to turn it off should we get stuck looking on finding a tmsh way to accomplish the task...) Though not soon enough before a different consultant had edited bigip_base.conf to fix a typo that was made during the initial setup using configuration utility. Or finding the tmsh way (which I had done a couple weeks earlier to adjust one of the ip ranges...but not the one that had typo, had entered a range in two places as x.x.x.6/29 when it should've been x.x.x.16/29.) Don't know if the 11.5.1 was done as an upgrade from 11.4.1 or as a new install, I was in the hospital that day, and they were in hurry to get PS working on it, though networking wasn't done until the end of the second day....for only one of the 3 vCMP pairs, and the failover link still hasn't been done.) The only big upgrade I've even done was from 9.3.1 to 10.2.3 (that was a scary 1am upgrade....done a little over 2 months 9.3.1 was to EOL.)