Cisco IOS-XE Check

Cisco IOS-XE Check

Certified
Enterprise Edition

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 least max(1 GiB, image size x spaceMarginFactor). The install add pre-check only covers the payload, so a margin is needed.
  • redundancy: an OSPF adjacency in FULL state on redundancyInterface (the link to the peer core).
  • interface: port-channels are in use and their members bundled. In POST, compared with the PRE snapshot: 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 in PRE; install mode, no install in progress and the target version running in POST.

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.

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

Pre-check before an upgrade, then post-check against the snapshot

yaml
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

Device host name or IP address

Possible Values
PREPOST

PRE before the upgrade, POST after the reload and before the commit

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
SubTypestring
Possible Values
FLASHREDUNDANCYINTERFACEINSTALL

Checks to run

FLASH, REDUNDANCY (needs redundancyInterface), INTERFACE and INSTALL. Defaults to FLASH, INTERFACE and INSTALL.

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.

Name of the upgrade image on bootflash

Its size is read from dir bootflash: for the flash check. Ignored when imageSizeBytes is set.

Size of the upgrade image in bytes

For the flash check, when the image is not on bootflash yet. 1 to 64 GiB (68719476736).

DefaultLLDP
Possible Values
LLDPCDP

Neighbor protocol used by the interface check

LLDP (default) or CDP.

Password

Required unless privateKey is set.

Default22

SSH port

1 to 65535, default 22.

SSH private key

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

Passphrase of the private key

Interface facing the peer core, e.g. Port-channel11

Required by the REDUNDANCY check.

Reads are made over RESTCONF only when this task asks for it.

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 of the PRE run

Required in POST: the snapshot output of the pre-check.

Default1.25

Free space factor

flash requires imageSizeBytes times this factor, at least 1 GiB. 1.0 to 10.0, default 1.25.

Version expected after the upgrade

Used by the install check in POST. Padded and unpadded forms are equal (17.09.04a = 17.9.4a).

DefaultSSH
Possible Values
SSHRESTCONF

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

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.

Checks failed

Failed checks, one entry per check with its problems joined by ; .

Definitions
checkstring

Name of the failed check, e.g. flash

messagestring

What failed and, when known, what it was before the upgrade

SubTypestring

Checks passed

Names of the checks that passed.

Formaturi

POST only: configuration differences against the snapshot, expected upgrade differences listed separately

Model name

Hardware model of the chassis, for example C9500-24Y4C.

PRE only: last rollback point ID, usable as rollbackId of the Rollback task

Formaturi

Snapshot

Internal storage URI of the snapshot (Ion). Only set for the PRE phase.

Status

ok when every check passed, ko otherwise.

Running version

Software version currently running, normalised (17.09.04a becomes 17.9.4a).