- Table of Contents
-
- 01-Fundamentals Command Reference
- 00-Preface
- 01-CLI commands
- 02-RBAC commands
- 03-Login management commands
- 04-FTP and TFTP commands
- 05-File system management commands
- 06-Configuration file management commands
- 07-Software upgrade commands
- 08-ISSU commands
- 09-GIR commands
- 10-Automatic configuration commands
- 11-Device management commands
- 12-Tcl commands
- 13-Python commands
- Related Documents
-
Title | Size | Download |
---|---|---|
09-GIR commands | 113.19 KB |
gir system-mode maintenance maintenance-delay
gir system-mode maintenance revert-delay
gir system-mode maintenance snapshot-delay
GIR commands
config-end
Use config-end to quit custom profile view.
Syntax
config-end
Views
Custom profile view
Predefined user roles
network-admin
Usage guidelines
You can also use the quit command to quit custom profile view. In the configuration file, the quit command is converted to config-end, which indicates the end of the configuration.
Examples
# Quit custom profile view.
<Sysname> system-view
[Sysname] gir custom-profile maintenance-mode
Enter commands, one command per line. To end the configuration and quit GIR profile view, execute the 'config-end' or 'quit' command.
[Sysname-gir-mm-profile] config-end
Related commands
display gir custom-profile
gir custom-profile
sleep instance
display gir custom-profile
Use display gir custom-profile to display the contents of a custom profile.
Syntax
display gir custom-profile [ maintenance-mode | normal-mode ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
maintenance-mode: Specifies the switch-to-maintenance profile.
normal-mode: Specifies the switch-to-normal profile.
Usage guidelines
A custom profile contains a set of user-specified commands to be executed in sequence during a mode switching operation.
To display the custom profile for switching to maintenance mode, specify the maintenance-mode keyword.
To display the custom profile for reverting back to normal mode, specify the normal-mode keyword.
If you do not specify the switch-to-maintenance profile or switch-to-normal profile, this command displays the contents of both profiles.
Examples
# Display the contents of both the switch-to-maintenance profile and switch-to-normal profile.
<Sysname> display gir custom-profile
[Normal Mode]
undo link-aggregation lacp isolate
sleep instance 1 interval 30
bgp 100
undo isolate enable
[Maintenance Mode]
bgp 100
isolate enable
sleep instance 1 interval 30
link-aggregation lacp isolate
Related commands
gir custom-profile
display gir snapshot
Use display gir snapshot to display the GIR snapshots on the device.
Syntax
display gir snapshot
Views
Any view
Predefined user roles
network-admin
network-operator
Usage guidelines
This command displays the name and timestamp of each snapshot. This information is helpful when you make a snapshot comparison to identify configuration changes that might have caused service anomalies or traffic switchover failure.
Examples
# Display the GIR snapshots on the device.
<Sysname> display gir snapshot
Name Time Description
before_maintenance Mon Aug 24 10:10:10 2020 Snapshot taken before maintenance
after_maintenance Mon Aug 24 11:10:10 2020 Snapshot taken after maintenance
Related commands
display gir snapshot compare
gir snapshot create
gir snapshot delete
gir system-mode maintenance
display gir snapshot compare
Use display gir snapshot compare to compare GIR snapshots.
Syntax
display gir snapshot compare snapshot1-name snapshot2-name [ verbose ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
snapshot1-name: Specifies the first GIR snapshot by its name.
snapshot2-name: Specifies the second GIR snapshot by its name.
verbose: Displays detailed information about configuration inconsistencies. If you do not specify this keyword, the command displays summary information about the comparison results.
Usage guidelines
Use this command to compare the configurations for service modules before and after a GIR operation for inconsistencies.
The amount of time for comparison increases as the size of the snapshots.
The snapshots are saved in NETCONF format. For more information about the feature modules and parameters in the command output, see the NETCONF XML API references for your device.
Examples
# Display detailed information about GIR snapshot comparison results.
<Sysname> display gir snapshot compare before_maintenance after_maintenance verbose
Feature Tag before_maintenance after_maintenance
[ifmgr/Interfaces]
[IfIndex:258]
AdminStatus 1 2
OperStatus 1 3
[Route/Ipv4Routes]
[VRF:N/A Topology:N/A ProtocolID: 1]
TotalRoutes 3 4
The output shows that the following changes occurred while the device was in maintenance mode:
· The administrative status of the interface with index 258 changed from 1 to 2. In addition, its operating status changed from 1 to 3.
· The number of routes changed from 3 to 4.
Table 1 Command output
Field |
Description |
Feature |
Feature name. |
Tag |
Parameter tag. |
before_maintenance |
Value for the parameter in the before_maintenance snapshot. |
after_maintenance |
Value for the parameter in the after_maintenance snapshot. |
# Display summary information about GIR snapshot comparison results.
<Sysname> display gir snapshot compare before_maintenance after_maintenance
Feature before_maintenance after_maintenance changed
basic
# Interfaces 39 39 N
# ipv4 routes 7 7 N
# ipv6 routes N/A 7 N/A
ifmgr
# interfaces up 1 0 Y
# interfaces down 38 39 Y
# vlan interfaces 2 2 N
# vlan interfaces up 0 0 N
# vlan interfaces down 2 2 N
Field |
Description |
Feature |
Feature name. |
before_maintenance |
The number of configuration items for the feature in the before_maintenance snapshot. |
after_maintenance |
The number of configuration items for the feature in the after_maintenance snapshot. |
changed |
Configuration change: · Y—The configuration has changed. · N—The configuration has not changed. · N/A—The snapshots cannot be compared, because the data size is too large. |
Related commands
display gir snapshot
display gir system-mode
Use display gir system-mode to display the current GIR system mode.
Syntax
display gir system-mode
Views
Any view
Predefined user roles
network-admin
network-operator
Examples
# Display the current GIR system mode after the device was placed in maintenance mode by using the isolate method.
<Sysname> display gir system-mode
System mode: Maintenance
Revert-delay time: 5min
Maintenance-delay time: 120s
Snapshot-delay time: 120s
# Display the current GIR system mode after the device was placed in maintenance mode by using the shutdown method.
<Sysname> display gir system-mode
System mode: Maintenance(Shutdown)
Revert-delay time: 5min
Maintenance-delay time: 120s
Snapshot–delay time: 120s
# Display the current GIR system mode after the device was placed in maintenance mode by using the profile-based method.
<Sysname> display gir system-mode
System mode: Maintenance(custom-profile)
Revert-delay time: 5min
Maintenance-delay time: 120s
Snapshot-delaytime: 120s
# Display the current GIR system mode after the device was reverted back to normal mode.
<Sysname> display gir system-mode
System mode: Normal
Revert–delay time: 5min
Maintenance–delay time: 120s
Snapshot-delay time: 120s
# Display the current GIR system mode after the device was reverted back to normal mode by using the profile-based method.
<Sysname> display gir system-mode
System mode: Normal(custom-profile)
Revert-delay time: 5min
Maintenance–delay time: 120s
Snapshot–delay time: 120s
Table 3 Command output
Field |
Description |
System mode |
GIR system mode: · maintenance—The device was placed in maintenance mode by using the isolate method. · maintenance (shutdown)—The device was placed in maintenance mode by using the shutdown method. · maintenance (custom-profile)—The device was placed in maintenance mode by using the profile-based method. · normal—The device was reverted back to normal mode by performing a reverse switching. · normal (custom-profile)—The device was reverted back to normal mode by using the profile-based method. |
Revert-delay time |
The delay (in minutes) for the system to automatically revert back to normal mode. |
Maintenance-delay time |
The delay (in seconds) for the system to enter maintenance mode. |
Snapshot-delay time |
The delay (in seconds) for the system to create an after_maintenance snapshot after it reverts back to normal mode. |
Related commands
gir system-mode maintenance
gir custom-profile
Use gir custom-profile to enter custom profile view.
Use undo custom-profile to delete a custom profile.
Syntax
gir custom-profile { maintenance-mode | normal-mode }
undo gir custom-profile { maintenance-mode | normal-mode }
Views
System view
Predefined user roles
network-admin
Parameters
maintenance-mode: Specifies the switch-to-maintenance profile.
normal-mode: Specifies the switch-to-normal profile.
Usage guidelines
A custom profile contains a series of user-specified commands to be executed in sequence upon a mode switching.
With GIR, you can configure one switch-to-maintenance profile and one switch-to-normal profile for changing to maintenance mode and normal mode, respectively.
When you edit a customer profile, use the following guidelines:
· The system executes the commands in a custom profile in their configuration order. If one command depends on another, enter the prerequisite command first.
· Do not add commands in user view to custom profiles. The system can execute only commands in system view or subviews of system view.
· By default, the system executes the commands in a custom profile in system view. To execute a command in a subview of system view, you must add the command used to access that subview before you add the command to execute in that subview.
· If it takes some time for a command to take effect after it is executed, you can add the sleep instance command next to it to introduce a delay. The system will wait for the delay to expire before it executes subsequent commands. If you are not sure whether a command requires a delay, add the sleep instance 0 command next to it. Then, you can change the value after you determine that a delay is required.
· If you have inadvertently entered an incorrect command, you can add its undo form to remove it as long as that command is reversible by simply adding the undo keyword before it. Then, the system will automatically delete that command and its undo form from the profile. You cannot use this method to remove a command if it does not have an undo form or if the command and its undo form is not symmetric.
· The system provides the following mechanisms for profile optimization:
¡ Deduplication mechanism—If you enter the same command line multiple times, the system automatically removes the duplicate commands. You do not need to do that manually.
¡ Command grouping—The system groups commands in the same view together and then executes them in configuration order.
· Before you edit a custom profile, review the series of commands you will use and make sure they are in correct order. You can only append commands to the end of a custom profile. You cannot remove or modify commands in a custom profile or insert a command between commands in the profile, except that you can edit the sleep instance settings.
· Verify the settings in the custom profiles by executing the display gir custom-profile command. If you introduce irreversible misconfiguration items in a custom profile, delete and then reconfigure that profile.
· If you need to slightly optimize the series of commands used when the system changes to maintenance or normal mode, use the following method:
a. Make sure the switch-to-maintenance or switch-to-normal custom profile is empty.
b. Execute an isolate or shutdown mode switching.
The system automatically populates the custom profile with the series of commands executed on mode switching.
c. Edit the custom profile.
Examples
# Configure a switch-to-maintenance profile to have the system set the system MAC address used in LACP to 0001-0001-0001 when it enters maintenance mode.
<Sysname> system-view
[Sysname] gir custom-profile maintenance-mode
Enter commands, one command per line. To end the configuration and quit GIR profile view, execute the 'config-end' or 'quit' command.
[Sysname-gir-mm-profile] lacp system-mac 1-1-1
[Sysname-gir-mm-profile] config-end
# Configure a switch-to-normal profile to have the system restore the system MAC address used in LACP to the default when it reverts back to normal mode.
<Sysname> system-view
[Sysname] gir custom-profile normal-mode
Enter commands, one command per line. To end the configuration and quit GIR profile view, execute the 'config-end' or 'quit' command.
[Sysname-gir-nm-profile] undo lacp system-mac
[Sysname-gir-nm-profile] config-end
Related commands
config-end
display gir custom-profile
sleep instance
gir snapshot add
Use gir snapshot add to include additional data in snapshots.
Use undo snapshot add to restore the default.
Syntax
gir snapshot add { ipv4routes | ipv6routes }*
undo gir snapshot add [ ipv4routes | ipv6routes ]*
Default
The system does not include additional data in GIR snapshots.
Views
System view
Predefined user roles
network-admin
Parameters
ipv4routes: Specifies IPv4 routes.
ipv6routes: Specifies IPv6 routes.
Usage guidelines
By default, the system does not include routing information in snapshots, because the routing table is large in size.
To include IPv4 or IPv6 routing information in snapshots, execute this command.
Examples
# Include IPv4 routing information in GIR snapshots.
<Sysname> system-view
[Sysname] gir snapshot add ipv4routes
# Include IPv6 routing information in GIR snapshots.
<Sysname> system-view
[Sysname] gir snapshot add ipv6routes
Related commands
gir snapshot create
gir system-mode maintenance
gir snapshot create
Use gir snapshot add to create a snapshot.
Syntax
gir snapshot create snapshot-name description
Views
System view
Predefined user roles
network-admin
Parameters
snapshot-name: Specifies a snapshot name, a string of 1 to 64 characters. The name can contain only digits, letters, and underscores (_) and cannot be before_maintenance, after_maintenance, or all. Whether the snapshot name is case sensitive depends on the device model.
description: Specifies a snapshot description, a case-sensitive string of 1 to 255 characters.
Usage guidelines
Before the device enters maintenance mode, it automatically generates a GIR snapshot named before_maintenance. After the device returns to normal mode, it generates a GIR snapshot named after_maintenance.
In addition to the automatically generated snapshots, you can manually create a snapshot at any time and compare two snapshots to view changes in running data over a period of time.
You can create a maximum number of 10 snapshots.
Do not switch the GIR system mode or create a snapshot while the device is generating a snapshot.
Examples
# Create a snapshot named snapA.
<Sysname> system-view
[System] gir snapshot create snapA Aaaa
Collecting snapshot data...Please wait.
Generated a snapshot: snapA.
Related commands
display gir snapshot
gir snapshot delete
Use gir snapshot delete to delete snapshots.
Syntax
gir snapshot delete { all | snapshot-name }
Views
System view
Predefined user roles
network-admin
Parameters
all: Specifies all snapshots.
snapshot-name: Specifies a snapshot by its name, a string of 1 to 64 characters.
Examples
# Delete all snapshots.
<Sysname> system-view
[Sysname] gir snapshot delete all
# Delete a snapshot named snapA.
<Sysname> system-view
[Sysname] gir snapshot delete snapA
Related commands
display gir snapshot
gir system-mode maintenance
Use gir system-mode maintenance to switch from normal mode to maintenance mode.
Use undo gir system-mode maintenance to revert back to normal mode from maintenance mode.
Syntax
gir system-mode maintenance [ shutdown | custom-profile ] [ non-interactive ]
undo gir system-mode maintenance [ custom-profile ] [ non-interactive ]
Views
System view
Predefined user roles
network-admin
Parameters
shutdown: Configures GIR to perform shutdown switching to change from normal mode to maintenance mode.
custom-profile: Configures GIR to perform profile-based switching to change from normal mode to maintenance mode, or to change from maintenance mode back to normal mode.
non-interactive: Performs mode switching in non-interactive mode. In this mode, the system performs mode switching in the background without displaying the switching process. The CLI is available for use during mode switching. If you do not specify this keyword, the system performs mode switching in interactive mode, in which the system displays the mode switching process. In interactive mode, the CLI is not available for use during mode switching.
CAUTION: When you execute commands during a non-interactive mode switching, make sure you fully understand the impact of these commands on services. Do not execute a command if it might cause traffic loss or an undesirable change in configuration. |
Usage guidelines
CAUTION: · Packet loss might occur when you switch to maintenance mode. · Do not restart the device or a process while GIR is switching mode. The system cannot roll back settings issued during mode switching. If you restart the device or a disruptive process, mode switching will be interrupted, with only some of the commands issued. |
To change from normal mode to maintenance mode, use one of the following methods:
· Isolate switching—By default, GIR performs isolate switching to change from normal mode to maintenance mode if you do not specify shutdown or profile-based switching. With isolate switching, GIR uses the isolation commands of each GIR-applicable service module to isolate the device from the network.
· Shutdown switching—GIR uses the shutdown method for each GIR-applicable service module to isolate the device when it changes the device from normal mode to maintenance mode. With this method, GIR also shuts down all interfaces except the management port.
· Profile-based switching—GIR executes the applicable custom profile when it changes the system from normal mode to maintenance mode.
When GIR performs an isolate or shutdown switching, it automatically writes the executed series of commands to the switch-to-maintenance custom profile if the profile is empty.
To change from maintenance mode back to normal mode, use one of the following methods:
· Profile-based switching—Configure GIR to do profile-based switching by specifying the custom-profile keyword. GIR will execute the switch-to-normal custom profile when it performs mode switching.
· Reverse switching—Configure GIR to do reverse switching by executing the undo gir system-mode maintenance command without specifying the custom-profile keyword. GIR will perform operations in reverse to the operations performed when it changed from normal mode to maintenance mode.
When GIR performs a reverse switching, it automatically writes the executed series of commands to the switch-to-normal custom profile if the profile is empty.
Before you change the GIR mode, follow these restrictions and guidelines:
· Make sure the system is stable. Use the display system stable state command to identify the system state. The system is stable if the System State field displays Stable. For more information about this command, see device management commands in Fundamentals Command Reference.
· If the device is comparing snapshots, wait for the comparison to end before you change the GIR mode.
· Before you change an M-LAG system back to normal mode, execute the displa m-lag mad verbose command to verify that no network interfaces are in M-LAG MAD DOWN state. For more information about M-LAG, see Layer 2—LAN Switching Configuration Guide.
After you change the GIR mode, follow these restrictions and guidelines:
· To maintain configuration consistency for a feature across mode switching, do not modify its configuration after you place the device in maintenance mode. To check for configuration changes, execute the display gir snapshot compare command after you revert the device back to normal mode.
· The device will return to normal mode even if a protocol has failed in switchover. In addition, the device will not roll back the settings that it has configured.
· If a service module fails in switchover, use the following methods to identify and remove the issue:
¡ Remove the issue based on the error message.
¡ Compare the snapshots to identify configuration inconsistencies that might have caused the issue.
Examples
# Perform an isolate switching to place the device in maintenance mode.
<Sysname> system-view
[Sysname] gir system-mode maintenance
Collecting commands... Please wait.
Configuration to be applied:
bgp 1
isolate enable
isis 2
isolate enable
sleep instance 1 interval 30
link-aggregation lacp isolate
Do you want to continue? [Y/N]: y
Generated a snapshot: before_maintenance.
Applying: bgp 1
Applying: isolate enable
Applying: isis 2
Applying: isolate enable
Applying: sleep instance 1 interval 30
Applying: link-aggregation lacp isolate
Waiting 120 seconds to release the CLI.
Changed to maintenance mode successfully.
# Perform a shutdown switching to place the device in maintenance mode.
<Sysname> system-view
[Sysname] gir system-mode maintenance shutdown
Collecting commands... Please wait.
Configuration to be applied:
isis 2
shutdown process
sleep instance 1 interval 60
shutdown all-physical-interfaces
The operation will shut down all physical interfaces except the management ports.
Do you want to continue? [Y/N]: y
Generated a snapshot: before_maintenance.
Applying: isis 2
Applying: shutdown process
Applying: sleep instance 1 interval 60
Applying: shutdown all-physical-interfaces
Waiting 120 seconds to release the CLI.
Changed to maintenance mode successfully.
# Perform a profile-based switching to place the device in maintenance mode.
<Sysname> system-view
[Sysname] gir system-mode maintenance custom-profile
Collecting commands... Please wait.
Configuration to be applied:
bgp 1
isolate enable
isis 2
isolate enable
sleep instance 1 interval 60
link-aggregation lacp isolate
Do you want to continue? [Y/N]: y
Generated a snapshot: before_maintenance.
Applying: bgp 1
Applying: isolate enable
Applying: isis 2
Applying: isolate enable
Applying: sleep instance 1 interval 60
Applying: link-aggregation lacp isolate
Waiting 120 seconds to release the CLI.
Changed to maintenance mode successfully.
# Perform a reverse switching to place the device in normal mode.
<Sysname> system-view
[Sysname] undo gir system-mode maintenance
Collecting commands... Please wait.
Configuration to be applied:
undo link-aggregation lacp isolate
sleep instance 1 interval 30
isis 2
undo isolate enable
bgp 1
undo isolate enable
Do you want to continue? [Y/N]: y
Applying: undo link-aggregation lacp isolate
Applying: sleep instance 1 interval 30
Applying: isis 2
Applying: undo isolate enable
Applying: bgp 1
Applying: undo isolate enable
Waiting 120 seconds to generate a snapshot.
Generated a snapshot: after_maintenance.
Changed to normal mode successfully.
# Perform a profile-based switching to place the device in normal mode.
<Sysname> system-view
[Sysname] undo gir system-mode maintenance custom-profile
Collecting commands... Please wait.
Configuration to be applied:
undo link-aggregation lacp isolate
sleep instance 1 interval 60
bgp 1
undo isolate enable
Do you want to continue? [Y/N]: y
Applying: undo link-aggregation lacp isolate
Applying: sleep instance 1 interval 60
Applying: bgp 1
Applying: undo isolate enable
Waiting 120 seconds to generate a snapshot.
Generated a snapshot: after_maintenance.
Changed to normal mode successfully.
# Perform a non-interactive isolate switching to place the device in maintenance mode.
<Sysname> system-view
[Sysname] gir system-mode maintenance non-interactive
Mode switching will be performed in the background.
Related commands
display gir custom-profile
display gir snapshot
display gir snapshot compare
gir system-mode maintenance maintenance-delay
Use gir system-mode maintenance maintenance-delay to set the delay for the device to finish mode switching and enter maintenance mode.
Use undo gir system-mode maintenance maintenance-delay to restore the default.
Syntax
gir system-mode maintenance maintenance-delay value
undo gir system-mode maintenance maintenance-delay
Default
The maintenance delay is 120 seconds.
Views
System view
Predefined user roles
network-admin
Parameters
value: Specifies a delay value in the range of 0 to 65535 seconds.
Usage guidelines
Execution of some commands might take some time. To make sure all applicable service modules complete traffic path switchover before you maintain the device, increase the maintenance delay if the default value is not sufficient.
Examples
# Set the maintenance delay to 10 seconds.
<Sysname> system-view
[Sysname] gir system-mode maintenance maintenance-delay 10
Related commands
gir system-mode maintenance
gir system-mode maintenance revert-delay
Use gir system-mode maintenance revert-delay to specify the delay for the system to automatically revert back to normal mode.
Use undo gir system-mode maintenance revert-delay to restore the default.
Syntax
gir system-mode maintenance revert-delay value
undo gir system-mode maintenance revert-delay
Default
The system does not automatically revert to normal mode.
Views
System view
Predefined user roles
network-admin
Parameters
value: Specifies a delay value in the range of 5 to 65535 minutes.
Usage guidelines
Automatic reverse switching enables the system to automatically revert back to normal mode from maintenance mode when the specified revert-delay expires.
This command is helpful when the window of maintenance is deterministic.
Examples
# Set the revert-delay to 10 minutes for automatic reverse switching.
<Sysname> system-view
[Sysname] gir system-mode maintenance revert-delay 10
Related commands
gir system-mode maintenance
gir system-mode maintenance snapshot-delay
Use gir system-mode maintenance snapshot-delay to set the delay for creation of after_maintenance snapshots.
Use undo gir system-mode maintenance snapshot-delay to restore the default.
Syntax
gir system-mode maintenance snapshot-delay value
undo gir system-mode maintenance snapshot-delay
Default
The delay for creation of after_maintenance snapshots is 120 seconds.
Views
System view
Predefined user roles
network-admin
Parameters
value: Specifies a delay value in the range of 0 to 65535 seconds.
Usage guidelines
If the default snapshot delay value is not sufficient for a service module to restore its services, increase the delay so that GIR can take a snapshot of complete and accurate data.
Examples
# Set the delay for creation of after_maintenance snapshots to 10 seconds.
<Sysname> system-view
[System] gir system-mode maintenance snapshot-delay 10
Related commands
gir system-mode maintenance
sleep instance
Use sleep instance to introduce a delay between two commands in a custom profile.
Syntax
sleep instance instance-number interval seconds
Default
The system executes the commands in a custom profile one by one without delay in between.
Views
Custom profile view
Predefined user roles
network-admin
Parameters
instance-number: Specifies an instance number for a delay. The value range is 0 to 2177483647 seconds.
seconds: Specifies the number of seconds that GIR must wait before it executes the next command. The value range is 0 to 2177483647 seconds.
Usage guidelines
If a command cannot take effect immediately after it is executed, you can add a delay instance (called a sleep instance) next to it before you enter subsequent commands. Then, after the system executes that command, the system will wait for the sleep instance to expire before it executes the subsequent commands.
You can repeat this command to change the value for a delay instance. If you are not sure whether a command requires a delay, add the sleep instance 0 command. Then, you can change the value after you determine the length of delay.
Examples
# Add a 10-second sleep instance.
<Sysname> system-view
[Sysname] gir custom-profile maintenance-mode
Enter commands, one command per line. To end the configuration and quit GIR profile view, execute the 'config-end' or 'quit' command.
[Sysname-gir-mm-profile] sleep instance 1 interval 10
Related commands
gir custom-profile