Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Darwin Rackmon ORV3 support #288

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

geoffhanson
Copy link

@geoffhanson geoffhanson commented Nov 5, 2024

Provide additional config and enhancements to Rackmon logic to support ORV3 for Darwin. Darwin is the only platform so far to support Rackmon from FBOSS.

Test Plan:

  1. On a Darwin system connected to PSUs and BBUs, used the thriftctl utility to verify rackmon was monitoring the devices:
[root@rkdo301 ~]# thriftctl listPorts
5909: neteng.fboss.ctrl.FbossCtrl
5910: neteng.fboss.qsfp.QsfpService
5931: neteng.fboss.hw_ctrl.FbossHwCtrl
5932: neteng.fboss.hw_ctrl.FbossHwCtrl
5970: neteng.fboss.platform.sensor_service.SensorServiceThrift 5972: fan_service.FanService
5973: rackmonsvc.rackmonsvc.RackmonCtrl
[root@rkdo301 ~]# thriftctl listMethods -p 5973
Found 10 available methods under port:5973
        controlRackmond
        getMonitorData
        getMonitorDataEx
        getPowerLossSiren
        listModbusDevices
        presetMultipleRegisters
        readFileRecord
        readHoldingRegisters
        reload
        writeSingleRegister
[root@rkdo301 ~]# thriftctl request listModbusDevices -p 5973 [ModbusDeviceInfo(
    devAddress=64,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=65,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=66,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=67,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=68,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=69,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=96,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=97,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=98,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=99,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=100,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=101,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=200,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=201,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=202,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=203,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=204,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=205,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=232,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=233,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=234,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=235,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=236,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=237,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1)]
[root@rkdo301 ~]# thriftctl request getMonitorData -p 5973 > /tmp/monitordata.txt
  1. Ran the rackmon_test on a Darwin system:
[root@rkd205 ~]# /tmp/rackmon_test --gtest_filter=RackmonConfig.RegisterMap
Running main() from gmock_main.cc
Note: Google Test filter = RackmonConfig.RegisterMap
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from RackmonConfig
[ RUN      ] RackmonConfig.RegisterMap
[       OK ] RackmonConfig.RegisterMap (1 ms)
[----------] 1 test from RackmonConfig (1 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (1 ms total)
[  PASSED  ] 1 test.

Monitored data is attached to this PR.
rackmondata.txt

@facebook-github-bot
Copy link
Contributor

@joancaneus has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@joancaneus
Copy link
Contributor

@geoffhanson are you able to run the rackmon HW tests that are part of OSS? I see some of them are failing on-diff internally.

Provide additional config and enhancements to Rackmon logic to
support ORV3 for Darwin. Darwin is the only platform so far to
support Rackmon from FBOSS.

Motivation:
Support ORV3 with Darwin.

Test Plan:

1. On a Darwin system connected to PSUs and BBUs, used the thriftctl utility to
verify rackmon was monitoring the devices:

```
[root@rkdo301 ~]# thriftctl listPorts
5909: neteng.fboss.ctrl.FbossCtrl
5910: neteng.fboss.qsfp.QsfpService
5931: neteng.fboss.hw_ctrl.FbossHwCtrl
5932: neteng.fboss.hw_ctrl.FbossHwCtrl
5970: neteng.fboss.platform.sensor_service.SensorServiceThrift
5972: fan_service.FanService
5973: rackmonsvc.rackmonsvc.RackmonCtrl
[root@rkdo301 ~]# thriftctl listMethods -p 5973
Found 10 available methods under port:5973
        controlRackmond
        getMonitorData
        getMonitorDataEx
        getPowerLossSiren
        listModbusDevices
        presetMultipleRegisters
        readFileRecord
        readHoldingRegisters
        reload
        writeSingleRegister
[root@rkdo301 ~]# thriftctl request listModbusDevices -p 5973
[ModbusDeviceInfo(
    devAddress=64,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=65,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=66,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=67,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=68,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=69,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=96,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=97,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=98,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=99,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=100,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=101,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=3), ModbusDeviceInfo(
    devAddress=200,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=201,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=202,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=203,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=204,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=205,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=232,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=233,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=234,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=235,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=236,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1), ModbusDeviceInfo(
    devAddress=237,
    mode=0,
    baudrate=19200,
    timeouts=0,
    crcErrors=0,
    miscErrors=0,
    deviceType=1)]
[root@rkdo301 ~]# thriftctl request getMonitorData -p 5973 > /tmp/monitordata.txt
```

2. Ran the rackmon_test on a Darwin system:

```
[root@rkd205 ~]# /tmp/rackmon_test --gtest_filter=RackmonConfig.RegisterMap
Running main() from gmock_main.cc
Note: Google Test filter = RackmonConfig.RegisterMap
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from RackmonConfig
[ RUN      ] RackmonConfig.RegisterMap
[       OK ] RackmonConfig.RegisterMap (1 ms)
[----------] 1 test from RackmonConfig (1 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (1 ms total)
[  PASSED  ] 1 test.
```
@facebook-github-bot
Copy link
Contributor

@geoffhanson has updated the pull request. You must reimport the pull request before landing.

@geoffhanson
Copy link
Author

@geoffhanson are you able to run the rackmon HW tests that are part of OSS? I see some of them are failing on-diff internally.

Updated the PR with a fix to that test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants