Configuring the Maintenance-Mode Profile

You can create a maintenance-mode profile with configuration commands that can be applied during graceful removal or graceful insertion.

For more information, see the Cisco Nexus 9000 Series NX-OS System Management Configuration Guide:

https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-installation-and-configuration-guides-list.html/

Configuring a Maintenance-Mode Profile

 Configuring a Maintenance-Mode Profile
POST http://<IP_Address>/api/mo/sys/mmode/profile-maintenance-mode.json
{
    "mmodeProfile": {
        "attributes": {
            "profType": "maintenance-mode",
        }
        "children": [
            {
                "mmodeProfileEntry": {
                    "attributes": {
                        "configCmd": "router bgp 100",
                        "parentSequence": "0",
                        "sequence": "1",
                    }
                }
            },
            {
                "mmodeProfileEntry": {
                    "attributes": {
                        "configCmd": "isolate",
                        "parentSequence": "1",
                        "sequence": "2",
                    }
                }
            },
            {
                "mmodeProfileEntry": {
                    "attributes": {
                        "configCmd": "router ospf test1",
                        "parentSequence": "0",
                        "sequence": "3",
                    }
                }
            },
            {
                "mmodeProfileEntry": {
                    "attributes": {
                        "configCmd": "isolate",
                        "parentSequence": "3",
                        "sequence": "4",	
                    }
                }
            }
        ]
    }
}

CLI Commands

Switch# configure maintenance profile maintenance-mode Please configure 'system mode maintenance always-use-custom-profile' if you want to use custom profile always for maintenance mode. Enter configuration commands, one per line. End with CNTL/Z. Switch(config-mm-profile)# router bgp 100 Switch(config-mm-profile-router)# isolate Switch(config-mm-profile)# router ospf test1 Switch(config-mm-profile-router)# isolate Switch(config-mm-profile-router)# exit Switch(config-mm-profile)# exit Exit maintenance profile mode. Switch#


Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

MODN
mmodeProfile sys/mmode/profile-maintenance-mode
mmodeProfileEntry sys/mmode/profile-maintenance-mode/entry-1


mmodeProfile Properties

The following table contains information about the mmodeProfile properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
profTypemmode:MaintProfileType
(scalar:Enum8)
Maintenance Profile TypeSELECTION:
0 - normal-mode
1 - maintenance-mode
DEFAULT: normal-mode


mmodeProfileEntry Properties

The following table contains information about the mmodeProfileEntry properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
configCmdscalar:Bool
Config Command is ValidSELECTION: true or false
parentSequencescalar:Uint16
Profile Entry Parent Sequence NumberRANGE: [0, 65535]
DEFAULT: 0
sequencescalar:Uint16
Profile Entry Sequence NumberRANGE: [0, 65535]

Note: Applying mmode payload via REST is only supported in a box that has no pre-existing mmode config and payload needs to be framed from another Cisco Box using NX-API sandbox.


Related Documentation

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Verifying the Maintenance-Mode Profile Configuration

