1+ ## Important Information
2+ Minimum version requirements:
3+
4+ - v20.8 pyATS
5+ - v20.8 Genie
6+ - v20.8.3b0 genie.libs.sdk
7+ - v20.8.2b2 genie.libs.clean
8+
9+ If the versions of your packages do not meet the above minimums, upgrade using the steps below:
10+
11+ # First upgrade the pyats installation to 20.8
12+ pip install --upgrade pyats[full]
13+
14+ # Next upgrade genie.libs.sdk and genie.libs.clean to the beta
15+ pip install --upgrade --pre genie.libs.sdk genie.libs.clean
16+
17+
118## Getting Started
2191 . Clone this repository into ` <path/to/pyATS>/ `
320
4212 . Create a [ testbed datafile] ( https://pubhub.devnetcloud.com/media/pyats/docs/topology/schema.html#production-yaml-schema )
5- that contains devices in which a backup is required.
22+ that contains devices in which a backup is required.
23+
24+ **note:** One device must have the alias 'uut' (does not matter which one).
625
7263 . Run the script which will, connect to all devices in the testbed datafile, gather the running configurations,
827and save that to a file named ` <path/to/pyATS>/solutions_examples/save_running_config_to_file/config_backup_<dev_name>.txt `
@@ -12,8 +31,10 @@ and save that to a file named `<path/to/pyATS>/solutions_examples/save_running_c
1231
1332 # Execute the script
1433 pyats run job job.py --testbed-file <path/to/testbed.yaml>
34+
35+ **note**: For this example only ios, iosxe, iosxr, and nxos device are supported. Any other devices will be skipped.
1536
16- 4 . If everything worked as expected the report at the end should be ` PASSED ` for every step:
37+ 4 . If everything worked as expected, the report at the end should be ` PASSED ` for every step:
1738
1839 2020-09-03T10:25:21: %EASYPY-INFO: +------------------------------------------------------------------------------+
1940 2020-09-03T10:25:21: %EASYPY-INFO: | Task Result Details |
@@ -35,7 +56,31 @@ and save that to a file named `<path/to/pyATS>/solutions_examples/save_running_c
3556Now we have a text file containing a backup of the running configuration from all devices defined in the testbed datafile.
3657One idea is using [ pyATS Clean] ( https://pubhub.devnetcloud.com/media/genie-docs/docs/clean/index.html )
3758to restore our configurations on a later date. This can be helpful if your network was working one day and not another.
38- Simply replace to current configs with the backed up configs!
59+ Simply replace the current configs with the backed up configs!
60+
61+ 1 . Edit the ` clean.yaml ` template provided in ` <path/to/pyATS>/solutions_examples/save_running_config_to_file/datafiles `
62+ to include your devices and the path to the config_backup_ <dev_name>.txt file. You can add as many devices that are in your testbed file.
63+
64+ 2 . Run clean to restore your configs.
65+
66+ # Navigate to cloned repository
67+ cd <path/to/pyATS>/solutions_examples/save_running_config_to_file
68+
69+ # Run clean
70+ kleenex -testbed_file <path/to/testbed.yaml> -clean_file datafiles/clean.yaml
71+
72+ 3 . If everything worked successfully the report at the end should be ` Passed ` for every step:
73+
74+ 2020-09-05T08:18:10: %AETEST-INFO: +----------------------------------------------------------+
75+ 2020-09-05T08:18:10: %AETEST-INFO: | STEPS Report |
76+ 2020-09-05T08:18:10: %AETEST-INFO: +----------------------------------------------------------+
77+ 2020-09-05T08:18:10: %AETEST-INFO: STEP 1 - Apply configuration to device <dev> after reload Passed
78+ 2020-09-05T08:18:10: %AETEST-INFO: STEP 2 - Copy running-config to startup-config on device <dev> Passed
79+ 2020-09-05T08:18:10: %AETEST-INFO: STEP 3 - Allow configuration to stabilize on device <dev> Passed
80+ 2020-09-05T08:18:10: %AETEST-INFO: ------------------------------------------------------------
81+ 2020-09-05T08:18:10: %AETEST-INFO: The result of section apply_configuration is => PASSED
82+ 2020-09-05T08:18:10: %KLEENEX-INFO: Finished cleaning device '<dev>' using 'DeviceClean'.
83+ 2020-09-05T08:18:11: %ROOT-INFO: Clean finished!
3984
4085[ pyATS Clean] ( https://pubhub.devnetcloud.com/media/genie-docs/docs/clean/index.html ) has many other features worth looking into.
4186It can load new images onto various devices, recover devices from rommon prompt, and much much more.
0 commit comments