Cisco IOS-XE Check
Certified
Enterprise Edition
Pre or post upgrade checks of a Cisco IOS-XE device
Cisco IOS-XE Check
Pre or post upgrade checks of a Cisco IOS-XE device
Returns version, modelName, bootupTimestamp, status (ok or ko), checksPassed and checksFailed
(one entry per failed check, its problems joined by ; ), like the Arista EOS plugin. A failing check never
throws. Checks:
flash: bootflash free space is at leastmax(1 GiB, image size x spaceMarginFactor). Theinstall addpre-check only covers the payload, so a margin is needed.redundancy: an OSPF adjacency inFULLstate onredundancyInterface(the link to the peer core).interface: port-channels are in use and their members bundled. InPOST, compared with thePREsnapshot: port-channels, interfaces and LLDP/CDP neighbours that were up before and are not now are reported ("Port-channel11 down after the upgrade (up before)").install(IOS-XE specific): install mode, no uncommitted package, no running auto-abort timer and no install in progress inPRE; install mode, no install in progress and the target version running inPOST.
bootupTimestamp is exact over RESTCONF and for a UTC or GMT clock; otherwise it comes from the uptime and the
worker clock, so keep the device clock synchronised (NTP) to let Reload and Rollback compare boot times.
The PRE phase writes a snapshot file (Ion): facts, the parsed data and the normalised, secret-masked running
configuration. Pass it to the POST run, to Reload, Rollback and Commit. In POST, the configuration is also diffed against the snapshot
into configDiff (informational: it never fails the check). The diff is only made between snapshots read with
the same transport.
type: io.kestra.plugin.ee.cisco.iosxe.CheckExamples
Pre-check before an upgrade, then post-check against the snapshot
id: cisco_iosxe_check
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
checks: [FLASH, REDUNDANCY, INTERFACE, INSTALL]
redundancyInterface: Port-channel11
image: cat9k_iosxe.17.12.03.SPA.bin
- id: post_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: POST
checks: [REDUNDANCY, INTERFACE, INSTALL]
redundancyInterface: Port-channel11
targetVersion: 17.12.3
snapshot: "{{ outputs.pre_check.snapshot }}"
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
phase *string
PREPOSTPRE before the upgrade, POST after the reload and before the commit
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
{}1150checks array
FLASHREDUNDANCYINTERFACEINSTALLChecks to run
FLASH, REDUNDANCY (needs redundancyInterface), INTERFACE and INSTALL.
Defaults to FLASH, INTERFACE and INSTALL.
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.
image string
Name of the upgrade image on bootflash
Its size is read from dir bootflash: for the flash check.
Ignored when imageSizeBytes is set.
imageSizeBytes integerstring
Size of the upgrade image in bytes
For the flash check, when the image is not on bootflash yet.
1 to 64 GiB (68719476736).
neighborProtocol string
LLDPLLDPCDPNeighbor protocol used by the interface check
LLDP (default) or CDP.
password string
Password
Required unless privateKey is set.
port integerstring
22SSH port
1 to 65535, default 22.
privateKey string
SSH private key
PEM content of the private key.
Used instead of password when set.
privateKeyPassphrase string
Passphrase of the private key
redundancyInterface string
Interface facing the peer core, e.g. Port-channel11
Required by the REDUNDANCY check.
restconf
Reads are made over RESTCONF only when this task asks for it.
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 of the PRE run
Required in POST: the snapshot output of the pre-check.
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}.
spaceMarginFactor numberstring
1.25Free space factor
flash requires imageSizeBytes times this factor, at least 1 GiB.
1.0 to 10.0, default 1.25.
targetVersion string
Version expected after the upgrade
Used by the install check in POST.
Padded and unpadded forms are equal (17.09.04a = 17.9.4a).
transport string
SSHSSHRESTCONFTransport used to read the device
SSH parses CLI output and is the default. RESTCONF reads structured data from the Cisco-IOS-XE YANG
models and is not affected by CLI output changes between releases; configure restconf for it.
A field that the device does not expose over RESTCONF is read from the CLI instead, so SSH
credentials are still required. Outputs are the same with both transports.
Outputs
bootupTimestamp number
Boot timestamp
Epoch seconds of the last boot. Exact over RESTCONF and when the device prints its restart time in UTC or GMT; otherwise derived from the uptime and the worker clock, with a precision of about one minute.
checksFailed array
Checks failed
Failed checks, one entry per check with its problems joined by ; .
io.kestra.plugin.ee.cisco.common.CheckResult-Failure
Name of the failed check, e.g. flash
What failed and, when known, what it was before the upgrade
checksPassed array
Checks passed
Names of the checks that passed.
configDiff string
uriPOST only: configuration differences against the snapshot, expected upgrade differences listed separately
modelName string
Model name
Hardware model of the chassis, for example C9500-24Y4C.
rollbackId integer
PRE only: last rollback point ID, usable as rollbackId of the Rollback task
snapshot string
uriSnapshot
Internal storage URI of the snapshot (Ion). Only set for the PRE phase.
status string
Status
ok when every check passed, ko otherwise.
version string
Running version
Software version currently running, normalised (17.09.04a becomes 17.9.4a).