This article describes how multiple users can edit different parts of a configuration simultaneously by using private configuration mode.
The configure private command allows multiple users to edit different parts of a configuration at the same time and commit only their changes or roll back, without interfering with each other's changes. When the configure private command is used, you work in a private candidate configuration, which is a copy of the most recently committed configuration.
configure private
When you commit a private candidate configuration, the Junos OS software temporarily locks the global configuration, enforces the restriction that the global configuration must be unmodified to commit private changes, and validates the private candidate configuration. If a merge conflict occurs, the commit fails and the configuration lock is released.
You can then modify your private candidate configuration and commit it again. If there are no errors, the changes being made in the private candidate configuration are merged with the most recently committed global configuration, activated, and run on the router. Also, the configuration lock is released.
Note : You cannot commit changes in configure private mode when another user is in configure exclusive mode.
configure exclusive
If the global configuration has changed, users who are in the configure private mode can issue the rollback or update command to obtain the most recently committed shared configuration.
rollback
update
You must issue the commit command from the top of the configuration. You cannot save a configure private session; uncommitted changes are discarded. Also you cannot issue the commit confirmed command when in configure private mode.
commit
commit confirmed
After an upgrade or downgrade of Junos OS software, you must use the normal configuration or configure exclusive mode to commit a configuration before using the configure private command.
normal configuration
If a configure private edit is in session, other users who have issued the configure command can view only the global configuration. A message is displayed, which indicates that these users must use the configure exclusive or configure private command to modify the configuration:
configure
[edit] user@host# set system host-name TEST error: private edits in use. Try 'configure private' or 'configure exclusive' [edit] user@host#
If the global configuration has been modified, users cannot enter configure private mode, because they cannot commit changes when the global configuration has been modified. For example:
user@host> configure private Users currently editing the configuration: root terminal d0 (pid 7951) on since 2020-12-25 14:18:46 PST error: shared configuration database modified user@host>
If another user commits a change to the same section of the configuration that a private user has modified, a merge conflict may occur. In this case, the Junos OS software updates the private user’s configuration with the most recently committed global configuration, and then allows the private user to commit the changes. For example:
[edit] user@host# set system host-name ROCKY [edit] user@host# show | compare [edit system] - host-name host; + host-name ROCKY; [edit] user@host# commit [edit system host-name] 'host-name bar' statement does not match patch; 'bar' != 'host' load complete (1 errors) [edit] user@host# show | compare [edit system] - host-name bar; + host-name ROCKY; [edit] user@host#
In this example, after the Junos OS software detects the merge conflict and fixes it, the user in configure private mode issues the show | compare command. This command displays the private user’s database changes against the most recently committed shared configuration.
show | compare
Updating the Configure Private Configuration
When in configure private mode, you must work with a copy of the most recently committed shared configuration. If the global configuration changes, you can issue the update command to update your private candidate configuration. When you do this, your private candidate configuration contains a copy of the most recently committed configuration with your private changes merged with it. For example:
[edit] user@host# update [edit] user@host#
Discarding the Private Configuration
You can also issue the rollback command to discard the private candidate configuration changes and obtain the most recently committed configuration:
[edit] user@host# rollback [edit] user@host#