Multiple configuration files

This method of operation means that you cannot preserve different startupconfig files across a reboot without using remote storage.

The switch allows up to three startup-config files with options for selecting which startup-config file to use for:

  • A fixed reboot policy using a specific startup-config file for a specific boot path (primary or secondary flash)

  • Overriding the current reboot policy on a per-instance basis

Optional reboot process

Optional reboot process

While you can still use remote storage for startup-config files, you can now maintain multiple startup-config files on the switch and choose which version to use for a reboot policy or an individual reboot.

This choice of which configuration file to use for the startup-config at reboot provides the following new options:

  • The switch can reboot with different configuration options without having to exchange one configuration file for another from a remote storage location.

  • Transitions from one software release to another can be performed while maintaining a separate configuration for the different software release versions.

  • By setting a reboot policy using a known good configuration and then overriding the policy on a per-instance basis, you can test a new configuration with the provision that if an unattended reboot occurs, the switch will come up with the known, good configuration instead of repeating a reboot with a misconfiguration.

General operation

Multiple configuration storage in the switch. The switch uses three memory "slots", with identity (id) numbers of 1, 2, and 3.

Output for show config files command

HP Switch(config)# show config files
Configuration files:

id | act pri sec | name
---+-------------+-----------------------------------------------
 1 |             | oldConfig 
 2 |  *   *   *  | workingConfig 
 3 |             |

A startup-config file stored in a memory slot has a unique, changeable file name. The switches covered in this guide can use the startup-config in any of the memory slots (if the software version supports the configured features).

Boot options. With multiple startup-config files in the switch you can specify a policy for the switch to use upon reboot. The options include:

  • Use the designated startup-config file with either or both reboot paths (primary or secondary flash)

  • Override the current reboot policy for one reboot instance by specifying a boot path (primary or secondary flash) and the startup-config file to use.

Changing the startup-config file. When the switch reboots, the startupconfig file supplies the configuration for the running-config file the switch uses to operate. Making changes to the running-config file and then executing a write-mem command (or, in the Menu interface, the Save command) are written back to the startup-config file used at the last reboot. For example, suppose that a system administrator performs the following on a switch that has two startup-config files (workingconfig and backupconfig):

  1. Reboot the switch through the Primary boot path using the startup-config file named backupconfig.

  2. Use the CLI to make configuration changes in the running-config file, and then execute write-mem.

The result is that the startup-config file used to reboot the switch is modified by the actions in step 2.

Example of reboot process and making changes to the startup-config file

Example of reboot process and making changes to the startup-config file

Creating an alternate startup-config file. There are two methods for creating a new configuration file:

Transitioning to multiple configuration files

At the first reboot with a software release supporting multiple configuration, the switch:

  • Assigns the filename oldConfig to the existing startup-config file (which is stored in memory slot 1).

  • Saves a copy of the existing startup-config file in memory slot 2 with the filename workingConfig.

  • Assigns the workingConfig file as the active configuration and the default configuration for all subsequent reboots using either primary or secondary flash.

Switch memory assignments after the first reboot from software supporting multiple configuration

HP Switch(config)# show config files
Configuration files:

id | act pri sec | name
---+-------------+-----------------------------------------------
 1 |             | oldConfig 
 2 |  *   *   *  | workingConfig 
 3 |             |

In the above state, the switch always:

  • Uses the workingConfig file to reboot

The commands described later in this section enable you to view the current multiple configuration status, manage multiple startup-config files, configure reboot policies, and override reboot policies on a per-instance basis.

Viewing the startup-config file status with multiple configuration enabled

Rebooting the switch automatically enables the multiple configuration feature.

Syntax

show config files

This command displays the available startup-config files on the switch and the current use of each file.

id: Identifies the memory slot for each startup-config file available on the switch.

act:An asterisk ( * ) in this column indicates that the corresponding startup-config file is currently in use.

pri: An asterisk ( * ) in this column indicates that the corresponding startup-config file is currently assigned to the primary boot path.

sec:An asterisk ( * ) in this column indicates that the corresponding startup-config file is currently assigned to the secondary boot path.

