This section describes how to replace the configurations on multiple devices that share the same source to achieve configuration consistency between the devices.
In a scenario where a management server manages a device, the server stores the configurations required by the device. If the configurations on the management server change, the configurations on the device also need to be changed accordingly. In this case, you can load the configuration file on the management server and use this file to replace the configurations on the device, achieving configuration consistency between the management server and the device.
If one of the devices with the same configurations encounters a configuration change, the configurations of other devices must be changed accordingly to keep configuration consistency. In this case, you can load the configurations on the device with the configuration change to replace the configurations on the other devices. This ensures that the configurations on all the devices are the same.
The configuration replacement function can replace the entire configuration file on the current device or the configuration in a specific view, depending on the content in the source configuration file to be loaded. If the source configuration file contains the configurations of an entire device, this function replaces all configurations on the current device. If the source configuration file contains the configurations only in a specific view (the configurations saved in a view automatically carry the <replace/> tag), this function replaces the configurations in the corresponding view.
This function is supported only in the two-phase configuration validation mode.
To load the configuration file of a local device to replace the current running configurations, perform the following steps on the local device:
If a local configuration file is loaded to replace the current device configuration, the local configuration file must be stored in the root directory of the device. The save command saves a configuration file to the root directory by default.
If you run the command in a non-user view, the configuration-file parameter must be specified and the file name extension must be .zip or .cfg.