ibm-openbmc / dev

Product Development Project Mgmt and Tracking
16 stars 2 forks source link

Environment metrics should chassis association like sensors does #3619

Closed gtmills closed 1 year ago

gtmills commented 1 year ago

We have this chasiss (an i/o drawer) that doesn't have sensors. No sensors show up in the sensor collection which is correct but sensors still show up in the Environment metrics. Need the same association check for EnvironmentMetrics. 2 PRs needed here, against 1050 bmcweb and against 1030 bmcweb (we will then take the 1030 PR and cherry pick into 1020 and 1040)

~ ❯ curl -k -H "X-Auth-Token: $bmc_tokens" -X GET https://xxx/redfish/v1/Chassis/chassis15873/EnvironmentMetrics                                                                01:40:15 PM
{
  "@odata.id": "/redfish/v1/Chassis/chassis15873/EnvironmentMetrics",
  "@odata.type": "#EnvironmentMetrics.v1_1_0.EnvironmentMetrics",
  "FanSpeedsPercent": [
    {
      "@odata.id": "/redfish/v1/Chassis/chassis15873/Sensors/fan0_0",
      "DataSourceUri": "/redfish/v1/Chassis/chassis15873/Sensors/fan0_0",
      "DeviceName": "Chassis Fan #fan0_0",
      "SpeedRPM": 4139.0
    },
    {
      "@odata.id": "/redfish/v1/Chassis/chassis15873/Sensors/fan0_1",
      "DataSourceUri": "/redfish/v1/Chassis/chassis15873/Sensors/fan0_1",
      "DeviceName": "Chassis Fan #fan0_1",
      "SpeedRPM": 4237.0
    },
    {
      "@odata.id": "/redfish/v1/Chassis/chassis15873/Sensors/fan1_0",
      "DataSourceUri": "/redfish/v1/Chassis/chassis15873/Sensors/fan1_0",
      "DeviceName": "Chassis Fan #fan1_0",
      "SpeedRPM": 4185.0
    },
    {
      "@odata.id": "/redfish/v1/Chassis/chassis15873/Sensors/fan1_1",
      "DataSourceUri": "/redfish/v1/Chassis/chassis15873/Sensors/fan1_1",
      "DeviceName": "Chassis Fan #fan1_1",
      "SpeedRPM": 4315.0
    },
    {
      "@odata.id": "/redfish/v1/Chassis/chassis15873/Sensors/fan2_0",
      "DataSourceUri": "/redfish/v1/Chassis/chassis15873/Sensors/fan2_0",
      "DeviceName": "Chassis Fan #fan2_0",
      "SpeedRPM": 4107.0
    },
    {
      "@odata.id": "/redfish/v1/Chassis/chassis15873/Sensors/fan2_1",
      "DataSourceUri": "/redfish/v1/Chassis/chassis15873/Sensors/fan2_1",
      "DeviceName": "Chassis Fan #fan2_1",
      "SpeedRPM": 4237.0
    },
    {
      "@odata.id": "/redfish/v1/Chassis/chassis15873/Sensors/fan3_0",
      "DataSourceUri": "/redfish/v1/Chassis/chassis15873/Sensors/fan3_0",
      "DeviceName": "Chassis Fan #fan3_0",
      "SpeedRPM": 4340.0
    },
    {
      "@odata.id": "/redfish/v1/Chassis/chassis15873/Sensors/fan3_1",
      "DataSourceUri": "/redfish/v1/Chassis/chassis15873/Sensors/fan3_1",
      "DeviceName": "Chassis Fan #fan3_1",
      "SpeedRPM": 4437.0
    }
  ],
  "Id": "EnvironmentMetrics",
  "Name": "Chassis Environment Metrics",
  "PowerLimitWatts": {
    "AllowableMax": 6111,
    "AllowableMin": 3889,
    "ControlMode": "Disabled",
    "SetPoint": 0
  },
  "PowerWatts": {
    "@odata.id": "/redfish/v1/Chassis/chassis15873/Sensors/total_power",
    "DataSourceUri": "/redfish/v1/Chassis/chassis15873/Sensors/total_power",
    "Reading": 758.0
  }
}%

~ ❯ curl -k -H "X-Auth-Token: $bmc_tokens" -X GET https://xxx/redfish/v1/Chassis/chassis15873/Sensors                                                                           01:40:47 PM
{
  "@odata.id": "/redfish/v1/Chassis/chassis15873/Sensors",
  "@odata.type": "#SensorCollection.SensorCollection",
  "Description": "Collection of Sensors for this Chassis",
  "Members": [],
  "Members@odata.count": 0,
  "Name": "Sensors"
}%

@manojkiraneda @derekhoward55 FYI

lxwinspur commented 1 year ago

review by: https://github.com/ibm-openbmc/bmcweb/pull/610

gtmills commented 1 year ago

@lxwinspur Can you also do this for 1050? 1050 is different enough, need a separate PR

gtmills commented 1 year ago

Still need to do this for 1050 :) Or maybe it is already done? @lxwinspur

lxwinspur commented 1 year ago

@lxwinspur Can you also do this for 1050? 1050 is different enough, need a separate PR

Have you tested this issue on 1050? Might be correct on 1050, otherwise please show the log.