9300 switch upgrade template

Has anyone created a template for the 9300 switches? 

Have been working on this for a couple days and came up with the following but having issues getting it to push to all switches.  I took the template I had and modified it but have not had 100% success.

/*
.CHANGE_TEMPLATE_DESCRIPTION
This change script allows you to script IOS upgrades
.PLATFORM_DESCRIPTION
This runs on Cisco IOS devices for 9300 Switch

.PARAMETER_LABEL @ContextNode
NCM Node
.PARAMETER_DESCRIPTION @ContextNode
The node the template will operate on. All templates require this by default. The target node is selected during the first part of the wizard so it will not be available for selection when defining values of variables.

.PARAMETER_LABEL @IOS_FILENAME
The File Name of the new IOS Version.
.PARAMETER_DESCRIPTION @IOS_FILENAME
This should be a valid Cisco IOS File.No spaces are allowed, a script will not be generated for a Cisco IOS Filename that includes a space.

.PARAMETER_LABEL @change_Radius
Delete and Replace existing Radius.

.PARAMETER_DESCRIPTION @change_Radius
Enter "y" to replace existing Radius. Enter "n" to leave existing Radius Configuration.

.PARAMETER_LABEL @reloadWhenComplete
RELOAD device after transfer?
.PARAMETER_DESCRIPTION @reloadWhenComplete
Enter "y" to reload the device after upgrade. Enter "n" to only copy the bin files to flash.

*/

script UpgradeIOS (
NCM.Nodes @ContextNode,
string @IOS_FILENAME,
string @reloadWhenComplete)
{

string @CommandLine = 'copy tftp://x.x.x.x/' + @IOS_FILENAME + ' flash:'

if (@IOS_FILENAME contains ' ')
{}
else
{

foreach ( in @ContextNode )
{

if ( .Vendor == 'Cisco' )
{
CLI
{
@CommandLine
@IOS_FILENAME
request platform software package install switch all file flash:@IOS_FILENAME auto-copy
conf t
no boot system
boot system flash:@IOS_FILENAME
end
wr
}
if (@reloadWhenComplete contains 'y')
{
CLI
{
reload
!

}
}
}
}
}
}

Script will push to first switch but not going to all subsequent stack switches.

Chuck

  • Hi shinska,

    Some extra info can be found in the cisco release notes for 9300 switches IOS-XE. I assume you are running the devices in Install Mode.

    Here a link for the: Release Notes for Cisco Catalyst 9300 Series Switches, Cisco IOS XE Fuji 16.9.x 

    They describe a 6 step process on upgrading

    In a nut shell:
    ---------------
    1) Clean up: request platform software package clean switch all + install remove inactive --> can also be done afterwards if you are sure there is enough space on the flash memory.
    2) Copy new image: Covered in your '@CommandLine' + '@IOS_FILENAME'
    3) Set boot var: boot system switch all flash:/packages.conf + write
    4) Install image: As mentioned in the CLI part (request platform software package install switch all file flash:@IOS_FILENAME auto-copy)
    5) Check install & boot system: show flash-X (x is switch number) & show boot system (each switch should state flash:/packages.conf)
    6) Reload the switch (stack).

    Hope this helps.

    Wkr,

    Alain