Introduction
Prior to Cisco IOS XR Software Release 7.1.2, XR dual RP devices did not support file mirroring from active RP to standby RP. Administrators had to manually perform the task or use EEM scripts to sync files across active RP and standby RP. Starting with Cisco IOS XR Software Release 7.1.2, file mirroring feature enables the router to copy files or directories automatically from /harddisk:/mirror location in active RP to /harddisk:/mirror location in standby RP or RSP without user intervention or EEM scripts.
Feature Enablement
- mirror enable (Mandatory in 712, for the upcoming releases(r72x,r73x) its enabled by default)
The /harddisk:/mirror directory is created by default, but file mirroring functionality is only enabled by executing the mirror enable command from configuration terminal. Status of the mirrored files can be viewed with show mirror status command.
RP/0/RP1/CPU0:cisco(config)#mirror enable
RP/0/RP1/CPU0:cisco(config-mirror)#
Mirroring explained
The primary process is mirror_server, which is booted once the 'mirror enable' config is set. This process uses rsync via ssh to sync the active to standby nodes. Exclusive mirror_server process runs on RP spawns thread per mirror directory (currently only support a single mirror directory). Whenever a filesystem modification is detected by the watches, mirror_server triggers transfer the files across to standby RP.
Mirroring is also triggered whenever the standby node changes state to UP (this will handle standby reboots, as well as insertions). When there are more files added into the mirror directory there will be a slight increase in cpu on one core during the copy.
Mirroring always unidirectional from Active RP--> Standby RP
Configuration & Verification
File mirroring has to be enabled explicitly on the router. It is not enabled by default.
RP/0/RSP0/CPU0:router#show run mirror
!
mirror enable
!
Following is an example of copying running configuration to harddisk:/mirror location:
RP/0/RSP0/CPU0:router#copy running-config harddisk:/mirror/run_config
Wed Jul 8 10:25:51.064 PDT
Destination file name (control-c to abort): [/mirror/run_config]?
Building configuration..
32691 lines built in 2 seconds (16345)lines/sec
[OK]
RP/0/RSP0/CPU0:router#show mirror
Wed Jul 8 10:39:09.646 PDT
MIRROR DIR: /harddisk:/mirror/
% Last sync of this dir ended at Wed Jul 8 10:31:11 2020
Location |Mirrored |Modification Time
-----------------------------------------
run_config |yes |Wed Jul 8 10:25:56 2020
RP/0/RP0/CPU0:router# show mirror mismatch ( mirroring errors are mostly self explanatory)
Wed Jul 8 10:31:21.644 PDT
MIRROR DIR: /harddisk:/mirror/
% Last sync of this dir ended at Wed Jul 8 10:31:11 2020
Location |Mismatch Reason |Action Needed
------------------------------------------------
test.txt |newly created item. |send to standby
Limitations
The following limitations apply to file mirroring:
- Supported only on Dual RP systems.(of course)
- Supports syncing only from active to standby RP. If files are copied into standby /harddisk:/mirror location, it won’t be synced to active RP.
- Not supported on multichassis systems.