name: Shows the filename for each listed startup-config file in the switch. See Renaming an existing startup-config file for the command you can use to change existing startup-config filenames.

In the default configuration, if the switch was shipped from the factory with software installed in both the primary and secondary boot paths, then one startup-config file named config1 is used for both paths and is stored in memory slot 1. Memory slots 2 and 3 are empty in this default configuration.

Displaying the content of a specific startup-config file

With Multiple Configuration enabled, the switch can have up to three startupconfig files. Because theshow config command always displays the content of the currently active startup-config file, the command extension shown below is needed to allow viewing the contents of any other startup-config files stored in the switch.

Syntax

show config <filename>

This command displays the content of the specified startupconfig file in the same way that the show config command displays the content of the default (currently active) startupconfig file.

Changing or overriding the reboot configuration policy

You can boot the switch using any available startup-config file.

Changing the reboot configuration policy. For a given reboot, the switch automatically reboots from the startup-config file assigned to the flash location (primary or secondary) being used for the current reboot. For example, when you first download a software version that supports multiple configuration files and boot from the flash location of this version, the switch copies the existing startup-config file (named oldConfig) into memory slot 2, renames this file to workingConfig, and assigns workingConfig as:

  • The active configuration file

  • The configuration file to use when booting from either primary or secondary flash.

In this case, the switch is configured to automatically use the workingConfig file in memory slot 2 for all reboots.

You can use the following command to change the current policy so that the switch automatically boots using a different startup-config file.

Syntax

startup-default [ primary | secondary ]config <filename>

Specifies a boot configuration policy option:

[ primary | secondary ]config <filename>

Designates the startup-config file to use in a reboot with the software version stored in a specific flash location. Use this option to change the reboot policy for either primary or secondary flash, or both.

config <filename>

Designates the startup-config file to use for all reboots, regardless of the flash version used. Use this option when you want to automatically use the same startup-config file for all reboots, regardless of the flash source used.

For redundant management systems, this command affects both the active management module and the standby management module. The config file is copied immediately to the standby management module and becomes the default on that module when the next bootup occurs, unless redundancy is disabled or the standby module has failed selftest.

Note: To override the current reboot configuration policy for a single reboot instance, use the boot system flash command with the options described under Changing or overriding the reboot configuration policy.

For example, suppose:

  • Software release “A” is stored in primary flash and a later software release is stored in secondary flash.

  • The system operator is using memory slot 1 for a reliable, minimal configuration (named minconfig) for the software version in the primary flash, and slot 2 for a modified startup-config file (named newconfig) that includes untested changes for improved network operation with the software version in secondary flash.

The operator wants to ensure that in case of a need to reboot by pressing the Reset button, or if a power failure occurs, the switch will automatically reboot with the minimal startup-config file in memory slot 1. Since a reboot due to pressing the Reset button or to a power cycle always uses the software version in primary flash, the operator needs to configure the switch to always boot from primary flash with the startup-config file named minconfig (in memory slot 1). Also, whenever the switch boots from secondary flash, the operator also wants the startup-config named newconfig to be used. The following two commands configure the desired behavior.

HP Switch(config)# startup-default pri config minconfig
HP Switch(config) # startup-default sec config newconfig

Overriding the default reboot configuration policy. This command provides a method for manually rebooting with a specific startup-config file other than the file specified in the default reboot configuration policy.

Syntax

boot system flash <primary | secondary> config <filename>

Specifies the name of the startup-config file to apply for the immediate boot instance only. This command overrides the current reboot policy.

Using reload to reboot from the current flash image and startup-config file.

Syntax

reload

This command boots the switch from the currently active flash image and startup-config file. Because reload bypasses some subsystem self-tests, the switch boots faster than if you use a boot command.


[NOTE: ]

NOTE: To identify the currently active startup-config file, use the show config files command.


Managing startup-config files in the switch

Renaming an existing startup-config file

Syntax

rename config current-filename | newname-str

This command changes the name of an existing startupconfig file. A file name can include up to 63, alphanumeric characters. Blanks are allowed in a file name enclosed in quotes (" " or ‘ ‘). (File names are not case-sensitive.)

