Custom Backup Flows in Unimus 2.5
Custom Backup Flows allow you to specify your own sequences of commands to be executed during backup jobs on devices.
We are adding the ability to create your own Custom Backup Flows in Unimus 2.5. These Flows will allow you to specify your own sequences of commands to be executed during backup jobs on devices.
When will Backup Flows be useful?
Up until 2.5, how a Device Backup is performed is hard-coded in Device Drivers built into Unimus. When we add support for new devices, we implement a Backup Flow inside the Device Driver. This assures that all devices on our list of supported devices behave consistently and work out of the box.
However, if you would like to do backup on a device differently from our built-in flow (for example, add outputs of a few commands to be a part of the backup), up until now you didn't have a way to. Custom Backup Flows allow you to create your own backup procedures, so if you want to do a backup differently than our built-in flow, you now can.
Custom Flows vs. Built-in Flows
As we mentioned before, Custom Flows will override built-in Flows for devices which have a Custom Flow assigned. You can target devices either by their Vendor, Device Type, or by Tags.
Since there are multiple ways to target devices with Custom Flows, it is possible to create "conflicts", where more than one Custom Flow exists for a device. If a conflict like this exists, Unimus will execute the default Flow built in the Device Driver.
To check if there is a Flow conflict on a device, you can navigate to the Devices
screen, select the device, click Info > Backup Flows
. A table will show all Flows assigned to this Device. If there is more than one, you have a conflict on your hands.
How do you define a Custom Flow?
A Backup Flow is a sequence of steps performed on a device. As such, for a Custom Flow you need to define these steps yourself. In the Flow creation window, you can click Add step
, and select the step type:
There are options to switch the device into Enable (privileged-exec) or Configure mode. This works in a very similar way to Config Push. You can see more info on modes here: https://wiki.unimus.net/display/UNPUB/Device+mode+table.
The most used step type is the Send command
. This step will send the command you provide to the device. You can then choose if the output of this command should be consumed into the final Device Backup. You can also choose whether this command failing should fail the entire Backup job, or if the failure should be ignored, and next step should be executed.
If you just want to run some pre and post-backup commands, you can simply set them to be excluded from the final backup.
Example
Here is an example of how a complete Custom Backup Flow might look like:
- First we will log in to the device and make sure it is in Enable (Privileged Exec) mode.
- Then we send
terminal length 1000
, just so there is less pagination in output of future commands. Altho Unimus has no issues with pagination (and will remove it from output properly) on some devices it may be useful to turn off pagination completely. You can notice we don't include the output of this device in our backup (Exclude output from Backup
is set totrue
). - Then we send our main
show running-config
backup command. - After getting the config, we do mutliple additional
show ...
commands, and include those in the device backup. You can notice we setIgnore failure
totrue
, so if any of these additional commands fail, we won't fail the entire backup, and just ignore the failure.
The result of this Backup Flow will be a single device backup, containing outputs from show running-config
, and all the additional show ...
commands we listed. Since we target all EdgeSwitch
es in our network, when Backup will be run on any EdgeSwitch
, our Custom Backup Flow will be used instead of the built-in driver flow.
How to debug failing Backups
Finally, we want to show you how you can debug failing backups when using Custom Flows. You can easily see what's happening during a Device Backup using our Debug Mode
options. Please head to Zones
and enable Device Output Logging
for the Zone your devices are in:
After the debug is enabled, you can run a backup on the device which fails. After the backup job fails, you can download the device output log:
In the log, you will see full CLI communication with the device, and should be able to spot why the backup fails.
Final words
We are introducing Custom Backup Flows with the hope that this will give you flexibility and customizability to backup your devices in any way you need. If you run into any issues, or want to let us know if anything is missing, please head to our forum, either the support section or the feature request section, and let us know!
Custom Backup Flows are available starting with Unimus 2.5.0. Please head over to the Download section to download the latest Unimus release.