Cisco IOS-XE Reload

Cisco IOS-XE Reload

Certified
Enterprise Edition

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: true and sends nothing. Only the running version proves the reload: a target package in U or C is not enough;
  • the boot time is newer than the baseline (snapshot or previousBootupTimestamp) but the device does not run the target (an unrelated reboot, or the auto-abort timer reverted the upgrade): fails with CISCO_UNEXPECTED_STATE and sends nothing;
  • the device has not rebooted and an install is in progress: fails with InstallInProgressException and sends nothing. That is RESTCONF sys-activity when restconf is 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 in U or C;
  • the device runs neither the pre-check version of the snapshot nor the target: CISCO_UNEXPECTED_STATE; the target is not added (no I package 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.

yaml
type: io.kestra.plugin.ee.cisco.iosxe.Reload

Reload a core switch onto the new image

yaml
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

Device host name or IP address

Image file name on bootflash

Version to activate

Padded and unpadded forms are equal (17.09.04a = 17.9.4a).

Username

The account must have privilege 15, or an enableSecret to reach it.

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.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset 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.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
DefaultPT2H

Auto-abort timer

The device reverts to the previous version if the install is not committed within this delay. 30 to 1200 minutes, default 120.

DefaultPT10M

Boot 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.

DefaultPT2M

Default 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.

DefaultPT30S

TCP and SSH connect timeout

1 second to 5 minutes, default 30 seconds.

Defaultfalse

Disable 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.

Enable secret

Used to enter privileged EXEC mode when the login lands in user EXEC mode (host> prompt).

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.

DefaultPT30M

Timeout of the install, copy or verify command itself

1 second to 24 hours, default 30 minutes.

Password

Required unless privateKey is set.

DefaultPT5S

First 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.

Default22

SSH port

1 to 65535, default 22.

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.

SSH private key

PEM content of the private key. Used instead of password when set.

Passphrase of the private key

DefaultPT20M

How 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.

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.

Definitions

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.

caPemstring

CA certificate in PEM format

Trusted instead of the system trust store. Certificate verification cannot be disabled.

passwordstring

Password

Defaults to the task password. Required when the task logs in with a private key.

portintegerstring
Default443

HTTPS port

1 to 65535, default 443.

timeoutstring
DefaultPT30S

Request timeout

1 second to 10 minutes, default 30 seconds.

usernamestring

Username

Defaults to the task username.

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.

DefaultPT30S

Pause between the device answering and the final checks

Lets the control plane settle after the boot. 0 to 1 hour, default 30 seconds.

Already reloaded

True when the guard found the device already rebooted or on the target version, so no reload was sent.

Running version

Version running on the device after the task (a Cisco extra: the Arista plugin has no such output).