Cisco IOS-XE Rollback
Certified
Enterprise Edition
Roll a Cisco IOS-XE device back to the previous version
Cisco IOS-XE Rollback
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 committedorinstall rollback to id <rollbackId>, chosen withrollbackTo. WithrollbackTo: IDthe ID defaults to the last rollback point recorded in the pre-check snapshot (rollbackIdof the Check task) whenrollbackIdis 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.
type: io.kestra.plugin.ee.cisco.iosxe.RollbackExamples
Abort the upgrade after a failed post-check
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
host *string
Device host name or IP address
snapshot *string
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.
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}.
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
{}1150bootGracePeriod 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.
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.
rollbackId integerstring
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.
rollbackTo string
COMMITTEDCOMMITTEDIDRollback target when nothing is uncommitted
COMMITTED (default) or ID, which needs rollbackId.
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 device already ran the previous version, so nothing was sent.
bootupTimestamp number
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.
previousImage string
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.
runningVersion string
Running version
Version running on the device after the task (a Cisco extra: the Arista plugin has no such output).