Maintenance Mode

SR Linux maintenance mode allows you to take a network element out of service so that maintenance actions can be performed; for example, to upgrade the software image on a router.

Using SR Linux maintenance mode, you can do this with minimal impact on traffic. SR Linux maintenance mode works as follows:

  1. A maintenance group is configured that specifies the resources to be taken out of service. See Configuring a maintenance group.

  2. A maintenance profile is configured that specifies policy changes to apply when the group is in maintenance mode. A maintenance profile is associated with each maintenance group. See Configuring a maintenance profile.

    The usual intent of the policy changes is to de-preference paths through the maintenance group so that traffic is diverted elsewhere.

  3. The maintenance group is placed into maintenance mode, which applies the policies in the associated maintenance profile. See Placing a maintenance group into maintenance mode.

  4. The user monitors the traffic on the interfaces in the maintenance group. When the traffic rate falls below a threshold, the user shuts down the members of the maintenance group and performs the required service. See Taking a maintenance group out of service.

  5. After the service is completed, the user takes the maintenance group out of maintenance mode, which disables the policies in the associated maintenance profile, and restores traffic on the original paths. See Restoring the maintenance group to service.

Configuring a maintenance group

A maintenance group specifies a set of network resources to be taken out of service when maintenance mode is enabled. For example, a maintenance group can consist of one or more BGP neighbors or peer groups belonging to a one or more network instances.

Specify a set of network resources in a maintenance group. The network resources in the maintenance group are taken out of service when maintenance mode is enabled.

The following example configures maintenance group mgroup1, consisting of the BGP neighbors in peer group headquarters1, which exists in the default network instance, as well as BGP neighbors in peer group headquarters2, which exists in network instance "black". In the example, maintenance group mgroup1 is associated with maintenance profile mprof1.

--{ candidate shared default }--[  ]--
# info system maintenance
    system {
        maintenance {
            group mgroup1 {
                maintenance-profile mprof1
                maintenance-mode {
                    admin-state disable
                }
                members {
                    bgp {
                        network-instance default {
                            peer-group [
                                headquarters1
                            ]
                        network-instance black {
                            peer-group [
                                headquarters2
                            ]
                        }
                    }
                }
            }
        }
    }

Configuring a maintenance profile

In a maintenance profile, you specify policy changes that are applied to members of a maintenance group when maintenance mode is enabled for the group.

The following example configures a routing policy and a maintenance profile that references the routing policy.

The following defines the routing policy drain-with-as-path-prepend:

--{ candidate shared default }--[  ]--
# info routing-policy policy drain-with-as-path-prepend
    routing-policy {
        policy drain-with-as-path-prepend {
            default-action {
                accept {
                    bgp {
                        as-path {
                            prepend {
                                as-number auto
                                repeat-n 3
                            }
                        }
                    }
                }
            }
        }
    }

The following defines a maintenance profile that references the routing policy drain-with-as-path-prepend.

--{ candidate shared default }--[  ]--
# info system maintenance
    system {
        maintenance {
            profile mprof1 {
                bgp {
                    import-policy drain-with-as-path-prepend
                    export-policy drain-with-as-path-prepend
                }
            }
        }
    }

Placing a maintenance group into maintenance mode

When a maintenance group is placed into maintenance mode, it applies the policies in the associated maintenance profile to the resources in the maintenance group.

To place a maintenance group into maintenance mode, change the setting for maintenance-mode in the group configuration to enable, then commit the configuration.

The following example enables maintenance mode for maintenance group mgroup1, and commits the configuration. The policies configured in the maintenance profile associated with mgroup1 are applied to the resources configured in mgroup1.

--{ candidate shared default }--[  ]--
# info system maintenance group mgroup1
    system {
        maintenance {
            group mgroup1 {
                maintenance-mode {
                    admin-state enable
                }
            }
        }
    }
--{ * candidate shared default }--[  ]--
# commit stay
All changes have been committed. Starting new transaction.

Taking a maintenance group out of service

After enabling maintenance mode for a maintenance group, monitor the traffic on the interfaces in the group. When the traffic rate drops to an acceptable level, shut down the members of the maintenance group and perform the required service.

Monitor traffic for an interface using the info from state command to show interface traffic statistics. When the traffic rate reaches a low-enough level, administratively disable the interface.

To monitor an interface:

--{ running }--[  ]--
# info from state interface ethernet-1/2 statistics
    interface ethernet-1/2 {
        statistics {
            in-octets 46969
            in-unicast-pkts 492
            in-broadcast-pkts 0
            in-multicast-pkts 34
            in-discards 0
            in-errors 0
            in-unknown-protos 0
            in-fcs-errors 0
            out-octets 46169
            out-unicast-pkts 490
            out-broadcast-pkts 1
            out-multicast-pkts 25
            out-discards 0
            out-errors 0
            carrier-transitions 1

To shut down the interface:

--{ * candidate shared default }--[  ]--
# interface ethernet-1/2 admin-state disable
# commit stay
All changes have been committed. Starting new transaction.

Restoring the maintenance group to service

After performing the required maintenance operations, restore the maintenance group to service.

To restore the maintenance group to service, change the setting for the maintenance-mode state in the group configuration to disable, then commit the configuration.

The following example takes maintenance group mgroup1 out of maintenance mode:

--{ candidate shared default }--[  ]--
# info system maintenance group mgroup1
    system {
        maintenance {
            group mgroup1 {
                maintenance-mode {
                    admin-state disable
                }
            }
        }
    }
--{ * candidate shared default }--[  ]--
# commit stay
All changes have been committed. Starting new transaction.