Verifying the Maintenance-Mode Profile Configuration
GET http://<IP_Address>/api/mo/sys/mmode/profile-maintenance-mode.json?rsp-subtree=full
{
    "totalCount": "1",
    "imdata": [
        {
            "mmodeProfile": {
                "attributes": {
                    "childAction": "",
                    "dn": "sys/mmode/profile-maintenance-mode",
                    "modTs": "2019-05-15T12:11:02.295+00:00",
                    "profType": "maintenance-mode",
                    "status": ""
                },
                "children": [
                    {
                        "mmodeProfileEntry": {
                            "attributes": {
                                "childAction": "",
                                "configCmd": "router ospf test1",
                                "configCmdValid": "yes",
                                "modTs": "2019-05-15T12:11:17.610+00:00",
                                "parentSequence": "0",
                                "rn": "entry-3",
                                "sequence": "3",
                                "status": ""
                            }
                        }
                    },
                    {
                        "mmodeProfileEntry": {
                            "attributes": {
                                "childAction": "",
                                "configCmd": "isolate",
                                "configCmdValid": "yes",
                                "modTs": "2019-05-15T12:11:19.915+00:00",
                                "parentSequence": "3",
                                "rn": "entry-4",
                                "sequence": "4",
                                "status": ""
                            }
                        }
                    },
                    {
                        "mmodeProfileEntry": {
                            "attributes": {
                                "childAction": "",
                                "configCmd": "isolate",
                                "configCmdValid": "yes",
                                "modTs": "2019-05-15T12:09:23.908+00:00",
                                "parentSequence": "1",
                                "rn": "entry-2",
                                "sequence": "2",
                                "status": ""
                            }
                        }
                    },
                    {
                        "mmodeProfileEntry": {
                            "attributes": {
                                "childAction": "",
                                "configCmd": "router bgp 100",
                                "configCmdValid": "yes",
                                "modTs": "2019-05-15T12:09:19.692+00:00",
                                "parentSequence": "0",
                                "rn": "entry-1",
                                "sequence": "1",
                                "status": ""
                            }
                        }
                    }
                ]
            }
        }
    ]
}

Note: This example was added in Release 9.3(1).


CLI Commands

Switch# show maintenance profile maintenance-mode [Maintenance Mode] router bgp 100 isolate router ospf test1 isolate


Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

MODN
mmodeProfile sys/mmode/profile-maintenance-mode
mmodeProfileEntry sys/mmode/profile-maintenance-mode/entry-3


mmodeProfile Properties