For redundant management systems, renaming a config file affects both the active management module and the standby management module, unless redundancy is disabled or the standby module failed selftest.

Creating a new startup-config file

The switch allows up to three startup-config files. You can create a new startup-config file if there is an empty memory slot or if you want to replace one startup-config file with another.

Syntax

copy config source-filename config target-filename

This command makes a local copy of an existing startupconfig file by copying the contents of an existing startupconfig file in one memory slot to a new startup-config file in another, empty memory slot. This enables you to use a separate configuration file to experiment with configuration changes, while preserving the source file unchanged.

It also simplifies a transition from one software version to another by enabling you to preserve the startup-config file for the earlier software version while creating a separate startupconfig file for the later software version. With two such versions in place, you can easily reboot the switch with the correct startup-config file for either software version.

  • If the destination startup-config file already exists, it is overwritten by the content of the source startup-config file.

  • If the destination startup-config file does not already exist, it will be created in the first empty configuration memory slot on the switch.

  • If the destination startup-config file does not already exist, but there are no empty configuration memory slots on the switch, then a new startup-config file is not created and a message similar to the following is returned.

    Unable to copy configuration to target-filename

Using one startup-config file for both Primary and Secondary flash

suppose both primary and secondary flash memory contain software release "A" and use a startup-config file named config1

HP Switch(config)# show config files
Configuration files:

id | act pri sec | name
---+-------------+-----------------------------------------------
 1 |  *   *   *  | Config1
 2 |             | 
 3 |             |

If you wanted to experiment with configuration changes to the software version in secondary flash, you could create and assign a separate startupconfig file for this purpose.

Creating and assigning a new startup-config file

HP Switch(config)# copy config config1 config config2
HP Switch(config)# startup-default secondary config config2
HP Switch(config)# show config files

Configuration files:

id | act pri sec | name
---+-------------+-----------------------------------------------
 1 |  *   *      | Config1
 2 |          *  | Config2
 3 |             |

[NOTE: ]

NOTE: You can also generate a new startup-config file by booting the switch from a flash memory location from which you have erased the currently assigned startup-config file.


Erasing a startup-config file

You can erase any of the startup-config files in the switch’s memory slots. In some cases, erasing a file causes the switch to generate a new, default-configuration file for the affected memory slot.

In a redundant management system, this command erases the config or startup config file on both the active and the standby management modules as long as redundancy has not been disabled. If the standby management module is not in standby mode or has failed selftest, the config or startup config file is not erased.

Syntax

erase config|startup configfilename

This option erases the specified startup config file. If the specified file is not the currently active startup-config file, then the file is simply deleted from the memory slot it occupies. If the specified file is the currently active startup-config file, then the switch creates a new, default startup-config file with the same name as the erased file, and boots using this file. (This new startup-config file contains only the default configuration for the software version used in the reboot.)


[NOTE: ]

NOTE: Where a file is assigned to either the primary or the secondary flash, but is not the currently active startup config file, erasing the file does not remove the flash assignment from the memory slot for that file. Thus, if the switch boots using a flash location that does not have an assigned startup-config, then the switch creates a new, default startup-config file and uses this file in the reboot. (This new startup-config file contains only the default configuration for the software version used in the reboot.) Executing write memory after the reboot causes a switch-generated filename of config x to appear in the show config files display for the new file, where x corresponds to the memory slot number.


Syntax

erase startup-config

This option erases the currently active startupconfig file and reboots the switch from the currently active flash memory location. The erased startup-config file is replaced with a new startup-config file. The new file has the same filename as the erased file, but contains only the default configuration for the software version in the flash location (primary or secondary) used for the reboot. For example, suppose the last reboot was from primary flash using a configuration file named minconfig. Executing erase startup-config replaces the current content of minconfig with a default configuration and reboots the switch from primary flash.

Erasing a non-active startup-config file

HP Switch(config)# show config files

Configuration files:

id | act pri sec | name
---+-------------+-----------------------------------------------
 1 |  *   *      | minconfig
 2 |          *  | config2
 3 |             | config3

HP Switch(config)# erase config config3
HP Switch(config)# show config files

Configuration files:

