Getting Started with BIG-IP Next: Backing Up and Restoring Instances
The instances are the workhorses in BIG-IP Next much like classic, but the instance identity is really not that important. In agricultural terms, think of them like cattle or crops. Any individual instance isn't special, it's what comes out of your harvest (ie...your apps) that matter. And so with that, you might be asking why you need a backup of the instance at all, and what even is a backup, and by the way, what happened to my qkviews? The backup/restore capability in Central Manager is mostly there for those with data loss prevention and security compliance requirements. If you need to restore alternatively, you can just as easily deploy a new instance and the applications that were running on that instance from your Central Manager documents, or even from repos you are automating your workloads from that are tasked with maintaining operational state. Qkviews are alive and well; you can initiate those within the settings of each instance in Central Manager. Regardless of how you want to manage your instances, in this article, I will walk you through the backup/restore functionality in Central Manager.
Configuring a Backup
Log into Central Manager and click on Manage Instances.
Select the instance you want to create a backup for, click ...Actions, then select Back Up & Schedule.
Set and record/remember a password for this backup, then choose between a one-time backup by selecting Back Up Now or select Schedule Backup as I did.
You can configure a daily, weekly, or monthly backup. These backups will be stored on Central Manager (or the external storage you might have configured when you set up Central Manager.) Business and operational requirements will dictate your settings, but I selected weekly and chose Saturdays at 1am US central time with no end date. When finished with your settings, click Next.
Review the summary and if all looks acceptable, click Save Schedule.
You'll be dropped back to the My Instances view, and you'll get an alert that your backup has been scheduled as highlighted.
If you clicked Back Up Now, or you're in the scheduled backup window, you'll see the backup status on your instances list.
Restoring a Backup
If you need to restore your instance, make sure you are logged in to Central Manager and viewing the My Instances pane under Manage Instances, then click Back Up & Restore in the left hand navigation under Instances.
Select the appropriate backup (latest, or N-1...) for your instance and then click Restore.
Enter the password you set during backup scheduling and then click Yes, Restore.
Back in listing of Backup Files, you'll see a message where your instance is selected that the restore is in progress.
You can also watch the log files from the CLI on Central Manager as well. An example from my system:
admin@cm1:~$ kubectl logs mbiq-fluentd-0 fluentd | grep nats.fluent_log | grep restore
2024-03-07 19:38:11.912816287 +0000 nats.fluent_log: {"action":"Instance restore","level":"info","msg":"Completed restore for instance: 7bf4e3ac-e8a2-44a3-bead-08be6c590071.2024-03-07.19-32-56.backup.tar.gz","source":"Device DeviceModel"}
2024-03-07 19:38:11.922382704 +0000 nats.fluent_log: {"level":"info","msg":"Task: Starting restore task","source":"instanceRestoreTask","taskName":"Restore instance 7bf4e3ac-e8a2-44a3-bead-08be6c590071"}
2024-03-07 19:38:42.268679194 +0000 nats.fluent_log: {"level":"info","msg":"Task: Starting restore job","source":"instanceRestoreTask","taskName":"Restore instance 7bf4e3ac-e8a2-44a3-bead-08be6c590071"}
2024-03-07 19:38:42.286977845 +0000 nats.fluent_log: {"level":"info","msg":"Task: Waiting for mbip restore job 38951ba3-84e4-49f5-a8a2-e7d1edc86c59","source":"instanceRestoreTask","taskName":"Restore instance 7bf4e3ac-e8a2-44a3-bead-08be6c590071"}
admin@cm1:~$ kubectl logs mbiq-fluentd-0 fluentd | grep nats.audit_log | grep restore
2024-03-07 19:38:11.919591625 +0000 nats.audit_log: {"duration_ms":32,"endpoint":"inventory","feature":"device","http_method":"POST","level":"info","msg":"","request":{"encryption_password":"********","file_name":"7bf4e3ac-e8a2-44a3-bead-08be6c590071.2024-03-07.19-32-56.backup.tar.gz"},"resource_id":"7bf4e3ac-e8a2-44a3-bead-08be6c590071","result_code":202,"source_addr":"100.76.0.113","timestamp":"2024-03-07T19:38:11.915208147Z","url":"/api/device/v1/inventory/7bf4e3ac-e8a2-44a3-bead-08be6c590071/restore","user_id":"a0bf3945-5056-4193-b2a9-4fea42af774f"}
Finding Your Backup Files on Central Manager
If you need to backup your instance backup files off-box from Central manager, you can connect through SSH and locate them. It take's a little kubernetes-fu to do so, but if you work your way through the persistent volume claims to the storage location by inspecting their yaml (or json) formatting, you'll get what you need to scp the files off-box. That process looks like this:
admin@cm1:~$ kubectl get pvc mbiq-local-storage-pv-claim -o yaml | grep volumeName
volumeName: pvc-ae75faee-101e-49eb-89f7-b66542da1281
admin@cm1:~$ kubectl get pv pvc-ae75faee-101e-49eb-89f7-b66542da1281 -o yaml | grep "path: "
path: /var/lib/rancher/k3s/storage/pvc-ae75faee-101e-49eb-89f7-b66542da1281_default_mbiq-local-storage-pv-claim
admin@cm1:~$ sudo ls -als /var/lib/rancher/k3s/storage/pvc-ae75faee-101e-49eb-89f7-b66542da1281_default_mbiq-local-storage-pv-claim/backup
total 2076
4 drwxrwxrwx 2 root root 4096 Feb 28 18:40 .
4 drwxrwxrwx 7 root root 4096 Feb 2 00:01 ..
1780 -rw-r--r-- 1 ubuntu lxd 1821728 Feb 28 18:40 3b9ef4d8-0f0b-453d-b350-c8720a30db16.2024-02-28.18-39-59.backup.tar.gz
288 -rw-r--r-- 1 ubuntu lxd 292464 Feb 28 18:39 7bf4e3ac-e8a2-44a3-bead-08be6c590071.2024-02-28.18-39-15.backup.tar.gz
1784 -rw-r--r-- 1 ubuntu lxd 1825088 Mar 7 19:33 7bf4e3ac-e8a2-44a3-bead-08be6c590071.2024-03-07.19-32-56.backup.tar.gz
Now that you know where they are, you can download them via SCP. If you don't want to remember those commands, you can utilize the bash script I threw together (hosted in the codeshare.)