When I planned to do a factory reset of my APIC in the Lab, I wanted to create a snapshot of the current configuration directly copy it down to my Laptop. Over the GUI, there is no way to do this. You can just create a local snapshot on the APIC or send it to a remote location which needs to be a FTP/SCP/SFTP Server. But you can’t simply download it.
After a bit of research, I figured out how to locate the file on the file system of the APIC and how to download it. It’s actually pretty easy:
The first necessary command is: show snapshot files
apic1# show snapshot files File : ce2_DailyAutoBackup-2017-06-06T17-00-17.tar.gz Created : 2017-06-06T17:00:18.343+02:00 Root : Size : 251913 File : ce2_DailyAutoBackup-2017-06-07T01-00-22.tar.gz Created : 2017-06-07T01:00:23.468+02:00 Root : Size : 251939 File : ce2_DailyAutoBackup-2017-06-07T09-00-27.tar.gz Created : 2017-06-07T09:00:28.958+02:00 Root : Size : 251809
To find in which folder the APIC is storing the snapshots is a bit more tricky. If you do a standard find / -iname ce2_DailyAutoBackup-2017-06-07T09-00-27.tar.gz you’ll get a ton of “Permission denied” and “No such file or directory” messages.
apic1# find / -iname ce2_DailyAutoBackup-2017-06-07T09-00-27.tar.gz find: '/usr/share/polkit-1/rules.d': Permission denied find: '/usr/libexec/initscripts/legacy-actions/auditd': Permission denied find: '/usr/lib/firewalld': Permission denied
I haven’t found a way to get sudo working with the find command, I had to to a small tweak to the find command so that it don’t list the Permission denied and No such file or directory.
apic1# find / -iname "ce2_DailyAutoBackup-2017-06-07T09-00-27.tar.gz" 2>/dev/null /data2/snapshots/ce2_DailyAutoBackup-2017-06-07T09-00-27.tar.gz apic1#
Then you’ll go into the following directory:
apic1# cd /data2/snapshots apic1# apic1# ls -la total 752 drwxr-xr-x 2 ifc admin 4096 Jun 7 09:00 . drwxrwxrwx 13 ifc root 4096 May 25 16:07 .. -rw-r--r-- 1 ifc admin 251913 Jun 6 17:00 ce2_DailyAutoBackup-2017-06-06T17-00-17.tar.gz -rw-r--r-- 1 ifc admin 251939 Jun 7 01:00 ce2_DailyAutoBackup-2017-06-07T01-00-22.tar.gz -rw-r--r-- 1 ifc admin 251809 Jun 7 09:00 ce2_DailyAutoBackup-2017-06-07T09-00-27.tar.gz
And then you’ll take your favorite SFTP/SCP Client (WinSCP, Filezilla) and get the File from there.
Nice tip, thanks. Great blog with new technology!
Thank you for your feedback Dan!
AWESOME to know in case creating rollbacks does not work 😉
Thx. Is really useful if you don’t have a majority so that you can export it via the normal way.