Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

gNOI Operating System (OS) Service

Use the gNOI operating system (OS) service to upgrade the software on the target network device.

You can use the gNOI OS service to upgrade software on the target device. The proto definition file is located at https://github.com/openconfig/gnoi/blob/master/os/os.proto.

Software installation has three main steps, which correspond to the OS service RPCs.

  • Install
  • Activate
  • Verify

You can use the OS service RPCs to transfer a software installation package to the device, validate the configuration against a specified software version, and install software. You can also set an installed software version as the next boot version and verify the software version.

Note:

You can also use the gNOI system service SetPackage() RPC to install software on a device. For more information, see gNOI System Service.

Supported RPCs

Table 1: Supported os.proto RPCs
RPC Description Introduced in Release
Activate()

Set the software version that is used at the next reboot.

Activate() reboots the target if the no_reboot flag is omitted or set to False. If the reboot fails to boot the requested software version, the target rolls back to the previous version.

Note:

Junos devices do not support the standby_supervisor field in the ActivateRequest message.

Note:

Prior to Junos OS Evolved Release 25.2R1, Activate() validates the current configuration against the software, installs the software, and sets the software version as the next boot version.

Junos OS Evolved 22.2R1

Install()

Transfer a software installation package to the target, validate the configuration against the software, and install (stage) the software.

If the specified software image is already installed on the device, validate the current configuration against the software image and store the validated configuration as the running configuration associated with that software version.

Note:

Junos devices do not support the standby_supervisor field in the TransferRequest message.

Note:

Prior to Junos OS Evolved Release 25.2R1, Install() only transfers the software installation package to the target.

Junos OS Evolved 22.2R1

Verify()

Check the running software version. This RPC may be called multiple times while the target boots until successful.

Note:

Junos devices do not support verify_standby for VerifyResponse.

Junos OS Evolved 22.2R1

OS Service Overview

The gNOI OS service RPCs enable you to manage the software on devices running Junos OS Evolved. Junos OS Evolved stores multiple versions of software on the storage media. For each software version, Junos OS Evolved also stores the configuration that was running at the time the software version was running last.

Table 2 outlines the RPC operations in the different Junos OS Evolved releases. Starting in Junos OS Evolved Release 25.2R1, you can install software without immediate activation, validate the current configuration against any installed software version, and activate any installed software version.

Table 2: OS Service RPC Changes

RPC

Junos OS Evolved Release 24.4R1 and Earlier

Junos OS Evolved Release 25.2R1 and Later

Install()

Transfer the software installation package to the device.

Transfer the software installation package to the device.

Validate the current configuration against the specified software version (new or previously installed).

Install the software, if the specified software version is not already installed.

Store the validated current configuration as the running configuration associated with the specified software version.

Activate()

Validate the current configuration against the specified software version.

Install the software.

Set the specified software version as the next boot version.

Set the specified software version as the next boot version.

(Optional) Reboot the device.

(Optional) Reboot the device.

Verify()

Check the running software version.

Check the running software version.

In Junos OS Evolved Release 25.2R1 and later, the Install() RPC transfers the specified software installation package to the /var/tmp/ directory on the target device, validates the configuration against the software, and installs the software, if that software version is not already installed on the device. The destination filename is the value defined in the TransferRequest message's version field. The Activate() RPC sets the specified software version as the next boot version and optionally reboots the device to activate the software. You can activate any installed software version.

If you run Install() and specify an existing software version, Install() validates the current configuration against the software and stores the validated configuration as the running configuration associated with that software version. If the software version is set as the next boot version, Install() deactivates it in the process. Thus you can verify that a specific software version will work with any recent configuration changes.

Network Device Configuration

Before you begin:

No additional configuration is required to use the OS service RPCs.

Example: Install and Activate

In this example, the client executes the gnoi_os_install_activate.py Python application, which performs the following operations:

  • Copies the software package from the local network management system to the network device.

  • Validates the configuration against the software image.

  • Installs the package on the network device.

  • Reboots the network device, thus activating the new software image.

The application calls the Install() RPC with the InstallRequest() message to transfer the file. The application tracks the progress of the file transfer by emitting progress messages at each 10 percent transfer completion interval. If the file transfer is successful, the system validates the configuration against the software image, performs a storage cleanup, and installs the image. The application then calls the Activate() RPC to set the new image as the next boot image and reboot the target.

The application imports the grpc_channel module to establish the channel. The grpc_channel module is described in Configure gNOI Services. The application's arguments are stored in the args_os_install_activate.txt file. The application and argument files are as follows:

gnoi_os_install_activate.py

args_os_install_activate.txt

Note:

Starting in Junos OS Evolved Release 23.4R1, the version field in the Activate(), Install(), and Verify() RPCs uses the software version string (as displayed in /system/state/software-version) instead of the package name.

Execute the Application

When the client executes the application, the application copies the package from the local device to the /var/tmp directory on the network device, installs the package, and then reboots the device to complete the installation.

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.

Release
Description
25.2R1-EVO
Starting in Junos OS Evolved Release 25.2R1, the Install() RPC copies the software installation package to the device, validates the configuration against the specified software version, and installs the software, and the Activate() RPC sets the specified software version as the next boot version. In earlier releases, Install() copies the software installation package to the device, and Activate() validates the configuration against the software, installs the software, and sets the software version as the next boot version.
25.2R1-EVO
Starting in Junos OS Evolved Release 25.2R1, you can execute the Install() RPC on an installed software image to validate the current configuration against the software image and store the validated configuration as the running configuration associated with that software version.
23.4R1-EVO
Starting in Junos OS Evolved Release 23.4R1, the version field in the Activate(), Install(), and Verify() RPCs uses the software version string (as displayed in /system/state/software-version) instead of the package name.