Use Junos PyEZ to Install Software on Junos Devices
The Junos PyEZ
jnpr.junos.utils.sw.SW
utility enables you to install or upgrade the software image on Junos devices.
The
install()
method installs the specified software package.
This topic discusses the supported deployment scenarios, how to specify the software image location, and the general installation process and options when using Junos PyEZ to upgrade a device. It also discusses how to use Junos PyEZ to perform more specialized upgrade scenarios such as a VM host upgrade, a unified in-service software upgrade (unified ISSU), or a nonstop software upgrade (NSSU) on devices that support these features.
Supported Deployment Scenarios
The Junos PyEZ
jnpr.junos.utils.sw.SW
utility enables you to install or upgrade the software image on an
individual Junos device or on the members in a mixed or non-mixed Virtual Chassis.
The following scenarios are supported:
-
Standalone devices with a single Routing Engine
-
Standalone devices equipped with dual Routing Engines
-
EX Series Virtual Chassis in mixed and non-mixed-mode configurations
-
QFX Series Virtual Chassis in mixed and non-mixed-mode configurations
-
Mixed EX Series and QFX Series Virtual Chassis
-
VM host upgrades on Routing Engines with VM Host Support
-
Deployment configurations that have some form of in-service features enabled, such as unified ISSU or NSSU
Starting in Junos PyEZ Release 2.6.8, you can use the member_id
argument to install a package on a specific member of an EX Series Virtual
Chassis.
The jnpr.junos.utils.sw.SW
utility does not support upgrading
devices in an MX Series Virtual Chassis, an SRX Series chassis cluster, or a
Virtual Chassis Fabric (VCF).
How to Specify the Software Image Location
When you use Junos PyEZ to install software on Junos devices, you can download
the software image to the configuration management server, and the
install()
method, by default, copies it to the target
device before performing the installation. You can also instruct the
install()
method to install an image that already resides
on the target device or resides at a URL that is reachable from the target
device.
Table 1 outlines the install()
method parameters that you must set
depending on the software package location. You must always include either the
package
or pkg_set
parameter in the
install()
method invocation.
Software Package Location |
|
|
|
---|---|---|---|
Configuration management server |
Omit or set to |
File path including the filename of the software package or packages on the local server running Junos PyEZ. |
(Optional) Path to the directory on the target device to which the package or packages will be copied. Default is /var/tmp. |
Target device |
Set to |
Filename of the software package or packages. |
(Optional) Path to the directory on the target device where the package or packages must already reside. Default is /var/tmp. |
URL |
– |
URL from the perspective of the target Junos device from which the software package is installed. |
– |
The package
argument is used to install software on a single
Junos device or on members in a non-mixed Virtual Chassis. The
package
argument is a string that specifies a single
software image. For example:
package = 'jinstall-13.3R1.8-domestic-signed.tgz'
The pkg_set
argument is used to install software on the members
in a mixed Virtual Chassis. It contains a list or tuple of strings that specify
the necessary software images, in no particular order, for the various Virtual
Chassis members. For example:
pkg_set=['jinstall-qfx-5-13.2X51-D35.3-domestic-signed.tgz', 'jinstall-ex-4300-13.2X51-D35.3-domestic-signed.tgz']
For packages residing on the local server running Junos PyEZ, when you omit the
no_copy
argument or set it to False
, the
server copies the specified software package to the device. Including the
package
argument causes the server to copy the package to
the target device (individual device or primary router or switch in a non-mixed
Virtual Chassis), and including the pkg_set
argument causes the
server to copy all packages in the list to the primary router or switch in a
mixed Virtual Chassis. By default, software images are placed in the
/var/tmp directory unless the
remote_path
argument specifies a different directory.
If you set the no_copy
argument to True, the necessary software
packages must already exist on the target device or Virtual Chassis primary
device before the installation begins. The packages must reside either in the
directory specified by the remote_path
argument, or if
remote_path
is omitted, in the default
/var/tmp directory.
Junos PyEZ also supports installing software images from a URL. In this case, the
package
or pkg_set
value must be a URL
from the perspective of the target Junos device. The package is copied over and
installed from the specified URL, and the no-copy
and
remote_path
arguments are ignored. For information about
specifying the format of the URL, see Format for Specifying Filenames and URLs in
Junos OS CLI Commands.
Installation Process Overview
To install a software
image on a Junos device, a Junos PyEZ application connects to the individual
device or to the primary device in a Virtual Chassis, creates an instance of the
SW
utility, and calls the install()
method
with any required or optional arguments. For
example:
from jnpr.junos import Device from jnpr.junos.utils.sw import SW pkg = 'junos-install-mx-x86-64-17.2R1.13.tgz' with Device(host='router1.example.net') as dev: sw = SW(dev) # In Junos PyEZ Release 2.4.1 and earlier, install() returns a Boolean # ok = sw.install(package=pkg, validate=True, checksum_algorithm='sha256') # In Junos PyEZ Release 2.5.0 and later, install() returns a tuple ok, msg = sw.install(package=pkg, validate=True, checksum_algorithm='sha256') print("Status: " + str(ok) + ", Message: " + msg) if ok: sw.reboot()
For the current list of install()
method
parameters, see install().
If the software package is located on the
configuration management server, and the no_copy
parameter is
omitted or set to False, the install()
method performs the
following operations before installing the software:
-
Computes the checksum of the local software package or packages using the algorithm specified in the
checksum_algorithm
argument, if the checksum is not already provided through thechecksum
argument. Acceptablechecksum_algorithm
values are"md5"
,"sha1"
, and"sha256"
. The default is"md5"
. -
Performs a storage cleanup on the target device to create space for the software package, unless
cleanfs
is set toFalse
. -
SCP or FTP copies the package to the
remote_path
directory, or ifremote_path
is not specified, to the /var/tmp directory, if a file with the same name and checksum does not already reside in the target location on the device. -
Computes the checksum of the remote file and compares it to the value of the local file.
After the software package is on the target device, whether downloaded there
initially, copied over from the configuration management server by the
install()
method, or copied from a URL by the target
device, the install()
method performs the following
operations:
-
Validates the configuration against the new package if the
validate
parameter is set to True -
Installs the package on all Routing Engines unless
all_re
is set toFalse
Starting in Release 2.1.5, Junos PyEZ, by default, upgrades all Routing
Engines on individual devices and members in a Virtual Chassis. In earlier
releases, or if all_re=False
, Junos PyEZ only upgrades the
Routing Engine to which it is connected.
Starting
in Junos PyEZ Release 2.5.0, the install()
method returns a
tuple that contains the status of the installation and a message string. In
earlier releases, the method returns only the status of the installation. The
status is True
if the installation is successful and
False
otherwise. The message string provides additional
information about the success or failure of the installation and can include
informational messages or error messages that are generated by Junos PyEZ or the
device. For
example:
Package junos-install-mx-x86-64-17.2R1.13.tgz couldn't be copied
The
install()
method does not automatically reboot the device.
To reboot or shut down the device after the installation is complete, call the
reboot()
or shutdown()
method,
respectively.
The following video presents a short Python session that demonstrates how to use Junos PyEZ to install Junos OS.
How to Specify Installation and Checksum Timeouts
Junos PyEZ performs operations over a NETCONF session. The default time for a NETCONF RPC to time out is 30 seconds. During the installation process, Junos PyEZ increases the RPC timeout interval to 1800 seconds (30 minutes) when copying and installing the package on the device and to 300 seconds (5 minutes) when computing the checksum. In some cases, the installation process or checksum calculation might exceed these time intervals.
To increase the timeout value for the installation process and the checksum
calculation, include the timeout
and
checksum_timeout
parameters, respectively, in the call to
the install()
method, and set them to appropriate values. For
example:
from jnpr.junos import Device from jnpr.junos.utils.sw import SW pkg = 'junos-install-mx-x86-64-17.2R1.13.tgz' with Device(host='router1.example.net') as dev: sw = SW(dev) # Starting in Release 2.5.0, install() returns a tuple instead of a Boolean ok, msg = sw.install(package=pkg, validate=True, timeout=2400, checksum_timeout=400) if ok: sw.reboot()
How to Log the Installation Process
The Junos PyEZ install process enables you to display or log the progress of the
installation by including the progress
argument in the
install()
method call. The argument is set to a callback
function, which must have a function prototype defined that includes the
Device
instance and report string arguments. You can also
set progress=True
to use sw.progress()
for
basic reporting.
The following example prints the installation progress using the
myprogress
function.
from jnpr.junos import Device from jnpr.junos.utils.sw import SW def myprogress(dev, report): print("host: %s, report: %s" % (dev.hostname, report)) pkg = 'junos-install-mx-x86-64-17.2R1.13.tgz' with Device(host='router1.example.net') as dev: sw = SW(dev) # Starting in Release 2.5.0, install() returns a tuple instead of a Boolean ok, msg = sw.install(package=pkg, validate=True, progress=myprogress) if ok: sw.reboot()
The progress output is in the user-defined format.
user@server:~$ python3 junos-pyez-install.py Found package. Installing: junos-install-mx-x86-64-17.2R1.13.tgz host: router1.example.net, report: computing checksum on local package: junos-install-mx-x86-64-17.2R1.13.tgz host: router1.example.net, report: cleaning filesystem ... host: router1.example.net, report: before copy, computing checksum on remote package: /var/tmp/junos-install-mx-x86-64-17.2R1.13.tgz host: router1.example.net, report: junos-install-mx-x86-64-17.2R1.13.tgz: 38682624 / 386795750 (10%) host: router1.example.net, report: junos-install-mx-x86-64-17.2R1.13.tgz: 77365248 / 386795750 (20%) host: router1.example.net, report: junos-install-mx-x86-64-17.2R1.13.tgz: 116047872 / 386795750 (30%) host: router1.example.net, report: junos-install-mx-x86-64-17.2R1.13.tgz: 154730496 / 386795750 (40%) host: router1.example.net, report: junos-install-mx-x86-64-17.2R1.13.tgz: 193413120 / 386795750 (50%) host: router1.example.net, report: junos-install-mx-x86-64-17.2R1.13.tgz: 232079360 / 386795750 (60%) host: router1.example.net, report: junos-install-mx-x86-64-17.2R1.13.tgz: 270761984 / 386795750 (70%) host: router1.example.net, report: junos-install-mx-x86-64-17.2R1.13.tgz: 309444608 / 386795750 (80%) host: router1.example.net, report: junos-install-mx-x86-64-17.2R1.13.tgz: 348127232 / 386795750 (90%) host: router1.example.net, report: junos-install-mx-x86-64-17.2R1.13.tgz: 386795750 / 386795750 (100%) host: router1.example.net, report: after copy, computing checksum on remote package: /var/tmp/junos-install-mx-x86-64-17.2R1.13.tgz host: router1.example.net, report: checksum check passed. host: router1.example.net, report: installing software ... please be patient ... host: router1.example.net, report: software pkgadd package-result: 0 Output: Installing package '/var/tmp/junos-install-mx-x86-64-17.2R1.13.tgz' ... ...
How to Perform a VM Host Upgrade
On devices that have Routing Engines with VM host support, Junos OS runs as a
virtual machine (VM) over a Linux-based host (VM host). A VM host upgrade
requires a VM Host Installation Package
(junos-vmhost-install-x.tgz) and
upgrades the host OS and compatible Junos OS. The upgrade is performed using the
request vmhost software add
operational mode command, which
corresponds to the <request-vmhost-package-add>
RPC.
Starting in Junos PyEZ Release 2.1.6, the sw.install()
method
supports the vmhost=True
argument for performing a VM host
upgrade. When the vmhost=True
argument is present, the
sw.install()
method performs the installation using the
<request-vmhost-package-add>
RPC instead of the
<request-package-add>
RPC.
The following example upgrades and reboots both the Junos OS and host OS on a single Routing Engine device:
from jnpr.junos import Device from jnpr.junos.utils.sw import SW with Device(host='switch1.example.net') as dev: sw = SW(dev) # Starting in Release 2.5.0, install() returns a tuple instead of a Boolean ok, msg = sw.install(package='junos-vmhost-install-qfx-x86-64-18.1R1.9.tgz', vmhost=True, no_copy=True) if ok: sw.reboot(vmhost=True)
To reboot just the Junos OS software, call the sw.reboot()
method without the vmhost
argument.
How to Perform a Unified ISSU or NSSU
Junos PyEZ provides support for performing a unified in-service software upgrade (unified ISSU) or a nonstop software upgrade (NSSU) on devices that support the feature and meet the necessary requirements. Table 2 outlines the Junos PyEZ release in which the unified ISSU and NSSU features are first supported. For more information about unified ISSU and NSSU, see the software documentation for your product.
Junos PyEZ Release |
Feature Support |
---|---|
2.1.0 |
Support for unified ISSU and NSSU on dual-Routing Engine Junos devices. |
2.1.6 |
Support for unified ISSU during a VM host upgrade for those
devices with VM host support that use the |
The unified ISSU feature enables you to upgrade between two different Junos OS
releases with no disruption on the control plane and with minimal disruption of
traffic. To perform a unified in-service software upgrade on devices that
support this feature, include the issu=True
argument in the
install()
method.
In the the following example, the install()
method upgrades
Junos OS on both Routing Engines and reboots the new primary Routing Engine
(previously the old backup Routing Engine) as part of the installation process.
If the installation is successful, the reboot()
method then
reboots the connected Routing Engine, which is the new backup Routing Engine
(previously the old primary Routing Engine).
from jnpr.junos import Device from jnpr.junos.utils.sw import SW pkg = 'junos-install-mx-x86-64-17.2R1.13.tgz' with Device(host='router1.example.net') as dev: sw = SW(dev) # Starting in Release 2.5.0, install() returns a tuple instead of a Boolean ok, msg = sw.install(package=pkg, issu=True, progress=True) if ok: sw.reboot(all_re=False)
To perform a unified in-service software upgrade on a Routing Engine with VM host
support that meets the necessary requirements and supports unified ISSU, include
the vmhost=True
and issu=True
arguments in the
install()
method. The device upgrades from one host OS and
Junos OS release to the requested release using the
<request-vmhost-package-in-service-upgrade>
RPC.
sw.install(package='junos-vmhost-install-qfx-x86-64-18.1R1.9.tgz', vmhost=True, issu=True, progress=True)
The NSSU feature enables you to upgrade the Junos OS software running on a switch
or Virtual Chassis with redundant Routing Engines with minimal disruption to
network traffic. To perform a nonstop software upgrade on devices that support
this feature, include the nssu=True
argument in the
install()
method. For example:
from jnpr.junos import Device from jnpr.junos.utils.sw import SW pkg = 'jinstall-ex-4300–14.1X53-D44.3-domestic-signed.tgz' with Device(host='switch1.example.net') as dev: sw = SW(dev) # Starting in Release 2.5.0, install() returns a tuple instead of a Boolean ok, msg = sw.install(package=pkg, nssu=True, progress=True) if ok: sw.reboot(all_re=False)
How to Install Software on an EX Series Virtual Chassis Member
Generally, when you upgrade a non-mixed EX Series Virtual Chassis, you follow the
installation process outlined in Installation Process Overview to upgrade the
entire Virtual Chassis. However, there might be times when you need to install
software on specific member switches in a Virtual Chassis. Starting in Junos
PyEZ Release 2.6.8, you can install a software package on individual member
switches in an EX Series Virtual Chassis by using the member_id
argument. The member_id
argument is a list of strings
specifying the member IDs on which to install the software.
For example, the following Junos PyEZ application upgrades the software on member 0 and member 1 in the EX Series Virtual Chassis:
from jnpr.junos import Device from jnpr.junos.utils.sw import SW pkg = 'junos-install-ex-x86-64-23.2R1.13.tgz' def myprogress(dev, report): print("host: {}, report: {}".format(dev.hostname, report)) with Device(host='switch2.example.net') as dev: sw = SW(dev) ok, msg = sw.install(package=pkg, member_id=['0', '1'], progress=myprogress, no_copy=True, reboot=False, cleanfs=False, force_host=False, timeout=4000) if ok: sw.reboot(all_re=False, member_id=['0', '1'])
user@server:~$ python3 junos-pyez-install-on-members.py host: switch2.example.net, report: request-package-checks-pending-install rpc is not supported on given device host: switch2.example.net, report: installing software on VC member: 0 ... please be patient ... host: switch2.example.net, report: software pkgadd package-result: 0 Output: Verified junos-install-ex-x86-64-23.2R1.13 signed by PackageProductionECP256_2023 method ECDSA256+SHA256 Verified auto-snapshot signed by PackageProductionECP256_2023 method ECDSA256+SHA256 ...
Example: Use Junos PyEZ to Install Software on a Junos Device
The Junos PyEZ library provides methods to perform operational and configuration tasks on Junos
devices. This example outlines how to use the Junos PyEZ
jnpr.junos.utils.sw.SW
utility to install or upgrade the software image on a Junos device.
Requirements
This example uses the following hardware and software components:
Configuration management server running Python 3.5 or later and Junos PyEZ Release 2.5 or later
Junos device with NETCONF enabled and a user account configured with appropriate permissions
SSH public/private key pair configured for the appropriate user on the Junos PyEZ server and Junos device
Overview
This example presents a Python application that uses the Junos PyEZ SW
utility
to upgrade Junos OS on the specified device. This example assumes that the software
image resides on the local server.
The application imports the Junos PyEZ Device
class, which handles the
connection with the Junos device; the SW
class, which is used to
perform the software installation operations on the target device; and required
exceptions from the jnpr.junos.exception
module, which contains
exceptions encountered when managing Junos devices. The application also imports the
os
, sys
, and logging
Python
modules for verifying the existence of the software package and performing basic
logging functions.
The application defines the update_progress()
method, which is used by the
install()
method to report on the progress of the installation.
By logging the installation process, you can more readily identify the point where
any failures occur. In this example, progress messages are sent to standard output
and also logged in a separate file.
Before connecting to the device and proceeding with the installation, the application first
verifies that the software package exists. If the file cannot be found, the
application exits with an error message. If the file exists, the application creates
the Device
instance for the target device and calls the
open()
method to establish a connection and NETCONF session
with the device.
The application creates an instance of the SW
utility and uses the
install()
method to install the Junos OS software image on the
target device. The package
variable defines the path on the local
server to the new Junos OS image. Because the no_copy
parameter
defaults to False, the installation process copies the software image from the local
server to the target device. The remote_path
variable defines the
path on the target device to which the software package is copied. The default is
/var/tmp. Although not required, this example explicitly
configures the parameter for clarity.
When the install()
method is called, the application:
-
Calculates the local MD5 checksum for the software image
-
Performs a storage cleanup on the target device
-
Copies the software image to the target device
-
Computes the remote MD5 checksum and compares it to the local value
-
Validates the configuration against the new image
-
Installs the package
If the installation is successful, the application then calls the
reboot()
method to reboot the device. After performing the
installation, the application calls the close()
method to terminate
the NETCONF session and connection. The application includes code for handling any
exceptions that might occur when connecting to the device or performing the
installation.
Configuration
Create the Junos PyEZ Application
Step-by-Step Procedure
To create a Python application that uses Junos PyEZ to install a software image on a Junos device:
Import any required modules, classes, and objects.
import os, sys, logging from jnpr.junos import Device from jnpr.junos.utils.sw import SW from jnpr.junos.exception import ConnectError
Include any required variables, which for this example includes the hostname of the managed device, the software package path, and the log file.
host = 'dc1a.example.com' package = '/var/tmp/junos-install/jinstall-13.3R1.8-domestic-signed.tgz' remote_path = '/var/tmp' validate = True logfile = '/var/log/junos-pyez/install.log'
-
Define the logging method used within the application and by the
install()
method.def update_progress(dev, report): # log the progress of the installing process logging.info(report)
Create a
main()
function definition and function call, and place the remaining statements within the definition.def main(): if __name__ == "__main__": main()
Initialize the logger instance.
# initialize logging logging.basicConfig(filename=logfile, level=logging.INFO, format='%(asctime)s:%(name)s: %(message)s') logging.getLogger().name = host logging.getLogger().addHandler(logging.StreamHandler()) logging.info('Information logged in {0}'.format(logfile))
(Optional) Add code that verifies the existence of the software package.
# verify package exists if not (os.path.isfile(package)): msg = 'Software package does not exist: {0}. '.format(package) logging.error(msg) sys.exit()
Create an instance of the
Device
class, and supply the hostname and any parameters required for that specific connection.Then open a connection and establish a NETCONF session with the device.
# open a connection with the device and start a NETCONF session dev = Device(host=host) try: dev.open() except ConnectError as err: logging.error('Cannot connect to device: {0}\n'.format(err)) return
Create an instance of the
SW
utility.# Create an instance of SW sw = SW(dev)
Include code to install the software package and to reboot the device if the installation succeeds.
try: logging.info('Starting the software upgrade process: {0}' \ .format(package)) # Starting in Release 2.5.0, install() returns a tuple instead of a Boolean ok, msg = sw.install(package=package, remote_path=remote_path, progress=update_progress, validate=validate) except Exception as err: msg = 'Unable to install software, {0}'.format(err) logging.error(msg) ok = False if ok is True: logging.info('Software installation complete. Rebooting') rsp = sw.reboot() logging.info('Upgrade pending reboot cycle, please be patient.') logging.info(rsp) else: msg = 'Unable to install software, {0}'.format(ok) logging.error(msg)
End the NETCONF session and close the connection with the device.
# End the NETCONF session and close the connection dev.close()
Results
On the configuration management server, review the completed application. If the application does not display the intended code, repeat the instructions in this example to correct the application.
import os, sys, logging from jnpr.junos import Device from jnpr.junos.utils.sw import SW from jnpr.junos.exception import ConnectError host = 'dc1a.example.com' package = '/var/tmp/junos-install/jinstall-13.3R1.8-domestic-signed.tgz' remote_path = '/var/tmp' validate = True logfile = '/var/log/junos-pyez/install.log' def update_progress(dev, report): # log the progress of the installing process logging.info(report) def main(): # initialize logging logging.basicConfig(filename=logfile, level=logging.INFO, format='%(asctime)s:%(name)s: %(message)s') logging.getLogger().name = host logging.getLogger().addHandler(logging.StreamHandler()) logging.info('Information logged in {0}'.format(logfile)) # verify package exists if not (os.path.isfile(package)): msg = 'Software package does not exist: {0}. '.format(package) logging.error(msg) sys.exit() dev = Device(host=host) try: dev.open() except ConnectError as err: logging.error('Cannot connect to device: {0}\n'.format(err)) return # Create an instance of SW sw = SW(dev) try: logging.info('Starting the software upgrade process: {0}' \ .format(package)) # Starting in Release 2.5.0, install() returns a tuple instead of a Boolean ok, msg = sw.install(package=package, remote_path=remote_path, progress=update_progress, validate=validate) except Exception as err: msg = 'Unable to install software, {0}'.format(err) logging.error(msg) ok = False if ok is True: logging.info('Software installation complete. Rebooting') rsp = sw.reboot() logging.info('Upgrade pending reboot cycle, please be patient.') logging.info(rsp) else: msg = 'Unable to install software, {0}'.format(ok) logging.error(msg) # End the NETCONF session and close the connection dev.close() if __name__ == "__main__": main()
Execute the Junos PyEZ Application
Execute the Application
-
On the configuration management server, execute the application.
user@server:~$ python3 junos-pyez-install.py Information logged in /var/log/junos-pyez/install.log Starting the software upgrade process: /var/tmp/junos-install/jinstall-13.3R1.8-domestic-signed.tgz computing local checksum on: /var/tmp/junos-install/jinstall-13.3R1.8-domestic-signed.tgz cleaning filesystem ... starting thread (client mode): 0x282d4110L Connected (version 2.0, client OpenSSH_6.7) ...
Verification
Verify the Installation
Purpose
Verify that the software installation was successful.
Action
Review the progress messages, which are sent to both standard output and the log file that is defined in the application, for details about the installation. Sample log file output is shown here. Some output has been omitted for brevity.
user@server:~$ cat /var/log/junos-pyez/install.log 2015-09-03 21:29:20,795:dc1a.example.com: Information logged in /var/log/junos-pyez/install.log 2015-09-03 21:29:35,257:dc1a.example.com: Starting the software upgrade process: /var/tmp/junos-install/jinstall-13.3R1.8-domestic-signed.tgz 2015-09-03 21:29:35,257:dc1a.example.com: computing local checksum on: /var/tmp/junos-install/jinstall-13.3R1.8-domestic-signed.tgz 2015-09-03 21:29:47,025:dc1a.example.com: cleaning filesystem ... 2015-09-03 21:30:00,870:paramiko.transport: starting thread (client mode): 0x282d4110L 2015-09-03 21:30:01,006:paramiko.transport: Connected (version 2.0, client OpenSSH_6.7) ... 2015-09-03 21:30:01,533:paramiko.transport: userauth is OK 2015-09-03 21:30:04,002:paramiko.transport: Authentication (public key) successful! 2015-09-03 21:30:04,003:paramiko.transport: [chan 0] Max packet in: 32768 bytes 2015-09-03 21:30:04,029:paramiko.transport: [chan 0] Max packet out: 32768 bytes 2015-09-03 21:30:04,029:paramiko.transport: Secsh channel 0 opened. 2015-09-03 21:30:04,076:paramiko.transport: [chan 0] Sesch channel 0 request ok 2015-09-03 21:32:23,684:dc1a.example.com: jinstall-13.3R1.8-domestic-signed.tgz: 94437376 / 944211851 (10%) 2015-09-03 21:34:43,828:dc1a.example.com: jinstall-13.3R1.8-domestic-signed.tgz: 188858368 / 944211851 (20%) 2015-09-03 21:37:04,180:dc1a.example.com: jinstall-13.3R1.8-domestic-signed.tgz: 283279360 / 944211851 (30%) 2015-09-03 21:39:24,020:dc1a.example.com: jinstall-13.3R1.8-domestic-signed.tgz: 377700352 / 944211851 (40%) 2015-09-03 21:41:43,906:dc1a.example.com: jinstall-13.3R1.8-domestic-signed.tgz: 472121344 / 944211851 (50%) 2015-09-03 21:44:04,079:dc1a.example.com: jinstall-13.3R1.8-domestic-signed.tgz: 566542336 / 944211851 (60%) 2015-09-03 21:46:23,968:dc1a.example.com: jinstall-13.3R1.8-domestic-signed.tgz: 660963328 / 944211851 (70%) 2015-09-03 21:48:44,045:dc1a.example.com: jinstall-13.3R1.8-domestic-signed.tgz: 755384320 / 944211851 (80%) 2015-09-03 21:51:04,016:dc1a.example.com: jinstall-13.3R1.8-domestic-signed.tgz: 849805312 / 944211851 (90%) 2015-09-03 21:53:24,058:dc1a.example.com: jinstall-13.3R1.8-domestic-signed.tgz: 944211851 / 944211851 (100%) 2015-09-03 21:53:24,389:paramiko.transport: [chan 0] EOF sent (0) 2015-09-03 21:53:24,466:paramiko.transport: EOF in transport thread 2015-09-03 21:53:24,514:dc1a.example.com: computing remote checksum on: /var/tmp/jinstall-13.3R1.8-domestic-signed.tgz 2015-09-03 21:56:01,692:dc1a.example.com: checksum check passed. 2015-09-03 21:56:01,692:dc1a.example.com: validating software against current config, please be patient ... 2015-09-03 22:47:57,205:dc1a.example.com: installing software ... please be patient ... 2015-09-03 23:28:10,415:dc1a.example.com: Software installation complete. Rebooting 2015-09-03 23:28:11,525:dc1a.example.com: Upgrade pending reboot cycle, please be patient. 2015-09-03 23:28:11,525:dc1a.example.com: Shutdown NOW! [pid 55494]
Meaning
The log file contents indicate that the image was successfully copied to and installed on the target device.
Troubleshooting
Troubleshoot Timeout Errors
Problem
The application generates an RpcTimeoutError message or a TimeoutExpiredError message and the installation fails.
RpcTimeoutError(host: dc1a.example.com, cmd: request-package-validate, timeout: 1800)
Long operations might exceed the RPC timeout interval, particularly on slower devices, causing the RPC to time out before the operation can be completed. The default time for a NETCONF RPC to time out is 30 seconds. During the installation process, Junos PyEZ increases the RPC timeout interval to 300 seconds (5 minutes) when computing the checksum and to 1800 seconds (30 minutes) when copying and installing the package on the device.
Solution
To accommodate install or checksum operations that might require a longer time than the default
installation and checksum timeout intervals, set the
install
method timeout
and
checksum_timeout
parameters to appropriate values and
re-run the application. For example:
sw.install(package=package, remote_path=remote_path, progress=update_progress, validate=True, timeout=2400, checksum_timeout=400)
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.
install()
method returns a tuple that contains the status of the installation and a
message string.