Cluster Management
This section describes the configuration model of cluster management and provides examples of XML packets.
- Data Model
- Changing a CSS ID
- Configuring a CSS Priority
- Enabling the CSS Function
- Querying the CSS Enablement Status
- Querying the Role of a Member Switch in a Cluster
- Querying CSS Port Information
- Querying the Switch CSS Status and System MAC Address
- Notifying the Chassis Registration Result
- Configuring MAD
- Restarting a Cluster Member
Data Model
The configuration model files matching cluster management are huawei-stack.yang and huawei-device.yang.
Object |
Description |
Value |
Remarks |
---|---|---|---|
/huawei-stack:stack-enable/enable |
Enables the CSS function. |
The value is of the Boolean type:
The default value is false. |
N/A |
/huawei-stack:new-cssid/old-cssid |
Indicates the old CSS ID. |
The value is 1 or 2. |
N/A |
/huawei-stack:new-cssid/stackid |
Indicates the new CSS ID. |
The value is 1 or 2. |
N/A |
/huawei-stack/stack-state/enable |
Indicates whether CSS is enabled. |
The value is of the Boolean type:
|
Only the Get operation is supported. |
huawei-stack:stack-state/stack-ports/port-name |
Indicates the CSS port name. |
The value is a string of 1 to 128 characters. |
Only the Get operation is supported. |
/huawei-frame:frames/frame/huawei-stack:priority |
Indicates the CSS priority of a member switch. |
The value is an integer that ranges from 1 to 255. |
If a CSS ID also needs to be specified for the member switch, the CSS ID is 1 or 2. |
/huawei-frame:frames-state/frame/huawei-stack:role |
Indicates the role of a member switch in a CSS. |
The value is of the enumerated type:
|
Only the Get operation is supported. |
/huawei-frame:frames-state/frame/huawei-stack:stacking-ports/ports/port-number |
Indicates the CSS port number. |
The value is 1 or 2. |
Only the Get operation is supported. |
/huawei-frame:frames-state/frame/huawei-stack:stacking-ports/ports/port |
Indicates the CSS member port. |
The value depends on the device configuration. |
Only the Get operation is supported. |
/huawei-frame:frames-state/frame/huawei-stack:stacking-ports/ports/port/peer-port |
Indicates the remote CSS member port. |
The value is 1 or 2. |
Only the Get operation is supported. |
/huawei-frame:frames-state/frame/huawei-stack:stacking-ports/peer-stacking-port |
Indicates the remote CSS port number. |
The value depends on the device configuration. |
Only the Get operation is supported. |
/huawei-frame:frames-state/frame/huawei-stack:stacking-ports/peer-frame-name |
Indicates the chassis ID of a remote port. |
The value is 1 or 2. |
Only the Get operation is supported. |
/huawei-frame:frames-state/frame/huawei-stack:priority |
Indicates the priority of a CSS member. |
N/A |
N/A |
/huawei-stack:set-css-configuration/input/css-list/css-id |
Indicates the configured chassis ID. |
The value is 1 or 2. |
N/A |
/huawei-stack:set-css-configuration/input/css-list/next-css-id |
Indicates the chassis ID for next startup. |
The value is 1 or 2. |
N/A |
/huawei-stack:set-css-configuration/input/css-list/next-priority |
Indicates the priority for next startup. |
The value is an integer in the range from 1 to 255. |
N/A |
/ietf-interfaces:interfaces/interface/huawei-stack:mad-config/detect-mode |
Configures the MAD mode on an interface. |
The value is of the enumerated type:
|
MAD in relay mode is supported only on Eth-Trunk interfaces. MAD in direct mode is supported only on physical interfaces but not on Eth-Trunk interfaces. |
/ietf-interfaces:interfaces/interface/huawei-stack:mad-config/relay-proxy-enable |
Configures the relay function on a specified interface of the relay agent. |
The value is of the Boolean type:
|
N/A |
/hw-stack:mad-config/hw-stack:domain-id |
Indicates the stack MAD domain ID. |
The value is an integer in the range from 0 to 255. |
N/A |
Object |
Description |
Value |
Remarks |
---|---|---|---|
device-state/user-define-info/stack-status |
Indicates whether the switch is a CSS. |
The value is of the enumerated type:
|
N/A |
device-state/user-define-info/system-mac-address |
Indicates the CSS MAC address. |
The value is a character string in the format xx:xx:xx:xx:xx:xx. |
N/A |
board-register-status-notify/register-status-list/slot-index |
Indicates the registered switch chassis ID. |
The value is a character string that can be 1 or 2. |
N/A |
board-register-status-notify/register-status-list/register-success |
Indicates the registration result of a CSS chassis. |
The value is of the Boolean type:
|
N/A |
board-register-status-notify/register-status-list/register-fail-reason |
Indicates the error code displayed when a CSS chassis fails to be registered. |
When the switch is registered successfully, this object does not exist.
|
N/A |
reset-chassis/chassis-id |
Restarts the switch with the specified chassis ID. |
The value is 1 or 2. |
N/A |
register-status-notify/register-success |
Indicates the CSS chassis registration result. |
The value is of the Boolean type:
|
N/A |
register-status-notify/register-fail-reason |
Indicates the error code used when a CSS chassis fails to be registered. |
When the switch is registered successfully, this object does not exist.
|
N/A |
Changing a CSS ID
This section provides a sample of changing a CSS ID using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/huawei-stack:new-cssid/ |
Data Requirements
Item |
Data |
Description |
---|---|---|
Old CSS ID |
1 |
- |
New CSS ID |
2 |
- |
Request Example
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="7"> <hw-stack:new-cssid xmlns:hw-stack="urn:huawei:params:xml:ns:yang:huawei-stack"> <hw-stack:old-cssid>1</hw-stack:old-cssid> <hw-stack:stackid>2</hw-stack:stackid> </hw-stack:new-cssid> </rpc>
Response Example
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="8"> <ok/> </rpc-reply>
Sample of failed response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="9"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-message>parse rpc config error.</error-message> </rpc-error> </rpc-reply>
Configuring a CSS Priority
This section provides a sample of configuring a CSS priority using the config method.
Operation |
XPATH |
---|---|
edit-config:config |
/huawei-frame:frames/frame/huawei-stack:priority |
Data Requirement 1
Item |
Data |
Description |
---|---|---|
CSS priority |
10 |
- |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <frame:frames xmlns:frame="urn:huawei:params:xml:ns:yang:huawei-frame"> <frame:frame> <frame:name>1</frame:name> <hw-stack:priority xmlns:hw-stack="urn:huawei:params:xml:ns:yang:huawei-stack">10</hw-stack:priority> </frame:frame> </frame:frames> </config> </edit-config> </rpc>
Response Example
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="8"> <ok/> </rpc-reply>
Sample of failed response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="484f0b40-6ac9-11e7-8423-bcadefa94e5f"> <rpc-error> <error-message>valid user-defined rpc fail.</error-message> </rpc-error> </rpc-reply>
Data Requirement 2
Item |
Data |
Description |
---|---|---|
CSS priority |
50 |
- |
Replacement Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <frame:frames xmlns:frame="urn:huawei:params:xml:ns:yang:huawei-frame"> <frame:frame> <frame:name>1</frame:name> <hw-stack:priority xmlns:hw-stack="urn:huawei:params:xml:ns:yang:huawei-stack" xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="replace">50</hw-stack:priority> </frame:frame> </frame:frames> </config> </edit-config> </rpc>
Response Example
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="8"> <ok/> </rpc-reply>
Sample of failed response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="484f0b40-6ac9-11e7-8423-bcadefa94e5f"> <rpc-error> <error-message>valid user-defined rpc fail.</error-message> </rpc-error> </rpc-reply>
Data Requirement 3
Item |
Data |
Description |
---|---|---|
CSS priority |
50 |
Restore the default CSS priority 1. |
Deletion Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <frame:frames xmlns:frame="urn:huawei:params:xml:ns:yang:huawei-frame"> <frame:frame> <frame:name>1</frame:name> <hw-stack:priority xmlns:hw-stack="urn:huawei:params:xml:ns:yang:huawei-stack" xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete">50</hw-stack:priority> </frame:frame> </frame:frames> </config> </edit-config> </rpc>
Response Example
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="8"> <ok/> </rpc-reply>
Sample of failed response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="484f0b40-6ac9-11e7-8423-bcadefa94e5f"> <rpc-error> <error-message>valid user-defined rpc fail.</error-message> </rpc-error> </rpc-reply>
Enabling the CSS Function
This section provides a sample of enabling the CSS function using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/huawei-stack:stack-enable/enable |
Data Requirements
Item |
Data |
Description |
---|---|---|
Enabling the CSS function |
true |
- |
Request Example
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"> <hw-stack:stack-enable xmlns:hw-stack="urn:huawei:params:xml:ns:yang:huawei-stack"> <hw-stack:enable>true</hw-stack:enable> </hw-stack:stack-enable> </rpc>
Response Example
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="8"> <ok/> </rpc-reply>
Sample of failed response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="9"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-message>parse rpc config error.</error-message> </rpc-error> </rpc-reply>
Querying the CSS Enablement Status
This section provides a sample of querying the CSS enablement status using the get method.
Operation |
XPATH |
---|---|
get |
/huawei-stack/stack-state/enable |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <get> <filter type="subtree"> <hw-stack:stack-state xmlns:hw-stack="urn:huawei:params:xml:ns:yang:huawei-stack"> <hw-stack:enable/> </hw-stack:stack-state> </filter> </get> </rpc>
Response Example
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4"> <data> <stack-state xmlns="urn:huawei:params:xml:ns:yang:huawei-stack"> <enable>true</enable> </stack-state> </data> </rpc-reply>
Querying the Role of a Member Switch in a Cluster
This section provides a sample of querying the role of a member switch in a cluster using the get method.
Operation |
XPATH |
---|---|
get |
/huawei-frame:frames-state/frame/huawei-stack:role |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <get> <filter type="subtree"> <frame:frames-state xmlns:frame="urn:huawei:params:xml:ns:yang:huawei-frame"> <frame:frame> <frame:name/> <hw-stack:role xmlns:hw-stack="urn:huawei:params:xml:ns:yang:huawei-stack"/> </frame:frame> </frame:frames-state> </filter> </get> </rpc>
Response Example
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="6"> <data> <frames-state xmlns="urn:huawei:params:xml:ns:yang:huawei-frame"> <frame> <name>1</name> <role xmlns="urn:huawei:params:xml:ns:yang:huawei-stack">standby</role> </frame> <frame> <name>2</name> <role xmlns="urn:huawei:params:xml:ns:yang:huawei-stack">master</role> </frame> </frames-state> </data> </rpc-reply>
Querying CSS Port Information
This section provides a sample of querying CSS port information using the get method.
Operation |
XPATH |
---|---|
get |
/huawei-frame:frames-state/frame/huawei-stack:stacking-ports |
get |
/huawei-stack:stack-state/stack-ports |
Request Example 1
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <get> <filter type="subtree"> <frame:frames-state xmlns:frame="urn:huawei:params:xml:ns:yang:huawei-frame"> <frame:frame> <frame:name/> <hw-stack:stacking-ports xmlns:hw-stack="urn:huawei:params:xml:ns:yang:huawei-stack"/> </frame:frame> </frame:frames-state> </filter> </get> </rpc>
Request Example 2
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <get> <filter type="subtree"> <hw-stack:stack-state xmlns:hw-stack="urn:huawei:params:xml:ns:yang:huawei-stack"> <hw-stack:stack-ports/> </hw-stack:stack-state> </filter> </get> </rpc>
Response Example 1
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="0"> <data> <frames-state xmlns="urn:huawei:params:xml:ns:yang:huawei-frame"> <frame> <name>1</name> <stacking-ports xmlns="urn:huawei:params:xml:ns:yang:huawei-stack"> <port-number>1</port-number> <ports> <port>1/11/0/1</port> <peer-port>2/11/0/1</peer-port> </ports> <ports> <port>1/11/0/2</port> <peer-port>2/11/0/2</peer-port> </ports> <ports> <port>1/12/0/1</port> <peer-port>2/13/0/1</peer-port> </ports> <ports> <port>1/12/0/2</port> <peer-port>2/13/0/2</peer-port> </ports> <peer-stacking-port>1</peer-stacking-port> <peer-frame-name>2</peer-frame-name> </stacking-ports> <stacking-ports xmlns="urn:huawei:params:xml:ns:yang:huawei-stack"> <port-number>2</port-number> <ports> <port>1/11/0/7</port> <peer-port>2/11/0/7</peer-port> </ports> <ports> <port>1/11/0/8</port> <peer-port>2/11/0/8</peer-port> </ports> <ports> <port>1/12/0/7</port> <peer-port>2/13/0/8</peer-port> </ports> <ports> <port>1/12/0/8</port> <peer-port>2/13/0/7</peer-port> </ports> <peer-stacking-port>2</peer-stacking-port> <peer-frame-name>2</peer-frame-name> </stacking-ports> </frame> <frame> <name>2</name> <stacking-ports xmlns="urn:huawei:params:xml:ns:yang:huawei-stack"> <port-number>1</port-number> <ports> <port>2/11/0/1</port> <peer-port>1/11/0/1</peer-port> </ports> <ports> <port>2/11/0/2</port> <peer-port>1/11/0/2</peer-port> </ports> <ports> <port>2/13/0/1</port> <peer-port>1/12/0/1</peer-port> </ports> <ports> <port>2/13/0/2</port> <peer-port>1/12/0/2</peer-port> </ports> <peer-stacking-port>1</peer-stacking-port> <peer-frame-name>1</peer-frame-name> </stacking-ports> <stacking-ports xmlns="urn:huawei:params:xml:ns:yang:huawei-stack"> <port-number>2</port-number> <ports> <port>2/11/0/7</port> <peer-port>1/11/0/7</peer-port> </ports> <ports> <port>2/11/0/8</port> <peer-port>1/11/0/8</peer-port> </ports> <ports> <port>2/13/0/7</port> <peer-port>1/12/0/8</peer-port> </ports> <ports> <port>2/13/0/8</port> <peer-port>1/12/0/7</peer-port> </ports> <peer-stacking-port>2</peer-stacking-port> <peer-frame-name>1</peer-frame-name> </stacking-ports> </frame> </frames-state> </data> </rpc-reply>
Response Example 2
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4"> <data> <stack-state xmlns="urn:huawei:params:xml:ns:yang:huawei-stack"> <stack-ports> <port-name>100GE1/3/0/2</port-name> </stack-ports> <stack-ports> <port-name>100GE1/2/0/32</port-name> </stack-ports> <stack-ports> <port-name>100GE1/2/0/35</port-name> </stack-ports> <stack-ports> <port-name>100GE2/4/0/32</port-name> </stack-ports> <stack-ports> <port-name>100GE2/2/0/16</port-name> </stack-ports> </stack-state> </data> </rpc-reply>
Querying the Switch CSS Status and System MAC Address
This section provides a sample of querying the switch CSS status and system MAC address using the get method.
Operation |
XPATH |
---|---|
get |
/device-state/user-define-info/stack-status /device-state/user-define-info/system-mac-address |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="10" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <get> <filter type="subtree"> <dev:device-state xmlns:dev="urn:huawei:params:xml:ns:yang:huawei-device"> <dev:user-define-info/> </dev:device-state> </filter> </get> </rpc>
Response Example
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="10"> <data> <device-state xmlns="urn:huawei:params:xml:ns:yang:huawei-device"> <user-define-info> <stack-status>stack</stack-status> <system-mac-address>02:00:70:be:9b:50</system-mac-address> </user-define-info> </device-state> </data> </rpc-reply>
Notifying the Chassis Registration Result
This section provides a sample of notifying the chassis registration result using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/board-register-status-notify/register-status-list/slot-index /board-register-status-notify/register-status-list/register-success /board-register-status-notify/register-status-list/register-fail-reason |
Notification Example
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="10"> <dev:board-register-status-notify xmlns:dev="urn:huawei:params:xml:ns:yang:huawei-device"> <dev:register-status-list> <dev:slot-index>1</dev:slot-index> <dev:register-success>false</dev:register-success> <dev:register-fail-reason>3</dev:register-fail-reason> </dev:register-status-list> </dev:board-register-status-notify> </rpc>
Response Example
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="10"> <ok/> </rpc-reply>
Configuring MAD
This section provides a sample of configuring MAD using the config method.
Operation |
XPATH |
---|---|
edit-config:config |
/ietf-interfaces:interfaces/interface/huawei-stack:mad-config/detect-mode /ietf-interfaces:interfaces/interface/huawei-stack:mad-config/relay-proxy-enable |
Data Requirements
Item |
Data |
Description |
---|---|---|
Interface name |
Eth-Trunk3 |
- |
MAD mode |
MAD in relay mode |
- |
Relay function |
True |
- |
Request Example
<?xml version="1.0" encoding="utf-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <edit-config> <target> <running/> </target> <config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces" nc:operation="replace"> <interface> <name>Eth-Trunk3</name> <type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</type> <hw-stack:mad-config xmlns:hw-stack="urn:huawei:params:xml:ns:yang:huawei-stack"> <hw-stack:detect-mode>relay</hw-stack:detect-mode> <hw-stack:relay-proxy-enable>true</hw-stack:relay-proxy-enable> </hw-stack:mad-config> </interface> </interfaces> </config> </edit-config> </rpc>
Response Example
Sample of successful response
<?xml version="1.0" encoding="utf-8"?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <ok/> </rpc-reply>
Sample of failed response
<?xml version="1.0" encoding="utf-8"?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <rpc-error> <error-app-tag>-1</error-app-tag> <error-message>Some ports have been enabled MAD detect mode direct, please cancel the configuration first.</error-message> <error-info>Error on node /ietf-interfaces:interfaces/interface[name="Eth-Trunk3"]/huawei-stack:mad-config/detect-mode</error-info> </rpc-error> </rpc-reply>
Restarting a Cluster Member
This section provides a sample of restarting a cluster member using the rpc method.
Operation |
XPATH |
---|---|
rpc |
reset-chassis/chassis-id |
Data Requirements
Item |
Data |
Description |
---|---|---|
Chassis ID of a cluster member |
2 |
- |
Request Example
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="30"> <dev:reset-chassis xmlns:dev="urn:huawei:params:xml:ns:yang:huawei-device"> <dev:chassis-id>2</dev:chassis-id> </dev:reset-chassis> </rpc>
Response Example
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="30"> <reset-chassis> <result>Succeed</result> </reset-chassis> </rpc-reply>
- Data Model
- Changing a CSS ID
- Configuring a CSS Priority
- Enabling the CSS Function
- Querying the CSS Enablement Status
- Querying the Role of a Member Switch in a Cluster
- Querying CSS Port Information
- Querying the Switch CSS Status and System MAC Address
- Notifying the Chassis Registration Result
- Configuring MAD
- Restarting a Cluster Member