Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Enabling and Configuring Instances of the Ephemeral Configuration Database

 

The ephemeral database is an alternate configuration database that enables multiple client applications to concurrently load and commit configuration changes to a device running Junos OS and with significantly greater throughput than when committing data to the candidate configuration database. Junos OS provides a default ephemeral database instance as well as the ability to enable and configure multiple user-defined instances of the ephemeral configuration database.

NETCONF and Junos XML protocol client applications and JET applications can update the ephemeral configuration database. The following sections detail how to enable instances of the ephemeral configuration database on devices running Junos OS, configure the instances using NETCONF and Junos XML protocol operations, and display ephemeral configuration data in the Junos OS CLI. For information about using JET applications to configure the ephemeral configuration database, see the Juniper Extension Toolkit Documentation.

Enabling Ephemeral Database Instances

The default ephemeral database instance is automatically enabled on devices running Junos OS that support configuring the ephemeral database. However, you must configure all user-defined instances of the ephemeral configuration database before using them. See Feature Explorer to verify the hardware platforms and software releases that support the ephemeral database.

To enable a user-defined instance of the ephemeral configuration database:

  1. Configure the name of the instance, which must contain only alphanumeric characters, hyphens, and underscores and must not exceed 32 characters in length or use default as the name.
    Note

    Junos OS determines the priority of ephemeral database instances by the order in which they are listed in the configuration. By default, newly configured instances are placed at the end of the list and have lower priority when resolving conflicting configuration statements. When you configure a new instance, you can specify its placement in the configuration by using the insert command instead of the set command.

    Note

    Starting in Junos OS Release 17.1R3, 17.2R3, 17.3R3, 17.4R2, and 18.1R1, the name of an user-defined ephemeral database instance cannot be default.

  2. Commit the configuration.
Note

When you configure statements at the [edit system configuration-database ephemeral] hierarchy level and commit the configuration, all Junos OS processes must check and evaluate their complete configuration, which might cause a spike in CPU utilization, potentially impacting other critical software processes.

Configuring Ephemeral Database Options

You can configure several options for the ephemeral configuration database, which are outlined in this section.

  1. (Optional) To disable the default instance of the ephemeral configuration database, configure the ignore-ephemeral-default statement.
  2. (Optional) When graceful Routing Engine switchover (GRES) is enabled, configure the allow-commit-synchronize-with-gres statement to enable the device to synchronize an ephemeral instance to the other Routing Engine when you request a commit synchronize operation on that instance.
  3. Commit the configuration.
Note

When you configure statements at the [edit system configuration-database ephemeral] hierarchy level and commit the configuration, all Junos OS processes must check and evaluate their complete configuration, which might cause a spike in CPU utilization, potentially impacting other critical software processes.

Opening Ephemeral Database Instances

A client application must open an ephemeral database instance before viewing or modifying it. Within a NETCONF or Junos XML protocol session, a client application opens the ephemeral database instance by using the Junos XML protocol <open-configuration> operation with the appropriate child tags. Opening the ephemeral instance automatically acquires an exclusive lock on it.

Note

To configure devices running Junos OS using NETCONF, the NETCONF-over-SSH service must be enabled on the device. NETCONF sessions must also include the closing sequence ]]>]]> at the end of each remote procedure call (RPC) request.

  • To open the default instance of the ephemeral database, a client application emits the <open-configuration> element and includes the <ephemeral/> child tag.

  • To open a user-defined instance of the ephemeral database, a client application emits the <open-configuration> element and includes the <ephemeral-instance> element and the instance name.

Configuring Ephemeral Database Instances

Client applications update the ephemeral configuration database using NETCONF and Junos XML protocol operations. Only a subset of the operations’ attributes and options are available for use when updating the ephemeral configuration database. For example, the ephemeral database only supports certain load operations, and options and attributes that reference groups, interface ranges, or commit scripts, or that roll back the configuration cannot be used with the ephemeral database.

Client applications load and commit configuration data to an open instance of the ephemeral configuration database. Configuration data can be uploaded in any of the supported formats including Junos XML elements, formatted ASCII text, set commands, or JavaScript Object Notation (JSON). By default, if a client disconnects from a session or closes the ephemeral database instance before committing new changes, Junos OS discards any uncommitted data, but configuration data that has already been committed to the ephemeral database instance by that client is unaffected.

