Cisco IOS-XE Reload
Certified
Enterprise Edition
Activate an added image and reload a Cisco IOS-XE device
Cisco IOS-XE Reload
Activate an added image and reload a Cisco IOS-XE device
Runs install activate file bootflash: <image> auto-abort-timer <minutes> prompt-level none, which reloads
the device, waits for it to come back and checks that the target version runs with its package in U
(activated, uncommitted) state. The auto-abort timer is always set explicitly: if you never commit, the device
reverts to the previous version by itself after that delay (default 120 minutes, allowed 30 to 1200).
The device must reload exactly once. An activated and uncommitted image survives one reload but not a second one. The task therefore reads the device state before it sends anything, from the pre-check values:
- the target version already runs: returns
alreadyReloaded: trueand sends nothing. Only the running version proves the reload: a target package inUorCis not enough; - the boot time is newer than the baseline (
snapshotorpreviousBootupTimestamp) but the device does not run the target (an unrelated reboot, or the auto-abort timer reverted the upgrade): fails withCISCO_UNEXPECTED_STATEand sends nothing; - the device has not rebooted and an install is in progress: fails with
InstallInProgressExceptionand sends nothing. That is RESTCONFsys-activitywhenrestconfis set, otherwise a running auto-abort timer or an uncommitted (U) package at a version other than the running one, or the target package already inUorC; - the device runs neither the pre-check version of the snapshot nor the target:
CISCO_UNEXPECTED_STATE; the target is not added (noIpackage at that version):ActivateFailedException(MISSING_FILE); - otherwise it reloads.
The boot time of a RESTCONF read comes from the device clock, the one derived from the uptime (CLI, zone other
than UTC or GMT) from the worker clock: keep the device clock synchronised (NTP), a skew of more than two minutes
makes the guard refuse. The zone names UTC and GMT are trusted to mean an offset of 0, as show version prints no
offset.
The task waits for the device to come back itself: unlike the Arista EOS plugin, no separate wait step is needed on IOS-XE.
The guard reads the device, not Kestra, so it also protects a re-run after an executor restart. Do not set
retry on this task anyway: let the flow decide what to do after a failure. If the device does not come back
in reloadTimeout, the task fails with a DeviceUnreachableException whose message says activateSent=true.
A % error answer to install activate (for example % Invalid input) fails at once with an
ActivateFailedException: nothing was activated.
Set restconf for the authoritative check. Without it the install-in-progress detection is a CLI heuristic
(auto-abort timer running or package in U state) that has not been validated on hardware yet: it assumes the
device shows these states while install activate is still expanding packages. Until a lab confirms it, do not
rely on the CLI heuristic alone to stop a second install activate; restconf reads the sys-activity
install state from the device itself.
type: io.kestra.plugin.ee.cisco.iosxe.ReloadExamples
Reload a core switch onto the new image
id: cisco_iosxe_reload
namespace: company.network
tasks:
- id: pre_check
type: io.kestra.plugin.ee.cisco.iosxe.Check
host: core1.example.net
username: automation
password: "{{ secret('CISCO_PASSWORD') }}"
enableSecret: "{{ secret('CISCO_ENABLE_SECRET') }}"
hostKeyFingerprint: "{{ secret('CORE1_HOST_KEY_FINGERPRINT') }}"
phase: PRE
- id: reload
type: io.kestra.plugin.ee.cisco.iosxe.Reload
host: core1.example.net
username: automation
password: "{{ secret('CISCO_PASSWORD') }}"
enableSecret: "{{ secret('CISCO_ENABLE_SECRET') }}"
hostKeyFingerprint: "{{ secret('CORE1_HOST_KEY_FINGERPRINT') }}"
image: cat9k_iosxe.17.12.03.SPA.bin
targetVersion: 17.12.3
snapshot: "{{ outputs.pre_check.snapshot }}"
autoAbortTimer: PT60M
reloadTimeout: PT25M
Installation
This Enterprise plugin requires an Enterprise image and access to the plugin registry. Install it with the following command:
kestractl plugins get io.kestra.plugin.ee:plugin-ee-cisco --compatible-for $KESTRA_VERSION For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.
Properties
host *string
Device host name or IP address
image *string
Image file name on bootflash
targetVersion *string
Version to activate
Padded and unpadded forms are equal (17.09.04a = 17.9.4a).
username *string
Username
The account must have privilege 15, or an enableSecret to reach it.
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150autoAbortTimer string
PT2HAuto-abort timer
The device reverts to the previous version if the install is not committed within this delay. 30 to 1200 minutes, default 120.
bootGracePeriod string
PT10MBoot grace period
SSH comes up before AAA is ready, which gives transient login failures. The period starts at the first login failure after the device answers on SSH again, not when the command is sent. Login failures during it count as "not back yet"; after it they are reported as authentication failures. 0 to 24 hours, default 10 minutes.
commandTimeout string
PT2MDefault timeout of a single command
1 second to 1 hour, default 2 minutes. Tasks that run long operations (copy, install) have their own timeout properties.
connectTimeout string
PT30STCP and SSH connect timeout
1 second to 5 minutes, default 30 seconds.
disableHostKeyVerification booleanstring
falseDisable SSH host key verification
Explicit opt-out: the device identity is no longer verified, which exposes the credentials to a man-in-the-middle. Use for labs only.
enableSecret string
Enable secret
Used to enter privileged EXEC mode when the login lands in user EXEC mode (host> prompt).
hostKeyFingerprint string
SHA256 fingerprint of the device SSH host key
Format SHA256: abc..., as printed by ssh-keygen -lf. Host key verification is on by default, so this
property is required unless disableHostKeyVerification is true. Cisco IOS-XE offers RSA host keys.
installTimeout string
PT30MTimeout of the install, copy or verify command itself
1 second to 24 hours, default 30 minutes.
password string
Password
Required unless privateKey is set.
pollInterval string
PT5SFirst pause between two attempts to reach the device
Grows by 50% after each attempt, up to 30 seconds. 100 milliseconds to 10 minutes, default 5 seconds.
port integerstring
22SSH port
1 to 65535, default 22.
previousBootupTimestamp numberstring
Previous boot timestamp
Baseline boot time in epoch seconds (the bootupTimestamp output of the Check task) when no snapshot is given.
It tells a device that has already reloaded from one that has not. Without a snapshot the version before the
reload is not checked.
privateKey string
SSH private key
PEM content of the private key.
Used instead of password when set.
privateKeyPassphrase string
Passphrase of the private key
reloadTimeout string
PT20MHow long to wait for the device to come back
Cisco publishes no boot time for Catalyst 9000, measure yours in a lab. Measured from the moment the command is sent. 1 second to 24 hours, default 20 minutes.
restconf
When set, the install activity is read over RESTCONF (sys-activity) before anything is sent, and the task
fails with InstallActivityUnknownException when it cannot be read.
RESTCONF settings
RESTCONF is read-only and HTTPS only; the device certificate is always verified. Device prerequisites:
restconf, ip http secure-server, AAA (aaa new-model with login and exec authorization) and a
privilege-15 user. Use the device CA in caPem when its certificate is self-signed, and a host name
that matches the certificate.
CA certificate in PEM format
Trusted instead of the system trust store. Certificate verification cannot be disabled.
Password
Defaults to the task password.
Required when the task logs in with a private key.
443HTTPS port
1 to 65535, default 443.
PT30SRequest timeout
1 second to 10 minutes, default 30 seconds.
Username
Defaults to the task username.
snapshot string
Snapshot
Internal storage URI of the PRE check snapshot, the snapshot output of the Check task.
Its boot time is the guard baseline, and its version is the version the device must still run before the reload.
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}.
stabilizationDelay string
PT30SPause between the device answering and the final checks
Lets the control plane settle after the boot. 0 to 1 hour, default 30 seconds.
Outputs
alreadyReloaded boolean
Already reloaded
True when the guard found the device already rebooted or on the target version, so no reload was sent.
runningVersion string
Running version
Version running on the device after the task (a Cisco extra: the Arista plugin has no such output).