Cisco IOS-XE Rollback

Cisco IOS-XE Rollback

Certified
Enterprise Edition

Roll a Cisco IOS-XE device back to the previous version

Reloads the device onto the previous version, waits for it to come back and checks the version:

  • an uncommitted package is present (the usual case after a failed post-check): install abort;
  • otherwise: install rollback to committed or install rollback to id <rollbackId>, chosen with rollbackTo. With rollbackTo: ID the ID defaults to the last rollback point recorded in the pre-check snapshot (rollbackId of the Check task) when rollbackId is not set.

The task waits for the device to come back itself: unlike the Arista EOS plugin, no separate wait step is needed on IOS-XE. Follow it with a POST Check.

Like Reload, the task reads the device first: when it already runs the snapshot version, it returns alreadyReloaded: true and sends nothing, so a re-run after a successful install abort or a late boot does not fall through to a second reload. Without restconf, when it runs the snapshot version but a package in U state exists at another version, an activation may be about to reload it onto the new image: the task fails with InstallInProgressException and sends nothing. A U package at the running version is a leftover (for example after a rollback) and does not block; with restconf, sys-activity decides. Keep the device clock synchronised (NTP): boot times from different sources must agree within two minutes. A % error answer such as % Invalid input fails at once with a RollbackFailedException. An install in progress (RESTCONF sys-activity, with restconf set) fails with InstallInProgressException; an unreadable sys-activity fails with InstallActivityUnknownException. A FAILED: line, or the wrong version after the boot, raises a RollbackFailedException; there is no automatic second attempt. Do not set retry on this task.

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

Abort the upgrade after a failed post-check

yaml
id: cisco_iosxe_rollback
namespace: company.network

inputs:
  - id: snapshot
    type: URI

tasks:
  - id: rollback
    type: io.kestra.plugin.ee.cisco.iosxe.Rollback
    host: core1.example.net
    username: automation
    password: "{{ secret('CISCO_PASSWORD') }}"
    enableSecret: "{{ secret('CISCO_ENABLE_SECRET') }}"
    hostKeyFingerprint: "{{ secret('CORE1_HOST_KEY_FINGERPRINT') }}"
    snapshot: "{{ inputs.snapshot }}"
    rollbackTo: COMMITTED
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

Snapshot

Internal storage URI of the PRE check snapshot, the snapshot output of the Check task. It holds the version the device must go back to and the last rollback point.

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

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.

Rollback point ID

Used with rollbackTo: ID. Defaults to the rollback point recorded in the snapshot (the rollbackId output of the pre-check). 1 to 1000.

DefaultCOMMITTED
Possible Values
COMMITTEDID

Rollback target when nothing is uncommitted

COMMITTED (default) or ID, which needs rollbackId.

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 device already ran the previous version, so nothing was sent.

Boot timestamp before the reload

Epoch seconds of the boot the device was on when the rollback started. The task waits for the new boot itself.

Previous image

Boot image of the device after the rollback, as show version reports it. In install mode this is bootflash: packages.conf, which points at the version the device went back to.

Running version

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