id | act pri sec | name
---+-------------+-----------------------------------------------
 1 |  *   *      | minconfig
 2 |          *  | config2
 3 |             | 

With the same memory configuration as is shown in the bottom portion of the above example, executing erase startup-config boots the switch from primary flash, resulting in a new file named minconfig in the same memory slot. The new file contains the default configuration for the software version currently in primary flash.

Using the Clear + Reset button combination to reset the switch to its default configuration

The Clear + Reset button combination described in the Installation and Getting Started Guide produces these results. That is, when you press the Clear + Reset button combination, the switch:

  • Overwrites the content of the startup-config file currently in memory slot 1 with the default configuration for the software version in primary flash, and renames this file to config1.

  • Erases any other startup-config files currently in memory.

  • Configures the new file in memory slot 1 as the default for both primary and secondary flash locations (regardless of the software version currently in secondary flash).

  • Boots the switch from primary flash using the new startup-config file.

Clear + Reset result

HP Switch(config)# show config files

Configuration files:

id | act pri sec | name
---+-------------+-----------------------------------------------
 1 |  *   *   *  | Config1
 2 |             | 
 3 |             |

TFTP: Copying a configuration file to a remote host

Syntax

copy config <src-file> tftp <ip-addr> <remote-file> <pc | unix> [oobm]

This is an addition to the copy tftp command options. Use this command to upload a configuration file from the switch to a TFTP server.

For switches that have a separate out-of-band management port, the oobm parameter specifies that the TFTP traffic will go out through the out-of-band management interface. If this parameter is not specified, the TFTP traffic goes out through the data interface. The oobm parameter is not available on switches that do not have a separate out-of-band management port.

For more on using TFTP to copy a file to a remote server, see "TFTP: Copying a Configuration File to a Remote Host" in Appendix A of the Management and Configuration Guide for your switch.

For example, the following command copies a startup-config file named test01 from the switch to a (UNIX) TFTP server at IP address 10.10.28.14:

HP Switch(config)# copy config test-01 tftp 10.10.28.14 test-01.txt unix

TFTP: Copying a configuration file from a remote host

Syntax

copy tftp config <dest-file> <ip-addr> <remote-file> <pc | unix> [oobm]

This is an addition to the copy tftp command options. Use this command to download a configuration file from a TFTP server to the switch.

For switches that have a separate out-of-band management port, the OOBM parameter specifies that the TFTP traffic must come in through the out-of-band management interface. If this parameter is not specified, the TFTP traffic comes in through the data interface. The OOBM parameter is not available on switches that do not have a separate out-of-band management port.

Note: This command requires an empty memory slot in the switch. If there are no empty memory slots, the CLI displays the following message:

Unable to copy configuration to "<filename>".

You can erase one or more configuration files using the erase config <filename> command.

For more on using TFTP to copy a file from a remote host, see "TFTP: Copying a Configuration File from a Remote Host" in Appendix A of the Management and Configuration Guide for your switch.

For example, the following command copies a startup-config file named test01.txt from a (UNIX) TFTP server at IP address 10.10.28.14 to the first empty memory slot in the switch:

HP Switch(config)# copy tftp config test-01 10.10.28.14 test-01.txt unix

Xmodem: Copying a configuration file to a serially connected host

Syntax

copy config <filename> xmodem <pc | unix>

This is an addition to thecopy <config> xmodem command options. Use this command to upload a configuration file from the switch to an Xmodem host.

For more on using Xmodem to copy a file to a serially connected host, see "Xmodem: Copying a Configuration File to a Serially Connected PC or UNIX Workstation" in Appendix A of the Management and Configuration Guide for your switch.

Xmodem: copying a configuration file from a serially connected host

Syntax

copy xmodem config <dest-file> <pc | unix>

This is an addition to the copy xmodem command options. Use this command to download a configuration file from an Xmodem host to the switch.

For more on using Xmodem to copy a file from a serially connected host, see "Xmodem: Copying a Configuration File from a Serially Connected PC or UNIX Workstation" in Appendix A of the Management and Configuration Guide for your switch.

Operating notes for multiple configuration files

  • SFTP/SCP: The configuration files are available for sftp/scp transfer as /cfg/<filename>.