- play_arrow Overview
- play_arrow Junos XML Management Protocol and Junos XML API Overview
- play_arrow Junos XML Protocol and Junos XML Tags Overview
- XML and Junos OS Overview
- XML Overview
- XML and Junos XML Management Protocol Conventions Overview
- Map Junos OS Commands and Command Output to Junos XML Tag Elements
- Map Configuration Statements to Junos XML Tag Elements
- Using Configuration Response Tag Elements in Junos XML Protocol Requests and Configuration Changes
- play_arrow Junos XML Protocol and JSON Overview
-
- play_arrow Manage Junos XML Protocol Sessions
- play_arrow Junos XML Protocol Session Overview
- play_arrow Manage Junos XML Protocol Sessions
- Satisfy the Prerequisites for Establishing a Connection to the Junos XML Protocol Server
- Configure clear-text or SSL Service for Junos XML Protocol Client Applications
- Connect to the Junos XML Protocol Server
- Start a Junos XML Protocol Session
- Authenticate with the Junos XML Protocol Server for Cleartext or SSL Connections
- Send Requests to the Junos XML Protocol Server
- Parse the Junos XML Protocol Server Response
- Parse Response Tag Elements Using a Standard API in NETCONF and Junos XML Protocol Sessions
- How Character Encoding Works on Juniper Networks Devices
- Handle an Error or Warning in Junos XML Protocol Sessions
- Halt a Request in Junos XML Protocol Sessions
- Lock, Unlock, or Create a Private Copy of the Candidate Configuration Using the Junos XML Protocol
- Terminate a Junos XML Protocol Session
- End a Junos XML Protocol Session and Close the Connection
- Sample Junos XML Protocol Session
- play_arrow Junos XML Protocol Tracing Operations
- play_arrow Junos XML Protocol Operations
- play_arrow Junos XML Protocol Processing Instructions
- play_arrow Junos XML Protocol Response Tags
- play_arrow Junos XML Element Attributes
- active
- count
- delete
- inactive
- insert
- junos:changed
- junos:changed-localtime
- junos:changed-seconds
- junos:commit-localtime
- junos:commit-seconds
- junos:commit-user
- junos:group
- junos:interface-range
- junos:key
- junos:position
- junos:total
- matching
- protect
- recurse
- rename
- replace
- replace-pattern
- start
- unprotect
- xmlns
-
- play_arrow Request Operational and Configuration Information Using the Junos XML Protocol
- play_arrow Request Operational Information Using the Junos XML Protocol
- play_arrow Request Configuration Information Using the Junos XML Protocol
- Request Configuration Data Using the Junos XML Protocol
- Specify the Source for Configuration Information Requests in a Junos XML Protocol Session
- Specify the Output Format for Configuration Data in a Junos XML Protocol Session
- Request Commit-Script-Style XML Configuration Data Using the Junos XML Protocol
- Specify the Output Format for Configuration Groups and Interface Ranges Using the Junos XML Protocol
- Request Identifier Indicators for Configuration Elements Using the Junos XML Protocol
- Request Change Indicators for Configuration Elements Using the Junos XML Protocol
- Specify the Scope of Configuration Data to Return in a Junos XML Protocol Session
- Request the Complete Configuration Using the Junos XML Protocol
- Request a Configuration Hierarchy Level or Container Object Without an Identifier Using the Junos XML Protocol
- Request All Configuration Objects of a Specific Type Using the Junos XML Protocol
- Request a Specific Number of Configuration Objects Using the Junos XML Protocol
- Request Identifiers for Configuration Objects of a Specific Type Using the Junos XML Protocol
- Request a Single Configuration Object Using the Junos XML Protocol
- Request Subsets of Configuration Objects Using Regular Expressions
- Request Multiple Configuration Elements Using the Junos XML Protocol
- Retrieve a Previous (Rollback) Configuration Using the Junos XML Protocol
- Retrieve the Rescue Configuration Using the Junos XML Protocol
- Compare the Active or Candidate Configuration to a Prior Version Using the Junos XML Protocol
- Compare Two Previous (Rollback) Configurations Using the Junos XML Protocol
- Request an XML Schema for the Configuration Hierarchy Using the Junos XML Protocol
-
- play_arrow Junos XML Protocol Utilities
- play_arrow Develop Junos XML Protocol C Client Applications
-
- play_arrow Configuration Statements and Operational Commands
ON THIS PAGE
How to Configure GRES-Enabled Devices to Synchronize Ephemeral Configuration Data
How to Synchronize an Ephemeral Instance on a Per-Commit Basis
How to Synchronize an Ephemeral Instance on a Per-Session Basis
How to Automatically Synchronize an Ephemeral Instance Upon Commit
How to Configure Failover Configuration Synchronization for the Ephemeral Database
Commit and Synchronize Ephemeral Configuration Data Using the NETCONF or Junos XML Protocol
Committing an Ephemeral Instance Overview
The ephemeral database is an alternate configuration database that enables NETCONF and Junos XML protocol client applications to simultaneously load and commit configuration changes on Junos devices and with significantly greater throughput than when committing data to the candidate configuration database. Client applications can commit the configuration data in an open instance of the ephemeral configuration database so that it becomes part of the active configuration on the device. When you commit ephemeral configuration data on a device, the device’s active configuration is a merged view of the static and ephemeral configuration databases.
The ephemeral commit model validates the syntax but not the semantics, or constraints, of the configuration data committed to the ephemeral database. You must validate all configuration data before loading it into the ephemeral database and committing it on the device. Committing invalid configuration data can cause Junos processes to restart or even crash and result in disruption to the system or network.
After a client application commits an ephemeral instance, the device merges the configuration data into the ephemeral database. The affected system processes parse the configuration and merge the ephemeral data with the data in the active configuration. If there are conflicting statements in the static and ephemeral configuration databases, the data is merged according to specific rules of prioritization. The database priority, from highest to lowest, is as follows:
Statements in a user-defined instance of the ephemeral configuration database.
If there are multiple user-defined ephemeral instances, the priority is determined by the order in which the instances are configured at the
[edit system configuration-database ephemeral]
hierarchy level, running from highest to lowest priority.Statements in the default ephemeral database instance.
Statements in the static configuration database.
Applications can simultaneously load and commit data to different ephemeral database instances in addition to the static configuration database. However, the device processes the commits sequentially. As a result, the commit to a specific database might be delayed, depending on the processing order.
If you commit ephemeral configuration data that is invalid or results in undesirable network disruption, you must delete the problematic data from the database, or if necessary, reboot the device, which deletes the configuration data in all instances of the ephemeral configuration database.
The active device configuration is a merged view of the static and ephemeral
configuration databases. However, when you display the configuration in the CLI
using the show configuration
operational mode command, the
output does not include ephemeral configuration data. In the CLI, you can
display the data in a specific instance of the ephemeral database or display a
merged view of the static and ephemeral configuration databases by using
variations of the show ephemeral-configuration
command.
How to Commit an Ephemeral Instance
Client applications can commit the configuration data in an open instance of the
ephemeral configuration database so that it becomes part of the active
configuration on the device. To commit the configuration, use the
<commit-configuration/>
operation in a Junos XML
protocol session or the <commit-configuration/>
or
<commit/>
operation in a NETCONF session.
In a Junos XML protocol session, a client application commits the configuration
data in an open instance of the ephemeral configuration database by enclosing
the <commit-configuration/>
tag in an
<rpc>
tag element (just as for the
candidate configuration).
<rpc> <commit-configuration/> </rpc>
The Junos XML protocol server reports the results of the commit operation in
<rpc-reply>
, <commit-results>
,
and <routing-engine>
tag elements. If the commit
operation succeeds, the <routing-engine>
tag element
encloses the <commit-success/>
tag and the
<name>
tag element, which specifies the target
Routing Engine.
<rpc-reply xmlns:junos="URL"> <commit-results> <routing-engine> <name>routing-engine-name</name> <commit-success/> </routing-engine> </commit-results> </rpc-reply>
In a NETCONF session, a client application commits the configuration data in an
open instance of the ephemeral configuration database by enclosing the
<commit/>
or
<commit-configuration/>
tag in an
<rpc>
tag element (just as for the
candidate configuration).
<rpc> <commit/> </rpc> ]]> ]]>
<rpc> <commit-configuration/> </rpc> ]]> ]]>
The NETCONF server confirms that the commit operation was successful by returning
the <ok/>
tag in an <rpc-reply>
tag element.
<rpc-reply xmlns="URN" xmlns:junos="URL"> <ok/> </rpc-reply> ]]> ]]>
If the commit operation fails, the NETCONF server returns the
<rpc-reply>
element and
<rpc-error>
child element, which explains the reason
for the failure.
The only variant of the commit operation supported for the ephemeral database is synchronizing the configuration, as described in Synchronizing an Ephemeral Instance Overview.
Synchronizing an Ephemeral Instance Overview
Dual Routing Engine devices and Virtual Chassis systems do not automatically synchronize ephemeral configuration data when you issue a commit operation on an ephemeral instance. You can synchronize the data in an ephemeral instance on a per-commit or per-session basis, or you can configure an ephemeral instance to synchronize its data every time you commit the instance. The environment determines where the data is synchronized, for example:
On devices with dual Routing Engines, the device synchronizes the ephemeral instance to the backup Routing Engine.
An MX Series Virtual Chassis synchronizes the ephemeral instance only to the backup device's primary Routing Engine.
An EX Series Virtual Chassis synchronizes the ephemeral instance to all members switches.
Multichassis environments do not support synchronizing the ephemeral configuration database to the backup Routing Engine on the respective Virtual Chassis member.
See the following sections for instructions on synchronizing ephemeral instances:
How to Configure GRES-Enabled Devices to Synchronize Ephemeral Configuration Data
How to Synchronize an Ephemeral Instance on a Per-Commit Basis
How to Synchronize an Ephemeral Instance on a Per-Session Basis
How to Automatically Synchronize an Ephemeral Instance Upon Commit
How to Configure Failover Configuration Synchronization for the Ephemeral Database
By default, the ephemeral commit model executes commit synchronize operations asynchronously. The NETCONF or Junos XML protocol server commits the configuration on the local Routing Engine and then commits the configuration on the remote Routing Engine or Virtual Chassis members. The requesting Routing Engine commits the ephemeral configuration and emits a commit complete notification without waiting for the other Routing Engine or Virtual Chassis members to first synchronize and commit the configuration.
On supported devices, you can also configure the ephemeral database to use a
synchronous commit model for commit synchronize operations. Synchronous commit
operations are slower but more reliable than asynchronous commit operations. To
use the synchronous model, configure the
commit-synchronize-model synchronous
statement at the
[edit system configuration-database ephemeral]
hierarchy
level in the static configuration database.
When you synchronize an ephemeral instance, the Junos XML protocol server reports
the results of the commit operation for the local Routing Engine in
<rpc-reply>
, <commit-results>
,
and <routing-engine>
tag elements. If the commit
operation succeeds, the <routing-engine>
tag element
encloses the <commit-success/>
tag and the
<name>
tag element, which specifies the target
Routing Engine.
The server reply includes additional tags that depend on the commit synchronize model used by the database.
If the ephemeral database uses the synchronous model, the server reply includes a second
<routing-engine>
element for the commit operation on the other Routing Engine.If the ephemeral database uses the asynchronous model, the server includes the
<commit-synchronize-server-success>
tag element, which indicates that the synchronize operation is scheduled on the other Routing Engine or Virtual Chassis members and provides the estimated time in seconds required for the operation to complete.
For example:
<rpc-reply xmlns:junos="URL"> <commit-results> <routing-engine> <name>re0</name> <commit-success/> </routing-engine> </commit-results> <commit-synchronize-server-success> <current-job-id>0</current-job-id> <number-of-jobs>1</number-of-jobs> <estimated-time>60</estimated-time> </commit-synchronize-server-success> </rpc-reply>
The RPC reply for synchronous commit synchronize operations indicates the success or failure of the commit operation on the other Routing Engine or Virtual Chassis members. The device records the success or failure of asynchronous commit synchronize operations in the system log file, provided the device is configured to log events of the given facility and severity level. See the System Log Explorer for the various ephemeral database events and the facility and severity levels required to log them.
Similarly, in NETCONF sessions, the server confirms that the commit operation was
successful by returning the <ok/>
tag in an
<rpc-reply>
tag element. Depending on the device
configuration, the response may also include the
<commit-results>
element for synchronous commit
synchronize operations or the
<commit-synchronize-server-success>
element for
asynchronous commit synchronize operations. For example:
<rpc-reply xmlns="URN" xmlns:junos="URL"> <ok/> <commit-synchronize-server-success> <current-job-id>0</current-job-id> <number-of-jobs>1</number-of-jobs> <estimated-time>60</estimated-time> </commit-synchronize-server-success> </rpc-reply> ]]>]]>
The device does not synchronize the ephemeral configuration database to the
other Routing Engine or Virtual Chassis members when you issue the
commit synchronize
command on the static configuration
database.
How to Configure GRES-Enabled Devices to Synchronize Ephemeral Configuration Data
By default, the ephemeral database performs commit synchronize operations
asynchronously and does not synchronize ephemeral configuration data to the
backup Routing Engine or other Virtual Chassis members when you enable graceful
Routing Engine switchover (GRES). If the ephemeral database uses the
asynchronous commit synchronize model, you must configure the
allow-commit-synchronize-with-gres
statement to allow
GRES-enabled devices to perform commit synchronize operations.
Alternatively, on supported devices, you can instead configure the ephemeral database to use a synchronous commit model to perform commit synchronize operations. Synchronous commit operations are slower but more reliable than asynchronous commit operations. We recommend that you use the synchronous commit model on devices that have GRES enabled.
To enable devices that have GRES configured to synchronize ephemeral configuration data:
How to Synchronize an Ephemeral Instance on a Per-Commit Basis
You can synchronize an ephemeral instance across Routing Engines or Virtual Chassis members for a given commit operation on that instance.
To synchronize an ephemeral instance on a per-commit basis:
How to Synchronize an Ephemeral Instance on a Per-Session Basis
You can synchronize an ephemeral instance across Routing Engines or Virtual Chassis members for all commit operations performed for the duration that the ephemeral instance is open, which we are loosely referring to as a session. This should not be confused with the NETCONF or Junos XML protocol session. Synchronizing the instance on a per-session basis enables you to execute multiple load and commit operations and ensure that each commit operation automatically synchronizes the instance until you close it.
To synchronize an ephemeral instance for all commit operations performed for the duration that the instance is open:
How to Automatically Synchronize an Ephemeral Instance Upon Commit
On devices running Junos OS Release 22.1R1 or later and devices running Junos OS Evolved, you can configure an ephemeral instance so that it synchronizes its configuration across Routing Engines or Virtual Chassis members every time you commit the instance.
To configure the ephemeral instance to synchronize every time you commit the instance:
After you add the synchronize
statement at the [edit
system commit]
hierarchy level in the ephemeral instance's
configuration, the device automatically synchronizes the instance to the other
Routing Engine or Virtual Chassis members whenever you commit that instance,
provided that the device meets the necessary requirements for synchronizing the
database.
How to Configure Failover Configuration Synchronization for the Ephemeral Database
MX Series Virtual Chassis and dual Routing Engine devices support failover
configuration synchronization for the ephemeral database, which helps ensure
that the configuration database is synchronized between Routing Engines in the
event of a Routing Engine switchover. This is achieved when you configure the
commit synchronize
statement at the [edit
system]
hierarchy level in the static configuration database.
If you configure the commit synchronize
statement in the static
configuration database, it has the following effects:
The device synchronizes its static configuration database to the backup Routing Engine or MX Virtual Chassis backup device during a commit operation.
Note:Configuring the
commit synchronize
statement in the static configuration database does not synchronize an ephemeral instance to the backup device when you commit the static configuration database or when you commit the instance.Starting in Junos OS Release 20.2R1, the backup Routing Engine and the MX Virtual Chassis backup device synchronize both the static and ephemeral configuration databases when they synchronize with the primary device. In earlier releases, the backup Routing Engine only synchronizes the static configuration database.
Note:For failover synchronization, the backup Routing Engine and the MX Virtual Chassis backup device only synchronize the ephemeral configuration database with the primary device if both the backup device and the primary device are running the same software version.
When you configure the commit synchronize
statement on the
primary and backup Routing Engines, the backup Routing Engine synchronizes its
configuration with the primary Routing Engine in the following scenarios:
The backup Routing Engine is removed and reinserted
The backup Routing Engine is rebooted
The device performs a graceful Routing Engine switchover
There is a manual change in roles
A new backup Routing Engine is inserted that has the
commit synchronize
statement configured
On a dual Routing Engine system, the backup Routing Engine synchronizes its configuration databases with the primary Routing Engine. In an MX Series Virtual Chassis, the primary Routing Engine on the backup device synchronizes its configuration databases with the primary Routing Engine on the primary device.
To enable failover configuration synchronization for both the static and ephemeral databases on supported devices running Junos OS Release 20.2R1 or later or devices running Junos OS Evolved:
Change History Table
Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.
synchronize
statement at the [edit system
commit]
hierarchy level in the static configuration database, the
backup Routing Engine synchronizes both the static and ephemeral configuration
databases when it synchronizes with the primary Routing Engine. In earlier
releases, the backup Routing Engine only synchronizes the static configuration
database.