To update, commit, and close an open instance of the ephemeral configuration database, client applications perform the following tasks:

  1. Load configuration data into the ephemeral database instance by performing one or more load operations.

    Client applications emit the <load-configuration> operation in a Junos XML protocol session or the <load-configuration> or <edit-config> operation in a NETCONF session and include the appropriate attributes and tags for the data.



    Note

    Starting in Junos OS Release 18.1R1, the ephemeral configuration database supports loading configuration data using the <load-configuration> action attribute values of override and replace in addition to the previously supported values of merge and set.

    Note

    The only acceptable format for action="set" is "text". For more information about the <load-configuration> operation, see <load-configuration>.

    Note

    The target value <candidate/> can refer to either the open configuration database, or if there is no open database, to the candidate configuration. If a client application issues the Junos XML protocol <open-configuration> operation to open an ephemeral instance before executing the <edit-config> operation, Junos OS performs the <edit-config> operation on the open instance of the ephemeral configuration database. Otherwise, the operation is performed on the candidate configuration.

    Note

    Commit operations on the ephemeral configuration database generate system log messages, but load operations do not.

  2. (Optional) Review the updated configuration in the open ephemeral instance by emitting the <get-configuration/> operation in a Junos XML protocol session or the <get-configuration/> or <get-config> operation in a NETCONF session.
  3. Commit the configuration changes by emitting the <commit-configuration/> operation in a Junos XML protocol session or the <commit-configuration/> or <commit/> operation in a NETCONF session.

    Include the <synchronize/> tag in the <commit-configuration> element to synchronize the data to either the other Routing Engine on a dual Routing Engine platform or to the backup router’s master Routing Engine in an MX Series Virtual Chassis.

    Note

    After a client application commits changes to the ephemeral database instance, Junos OS merges the ephemeral data into the active configuration according to the rules of prioritization.

  4. Repeat steps 1 through 3 for any subsequent updates to the ephemeral database instance.
  5. Close the ephemeral database instance, which releases the exclusive lock.

Displaying Ephemeral Configuration Data in the Junos OS CLI

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 command in operational mode, the output does not include ephemeral configuration data. 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 in the CLI by using variations of the show ephemeral-configuration command.

Starting in Junos OS Release 18.2R1, the show ephemeral-configuration operational mode command uses a different syntax and supports filtering for displaying specific hierarchy levels. The new syntax is as follows:

  • To view the configuration data in the default instance of the ephemeral configuration database, issue the show ephemeral-configuration instance default command.

    user@host> show ephemeral-configuration instance default
  • To view the configuration data in a user-defined instance of the ephemeral configuration database, issue the show ephemeral-configuration instance instance-name command.

    user@host> show ephemeral-configuration instance instance-name
  • To view the complete post-inheritance configuration merged with the configuration data in all instances of the ephemeral database, issue the show ephemeral-configuration merge command.

    user@host> show ephemeral-configuration merge
  • To specify the scope of the configuration data to display, append the statement path of the requested hierarchy to the command. For example, the following command displays the configuration data at the [edit system] hierarchy level in the default instance of the ephemeral configuration database.

    user@host> show ephemeral-configuration instance default system

In Junos OS Release 18.1 and earlier releases:

  • To view the configuration data in the default instance of the ephemeral configuration database, issue the show ephemeral-configuration command.

    user@host> show ephemeral-configuration
  • To view the configuration data in a user-defined instance of the ephemeral configuration database, issue the show ephemeral-configuration instance-name command.

    user@host> show ephemeral-configuration instance-name
  • To view the complete post-inheritance configuration merged with the configuration data in all instances of the ephemeral database, issue the show ephemeral-configuration | display merge command.

    user@host> show ephemeral-configuration |  display merge

Table 1 outlines the show ephemeral-configuration commands for the various releases.

Table 1: show ephemeral-configuration Command

Action

18.2R1 and Later Releases

18.1 and Earlier Releases

View the configuration data in the default ephemeral instance

show ephemeral-configuration instance default

show ephemeral-configuration

View the configuration data in a user-defined ephemeral instance

show ephemeral-configuration instance instance-name

show ephemeral-configuration instance-name

View the complete post-inheritance configuration merged with the configuration data in all instances of the ephemeral database

show ephemeral-configuration merge

show ephemeral-configuration | display merge

Release History Table
Release
Description
Starting in Junos OS Release 18.2R1, the show ephemeral-configuration operational mode command uses a different syntax and supports filtering for displaying specific hierarchy levels.
Starting in Junos OS Release 18.1R1, the ephemeral configuration database supports loading configuration data using the <load-configuration> action attribute values of override and replace in addition to the previously supported values of merge and set.