-
Notifications
You must be signed in to change notification settings - Fork 1.1k
The PSU CLI and SNMP support
Rev | Date | Author | Change Description |
---|---|---|---|
0.1 | Andrii Savka | Initial version | |
0.2 | Andrii Savka | Added presence status to API and CLI |
This document provides general information about the PSU CLI and SNMP support feature.
This document describes the high level design of the PSU CLI and SNMP support feature.
Definitions/Abbreviation | Description |
---|---|
SNMP | Simple Network Management Protocol |
PSU | Power supply unit |
API | Application Programmable Interface |
CLI | Command-line utility |
Following diagram describes a top level overview of the SONiC PSU architecture:
The agent handles the SNMP requests and takes the PSU status from PSU API.
The command-line utilities for SONiC
The daemon is to collect the PSU information and write to state DB.
Microsoft will develop a simple plugin-style API in the vein of sfputil.py and led_control.py. Each vendor needs to implement the PSU module for API which should consist the implementation of each function. The API has the following functions:
API | Return value | Description |
---|---|---|
get_num_psus() | integer | the number of PSUs which are supported in the platform |
get_psu_status(psu_index) | True if PSU has correct functioning, False if not. | Function takes a zero-based PSU index and provides the status. Any platform-specific appropriate voltage/amperage/temperature calculations should be carried out to determine whether the PSU is operating properly or not. |
get_psu_presence(psu_index) | True if PSU is plugged, False if not. | Function takes a zero-based PSU index and provides the presence info |
Mellanox will implement a simple Python command-line utility which implements the plugin and can output the status of each PSU/all PSUs. The CLI will get the data from state DB to show the PSU status and presence info. The CLI should have the following behavior:
Input parameters | CLI expected result |
---|---|
No Input parameters | Provide the status of all PSUs which are available in the platform |
PSU ID | Provide the status for specific PSU |
The CLI has a following output:
Module | Status |
---|---|
PSU 1 | OK (status == True, presence == True) |
PSU 2 | NOT OK (status == False, presence == True) |
PSU X | NOT PRESENT (presence == False) |
Mellanox will add the PSU support to SNMP agent for retrieving PSU statuses. Querying below OID should return the status of PSU/PSUs in the platform. The response has following integer values:
- “1” for proper operational status
- “0” for faulty
The following OID should be supported:
OID | Description of the SNMP instance |
---|---|
1.3.6.1.4.1.9.9.117.1.1.2 | cefcFRUPowerStatusTable |
1.3.6.1.4.1.9.9.117.1.1.2.1 | cefcFRUPowerStatusEntry |
1.3.6.1.4.1.9.9.117.1.1.2.1.2 | return the statuses of all PSUs which are available in the platform |
1.3.6.1.4.1.9.9.117.1.1.2.1.2.psu_index | return the status of PSU specified by psu_index |
The support for the new PSU OID should be added.
The following components should be implemented:
- The PSU plugin-style API for SONiC that takes a zero-based PSU ID and returns a boolean value indicating the status of the PSU.
- The Python command-line utility that provides the PSU(s) status. Also PSU status should be available in general "show platform psustatus" command.
- Each vendor needs to provide the PSU module which should consists the implementation of PSU API. The module should be placed under "sonic-buildimage/device/[vendor]/[platform]/plugins/psuutil.py" directory and will be loaded by CLI.
- Supervisord takes charge of this daemon. This daemon will loop every 3 seconds and get the data from PSU API and then write it the state DB.
- The num_psus will store in "chassis_info" table. It will just be invoked one time when system boot up or reload. The key is chassis_name, the field is "num_psus" and the value is gotten from PSU API get_num_psus().
- The psu_status and psu_presence will store in "psu_info" table. It will be updated every 3 seconds. The key is psu_name, the field is "presence" and "status", the value is from PSU API get_psu_presence() and get_psu_num().
-
For Users
-
For Developers
-
Subgroups/Working Groups
-
Presentations
-
Join Us