In two-phase validation mode, the system configuration process is divided into two phases. The actual configuration takes effect after the two phases are complete. Figure 1 shows the two phases of the system configuration process.
In the first phase, a user enters configuration commands. The system checks the data type, user level, and object to be configured, and checks whether there are repeated configurations. If syntax or semantic errors are found in the command line, the system displays a message on the terminal to inform the user of the error and cause.
In the second phase, the user commits the configuration. The system then enters the configuration commitment phase and commits the configuration in the candidate database to the running database.
If the configuration takes effect, the system adds it to the running database.
If the configuration fails, the system informs the user that the configuration is incorrect. The user can enter the command line again or change the configuration.
In two-phase validation mode, if a configuration has not been committed, the symbol "*" is displayed in the corresponding view (except the user view). If all configurations have been configured, the symbol "~" is displayed in the corresponding view (except the user view).
The two-phase validation mode uses the following databases:
A configuration set that is currently being used by the system.
For each user, the system generates a mapping of the running database. Users can edit the configuration in the candidate database and commit the edited configuration to the running database.
After users enter the system view, the system assigns each user a candidate database. Users perform configuration operations in their candidate databases, and the system checks the validity of each user's configurations.
In two-phase validation mode, the system checks configuration validity and displays error messages. The system checks the validity of the following configuration items:
The system checks whether configurations in the candidate databases are identical to those in the running database.
If configurations in the candidate databases are identical to those in the running database, the system does not commit the configuration to the running database and displays repeated configuration commands.
If configurations in the candidate databases are different from those in the running database, the system commits the configuration to the running database.
Commands available for each user level
Existence of the object to be configured
As shown in Figure 2, multiple users can perform concurrent configuration operations on the same device.
The two-phase validation mode offers the following benefits:
Allows several service configurations to take effect as a whole.
Allows users to preview configurations in the candidate database.
Clears configurations that do not take effect if an error occurs or the configuration does not meet expectations.
Minimizes the impact of configuration procedures on the existing services.