The following table contains information about the mmodeProfile properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
childAction
mo:ModificationChildAction
scalar:Bitmask32
Delete or ignore. For internal use only.SELECTION:
  • 16384u - deleteAll
  • 4096u - ignore
  • 8192u - deleteNonPresent
  • DEFAULT: 0
  • dn
    reference:BinRef
    A tag or metadata is a non-hierarchical keyword or term assigned to the fabric module.
    modTsmo:TStamp
    (scalar:Date)
    The time when this object was last modified.SELECTION:
    0 - never
    DEFAULT: never
    profTypemmode:MaintProfileType
    (scalar:Enum8)
    Maintenance Profile TypeSELECTION:
    0 - normal-mode
    1 - maintenance-mode
    DEFAULT: normal-mode
    statusmo:ModificationStatus
    (scalar:Bitmask32)
    Modification statusSELECTION:
    2 - created
    4 - modified
    8 - deleted
    16 - replaced


    mmodeProfileEntry Properties

    The following table contains information about the mmodeProfileEntry properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

    Property NameData TypeDescriptionValues
    childAction
    mo:ModificationChildAction
    scalar:Bitmask32
    Delete or ignore. For internal use only.SELECTION:
  • 16384u - deleteAll
  • 4096u - ignore
  • 8192u - deleteNonPresent
  • DEFAULT: 0
  • configCmdscalar:Bool
    Config Command is ValidSELECTION: true or false
    configCmdValidscalar:Bool
    Config Command is ValidSELECTION: true or false
    modTsmo:TStamp
    (scalar:Date)
    The time when this object was last modified.SELECTION:
    0 - never
    DEFAULT: never
    parentSequencescalar:Uint16
    Profile Entry Parent Sequence NumberRANGE: [0, 65535]
    DEFAULT: 0
    rn
    reference:BinRN
    Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names.
    sequencescalar:Uint16
    Profile Entry Sequence NumberRANGE: [0, 65535]
    statusmo:ModificationStatus
    (scalar:Bitmask32)
    Modification statusSELECTION:
    2 - created
    4 - modified
    8 - deleted
    16 - replaced


    Related Documentation

    For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

    http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

    See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

    https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

    For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

    https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

    Configuring a Normal-Mode Profile

    Configuring a Normal-Mode Profile
    
    POST http://<IP_Address>/api/mo/sys/mmode/profile-normal-mode.json
    
    {
        "mmodeProfile": {
            "attributes": {
                "profType": "normal-mode",
            }
            "children": [
                {
                    "mmodeProfileEntry": {
                        "attributes": {
                            "configCmd": "router bgp 100",
                            "parentSequence": "0",
                            "sequence": "1",
                        }
                    }
                },
                {
                    "mmodeProfileEntry": {
                        "attributes": {
                            "configCmd": "no isolate",
                            "parentSequence": "1",
                            "sequence": "2",
                        }
                    }
                },
                            {
                    "mmodeProfileEntry": {
                        "attributes": {
                            "configCmd": "router ospf test1",
                            "parentSequence": "0",
                            "sequence": "3",
                        }
                    }
                },
                {
                    "mmodeProfileEntry": {
                        "attributes": {
                            "configCmd": "no isolate",
                            "parentSequence": "3",
                            "sequence": "4",
                        }
                    }
                }
            ]
        }
    }
    

    CLI Commands

    Switch# configure maintenance profile normal-mode Please configure 'system mode maintenance always-use-custom-profile' if you want to use custom profile always for maintenance mode. Enter configuration commands, one per line. End with CNTL/Z. Switch(config-mm-profile)# router bgp 100 Switch(config-mm-profile-router)# no isolate Switch(config-mm-profile-router)# router ospf test1 Switch(config-mm-profile-router)# no isolate Switch(config-mm-profile-router)# exit Switch(config-mm-profile)# exit Exit maintenance profile mode. Switch# --


    Verifying a DME Configuration
    The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

    MODN
    mmodeProfile sys/mmode/profile-normal-mode
    mmodeProfileEntry sys/mmode/profile-normal-mode/entry-1


    mmodeProfile Properties

    The following table contains information about the mmodeProfile properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

    Property NameData TypeDescriptionValues
    profTypemmode:MaintProfileType
    (scalar:Enum8)
    Maintenance Profile TypeSELECTION:
    0 - normal-mode
    1 - maintenance-mode
    DEFAULT: normal-mode


    mmodeProfileEntry Properties

    The following table contains information about the mmodeProfileEntry properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

    Property NameData TypeDescriptionValues
    configCmdscalar:Bool
    Config Command is ValidSELECTION: true or false
    parentSequencescalar:Uint16
    Profile Entry Parent Sequence NumberRANGE: [0, 65535]
    DEFAULT: 0
    sequencescalar:Uint16
    Profile Entry Sequence NumberRANGE: [0, 65535]

    Note: Applying mmode payload via REST is only supported in a box that has no pre-existing mmode config and payload needs to be framed from another Cisco Box using NX-API sandbox.


    Related Documentation

    For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

    http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

    See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

    https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

    For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

    https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

    Verifying the Normal-Mode Profile Configuration

    Verifying the Normal-Mode Profile Configuration
    
    GET http://<IP_Address>/api/mo/sys/mmode/profile-normal-mode.json?rsp-subtree=full
    
    {
        "totalCount": "1",
        "imdata": [
            {
                "mmodeProfile": {
                    "attributes": {
                        "childAction": "",
                        "dn": "sys/mmode/profile-normal-mode",
                        "modTs": "2019-05-15T12:28:13.309+00:00",
                        "profType": "normal-mode",
                        "status": ""
                    },
                    "children": [
                        {
                            "mmodeProfileEntry": {
                                "attributes": {
                                    "childAction": "",
                                    "configCmd": "router ospf test1",
                                    "configCmdValid": "yes",
                                    "modTs": "2019-05-15T12:28:25.968+00:00",
                                    "parentSequence": "0",
                                    "rn": "entry-3",
                                    "sequence": "3",
                                    "status": ""
                                }
                            }
                        },
                        {
                            "mmodeProfileEntry": {
                                "attributes": {
                                    "childAction": "",
                                    "configCmd": "no isolate",
                                    "configCmdValid": "yes",
                                    "modTs": "2019-05-15T12:28:28.579+00:00",
                                    "parentSequence": "3",
                                    "rn": "entry-4",
                                    "sequence": "4",
                                    "status": ""
                                }
                            }
                        },
                        {
                            "mmodeProfileEntry": {
                                "attributes": {
                                    "childAction": "",
                                    "configCmd": "no isolate",
                                    "configCmdValid": "yes",
                                    "modTs": "2019-05-15T12:28:21.419+00:00",
                                    "parentSequence": "1",
                                    "rn": "entry-2",
                                    "sequence": "2",
                                    "status": ""
                                }
                            }
                        },
                        {
                            "mmodeProfileEntry": {
                                "attributes": {
                                    "childAction": "",
                                    "configCmd": "router bgp 100",
                                    "configCmdValid": "yes",
                                    "modTs": "2019-05-15T12:28:17.854+00:00",
                                    "parentSequence": "0",
                                    "rn": "entry-1",
                                    "sequence": "1",
                                    "status": ""
                                }
                            }
                        }
                    ]
                }
            }
        ]
    }
    

    Note: This example was added in Release 9.3(1).


    CLI Commands

    Switch# show maintenance profile normal-mode [Normal Mode] router bgp 100 no isolate router ospf test1 no isolate


    Verifying a DME Configuration
    The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

    MODN
    mmodeProfile sys/mmode/profile-normal-mode
    mmodeProfileEntry sys/mmode/profile-normal-mode/entry-3


    mmodeProfile Properties

    The following table contains information about the mmodeProfile properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

    Property NameData TypeDescriptionValues
    childAction
    mo:ModificationChildAction
    scalar:Bitmask32
    Delete or ignore. For internal use only.SELECTION:
  • 16384u - deleteAll
  • 4096u - ignore
  • 8192u - deleteNonPresent
  • DEFAULT: 0
  • dn
    reference:BinRef
    A tag or metadata is a non-hierarchical keyword or term assigned to the fabric module.
    modTsmo:TStamp
    (scalar:Date)
    The time when this object was last modified.SELECTION:
    0 - never
    DEFAULT: never
    profTypemmode:MaintProfileType
    (scalar:Enum8)
    Maintenance Profile TypeSELECTION:
    0 - normal-mode
    1 - maintenance-mode
    DEFAULT: normal-mode
    statusmo:ModificationStatus
    (scalar:Bitmask32)
    Modification statusSELECTION:
    2 - created
    4 - modified
    8 - deleted
    16 - replaced


    mmodeProfileEntry Properties

    The following table contains information about the mmodeProfileEntry properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

    Property NameData TypeDescriptionValues
    childAction
    mo:ModificationChildAction
    scalar:Bitmask32
    Delete or ignore. For internal use only.SELECTION:
  • 16384u - deleteAll
  • 4096u - ignore
  • 8192u - deleteNonPresent
  • DEFAULT: 0
  • configCmdscalar:Bool
    Config Command is ValidSELECTION: true or false
    configCmdValidscalar:Bool
    Config Command is ValidSELECTION: true or false
    modTsmo:TStamp
    (scalar:Date)
    The time when this object was last modified.SELECTION:
    0 - never
    DEFAULT: never
    parentSequencescalar:Uint16
    Profile Entry Parent Sequence NumberRANGE: [0, 65535]
    DEFAULT: 0
    rn
    reference:BinRN
    Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names.
    sequencescalar:Uint16
    Profile Entry Sequence NumberRANGE: [0, 65535]
    statusmo:ModificationStatus
    (scalar:Bitmask32)
    Modification statusSELECTION:
    2 - created
    4 - modified
    8 - deleted
    16 - replaced


    Related Documentation

    For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

    http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

    See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

    https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

    For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

    https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html