* sensor->inventory associations in phosphor-hwmon
@ 2019-02-20 16:10 Matt Spinler
2019-02-20 18:32 ` Patrick Venture
0 siblings, 1 reply; 5+ messages in thread
From: Matt Spinler @ 2019-02-20 16:10 UTC (permalink / raw)
To: openbmc
Hi,
We have a need to know which sensor objects hosted by the various
phosphor-hwmon
daemons belong to which inventory objects. For example, we need to know
that
the /xyz/openbmc_project/sensors/power/ps1_input_power sensor belongs to
the
/xyz/openbmc_project/inventory/system/powersupply1 item.
To accomplish this, I am proposing we add a new environment variable to
the
system specific phosphor-hwmon config files that the phosphor-hwmon code
can then use to create associations interfaces that will cause the
mapper to
create the appropriate association D-Bus paths.
As an example, we could add to the power-supply1 conf file an
ASSOCIATIONS
variable for each sensor (assuming ps1_input_power is represented by
IN1):
ASSOCIATIONS_IN1=/xyz/openbmc_project/inventory/system/powersupply1
The code would then see that and create a new org.openbmc.Associations
interface
on the /xyz/openbmc_project/sensors/power/ps1_input_power path with an
associations property of:
["inventory",
"sensors",
"/xyz/openbmc_project/inventory/system/powersupply1"]
This leads to the mapper creating:
/xyz/openbmc_project/sensors/power/ps1_input_power/inventory
With an xyz.openbmc_project.Association interface with an
endpoints property of:
["/xyz/openbmc_project/inventory/system/powersupply1"]
And also the other association path:
/xyz/openbmc_project/inventory/system/powersupply1/sensors
With an xyz.openbmc_project.Association interface with an
endpoints property of:
["/xyz/openbmc_project/sensors/power/ps1_input_power"]
This now allows one to both find all sensors associated with a power
supply, and
find which inventory item is associated with a particular sensor. Note
that
the endpoints property is an array, and can get entries from multiple
places.
I suppose we could also put the forward/reverse association names, in
this case
"inventory" and "sensors", into the hwmon config file, and also allow
creating
multiple associations for each sensor if there is a usecase, though I
would like
to keep it as simple as possible:
ASSOCIATIONS1_IN1=inventory,sensors,/xyz/openbmc_project/inventory/system/powersupply1
ASSOCIATIONS2_IN1=chassis,contained_sensors,/xyz/openbmc_project/inventory/system/chassis
What does everyone think?
Thanks
Matt
^ permalink raw reply [flat|nested] 5+ messages in thread
* sensor->inventory associations in phosphor-hwmon
@ 2019-02-20 16:56 Matt Spinler
0 siblings, 0 replies; 5+ messages in thread
From: Matt Spinler @ 2019-02-20 16:56 UTC (permalink / raw)
To: OpenBMC Maillist
[-- Attachment #1: Type: text/plain, Size: 2297 bytes --]
Hi,
We have a need to know which sensor objects hosted by the various phosphor-hwmon
daemons belong to which inventory objects. For example, we need to know that
the /xyz/openbmc_project/sensors/power/ps1_input_power sensor belongs to the
/xyz/openbmc_project/inventory/system/powersupply1 item.
To accomplish this, I am proposing we add a new environment variable to the
system specific phosphor-hwmon config files that the phosphor-hwmon code
can then use to create associations interfaces that will cause the mapper to
create the appropriate association D-Bus paths.
As an example, we could add to the power-supply1 conf file an ASSOCIATIONS
variable for each sensor (assuming ps1_input_power is represented by IN1):
ASSOCIATIONS_IN1=/xyz/openbmc_project/inventory/system/powersupply1
The code would then see that and create a new org.openbmc.Associations interface
on the /xyz/openbmc_project/sensors/power/ps1_input_power path with an
associations property of:
["inventory",
"sensors",
"/xyz/openbmc_project/inventory/system/powersupply1"]
This leads to the mapper creating:
/xyz/openbmc_project/sensors/power/ps1_input_power/inventory
With an xyz.openbmc_project.Association interface with an
endpoints property of:
["/xyz/openbmc_project/inventory/system/powersupply1"]
And also the other association path:
/xyz/openbmc_project/inventory/system/powersupply1/sensors
With an xyz.openbmc_project.Association interface with an
endpoints property of:
["/xyz/openbmc_project/sensors/power/ps1_input_power"]
This now allows one to both find all sensors associated with a power supply, and
find which inventory item is associated with a particular sensor. Note that
the endpoints property is an array, and can get entries from multiple places.
I suppose we could also put the forward/reverse association names, in this case
"inventory" and "sensors", into the hwmon config file, and also allow creating
multiple associations for each sensor if there is a usecase, though I would like
to keep it as simple as possible:
ASSOCIATIONS1_IN1=inventory,sensors,/xyz/openbmc_project/inventory/system/powersupply1
ASSOCIATIONS2_IN1=chassis,contained_sensors,/xyz/openbmc_project/inventory/system/chassis
What does everyone think?
Thanks
Matt
[-- Attachment #2: Type: text/html, Size: 2462 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sensor->inventory associations in phosphor-hwmon
2019-02-20 16:10 sensor->inventory associations in phosphor-hwmon Matt Spinler
@ 2019-02-20 18:32 ` Patrick Venture
2019-02-20 18:47 ` James Feist
0 siblings, 1 reply; 5+ messages in thread
From: Patrick Venture @ 2019-02-20 18:32 UTC (permalink / raw)
To: Matt Spinler; +Cc: OpenBMC Maillist
On Wed, Feb 20, 2019 at 10:31 AM Matt Spinler <mspinler@linux.ibm.com> wrote:
>
> Hi,
>
> We have a need to know which sensor objects hosted by the various
> phosphor-hwmon
> daemons belong to which inventory objects. For example, we need to know
> that
> the /xyz/openbmc_project/sensors/power/ps1_input_power sensor belongs to
> the
> /xyz/openbmc_project/inventory/system/powersupply1 item.
>
> To accomplish this, I am proposing we add a new environment variable to
> the
> system specific phosphor-hwmon config files that the phosphor-hwmon code
> can then use to create associations interfaces that will cause the
> mapper to
> create the appropriate association D-Bus paths.
>
> As an example, we could add to the power-supply1 conf file an
> ASSOCIATIONS
> variable for each sensor (assuming ps1_input_power is represented by
> IN1):
>
> ASSOCIATIONS_IN1=/xyz/openbmc_project/inventory/system/powersupply1
>
> The code would then see that and create a new org.openbmc.Associations
> interface
> on the /xyz/openbmc_project/sensors/power/ps1_input_power path with an
> associations property of:
>
> ["inventory",
> "sensors",
> "/xyz/openbmc_project/inventory/system/powersupply1"]
>
> This leads to the mapper creating:
>
> /xyz/openbmc_project/sensors/power/ps1_input_power/inventory
>
> With an xyz.openbmc_project.Association interface with an
> endpoints property of:
>
> ["/xyz/openbmc_project/inventory/system/powersupply1"]
>
> And also the other association path:
>
> /xyz/openbmc_project/inventory/system/powersupply1/sensors
>
> With an xyz.openbmc_project.Association interface with an
> endpoints property of:
>
> ["/xyz/openbmc_project/sensors/power/ps1_input_power"]
>
> This now allows one to both find all sensors associated with a power
> supply, and
> find which inventory item is associated with a particular sensor. Note
> that
> the endpoints property is an array, and can get entries from multiple
> places.
>
> I suppose we could also put the forward/reverse association names, in
> this case
> "inventory" and "sensors", into the hwmon config file, and also allow
> creating
> multiple associations for each sensor if there is a usecase, though I
> would like
> to keep it as simple as possible:
>
> ASSOCIATIONS1_IN1=inventory,sensors,/xyz/openbmc_project/inventory/system/powersupply1
> ASSOCIATIONS2_IN1=chassis,contained_sensors,/xyz/openbmc_project/inventory/system/chassis
>
> What does everyone think?
I think it's useful and straightforward to use, and easy to test.
>
> Thanks
> Matt
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sensor->inventory associations in phosphor-hwmon
2019-02-20 18:32 ` Patrick Venture
@ 2019-02-20 18:47 ` James Feist
2019-02-20 21:39 ` Matt Spinler
0 siblings, 1 reply; 5+ messages in thread
From: James Feist @ 2019-02-20 18:47 UTC (permalink / raw)
To: Patrick Venture, Matt Spinler; +Cc: OpenBMC Maillist
On 2/20/19 10:32 AM, Patrick Venture wrote:
> On Wed, Feb 20, 2019 at 10:31 AM Matt Spinler <mspinler@linux.ibm.com> wrote:
>>
>> Hi,
>>
>> We have a need to know which sensor objects hosted by the various
>> phosphor-hwmon
>> daemons belong to which inventory objects. For example, we need to know
>> that
>> the /xyz/openbmc_project/sensors/power/ps1_input_power sensor belongs to
>> the
>> /xyz/openbmc_project/inventory/system/powersupply1 item.
>>
>> To accomplish this, I am proposing we add a new environment variable to
>> the
>> system specific phosphor-hwmon config files that the phosphor-hwmon code
>> can then use to create associations interfaces that will cause the
>> mapper to
>> create the appropriate association D-Bus paths.
>>
>> As an example, we could add to the power-supply1 conf file an
>> ASSOCIATIONS
>> variable for each sensor (assuming ps1_input_power is represented by
>> IN1):
>>
>> ASSOCIATIONS_IN1=/xyz/openbmc_project/inventory/system/powersupply1
>>
>> The code would then see that and create a new org.openbmc.Associations
>> interface
>> on the /xyz/openbmc_project/sensors/power/ps1_input_power path with an
>> associations property of:
>>
>> ["inventory",
>> "sensors",
>> "/xyz/openbmc_project/inventory/system/powersupply1"]
>>
>> This leads to the mapper creating:
>>
>> /xyz/openbmc_project/sensors/power/ps1_input_power/inventory
>>
>> With an xyz.openbmc_project.Association interface with an
>> endpoints property of:
>>
>> ["/xyz/openbmc_project/inventory/system/powersupply1"]
>>
>> And also the other association path:
>>
>> /xyz/openbmc_project/inventory/system/powersupply1/sensors
>>
>> With an xyz.openbmc_project.Association interface with an
>> endpoints property of:
>>
>> ["/xyz/openbmc_project/sensors/power/ps1_input_power"]
>>
>> This now allows one to both find all sensors associated with a power
>> supply, and
>> find which inventory item is associated with a particular sensor. Note
>> that
>> the endpoints property is an array, and can get entries from multiple
>> places.
>>
>> I suppose we could also put the forward/reverse association names, in
>> this case
>> "inventory" and "sensors", into the hwmon config file, and also allow
>> creating
>> multiple associations for each sensor if there is a usecase, though I
>> would like
>> to keep it as simple as possible:
>>
>> ASSOCIATIONS1_IN1=inventory,sensors,/xyz/openbmc_project/inventory/system/powersupply1
>> ASSOCIATIONS2_IN1=chassis,contained_sensors,/xyz/openbmc_project/inventory/system/chassis
>>
>> What does everyone think?
>
> I think it's useful and straightforward to use, and easy to test.
Have we considered the alternative of the inventory item creating the
association? I only ask because in the past we've tried to keep
redfish/ipmi specific things outside of the sensors. I think this
proposal works fine btw, just seems like the alternative would work as
well and would keep sensors as just 'sensors'.
-James
>
>>
>> Thanks
>> Matt
>>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sensor->inventory associations in phosphor-hwmon
2019-02-20 18:47 ` James Feist
@ 2019-02-20 21:39 ` Matt Spinler
0 siblings, 0 replies; 5+ messages in thread
From: Matt Spinler @ 2019-02-20 21:39 UTC (permalink / raw)
To: James Feist, Patrick Venture; +Cc: OpenBMC Maillist
On 2/20/2019 12:47 PM, James Feist wrote:
> On 2/20/19 10:32 AM, Patrick Venture wrote:
>> On Wed, Feb 20, 2019 at 10:31 AM Matt Spinler
>> <mspinler@linux.ibm.com> wrote:
>>>
>>> Hi,
>>>
>>> We have a need to know which sensor objects hosted by the various
>>> phosphor-hwmon
>>> daemons belong to which inventory objects. For example, we need to
>>> know
>>> that
>>> the /xyz/openbmc_project/sensors/power/ps1_input_power sensor
>>> belongs to
>>> the
>>> /xyz/openbmc_project/inventory/system/powersupply1 item.
>>>
>>> To accomplish this, I am proposing we add a new environment variable to
>>> the
>>> system specific phosphor-hwmon config files that the phosphor-hwmon
>>> code
>>> can then use to create associations interfaces that will cause the
>>> mapper to
>>> create the appropriate association D-Bus paths.
>>>
>>> As an example, we could add to the power-supply1 conf file an
>>> ASSOCIATIONS
>>> variable for each sensor (assuming ps1_input_power is represented by
>>> IN1):
>>>
>>> ASSOCIATIONS_IN1=/xyz/openbmc_project/inventory/system/powersupply1
>>>
>>> The code would then see that and create a new org.openbmc.Associations
>>> interface
>>> on the /xyz/openbmc_project/sensors/power/ps1_input_power path with an
>>> associations property of:
>>>
>>> ["inventory",
>>> "sensors",
>>> "/xyz/openbmc_project/inventory/system/powersupply1"]
>>>
>>> This leads to the mapper creating:
>>>
>>> /xyz/openbmc_project/sensors/power/ps1_input_power/inventory
>>>
>>> With an xyz.openbmc_project.Association interface with an
>>> endpoints property of:
>>>
>>> ["/xyz/openbmc_project/inventory/system/powersupply1"]
>>>
>>> And also the other association path:
>>>
>>> /xyz/openbmc_project/inventory/system/powersupply1/sensors
>>>
>>> With an xyz.openbmc_project.Association interface with an
>>> endpoints property of:
>>>
>>> ["/xyz/openbmc_project/sensors/power/ps1_input_power"]
>>>
>>> This now allows one to both find all sensors associated with a power
>>> supply, and
>>> find which inventory item is associated with a particular sensor. Note
>>> that
>>> the endpoints property is an array, and can get entries from multiple
>>> places.
>>>
>>> I suppose we could also put the forward/reverse association names, in
>>> this case
>>> "inventory" and "sensors", into the hwmon config file, and also allow
>>> creating
>>> multiple associations for each sensor if there is a usecase, though I
>>> would like
>>> to keep it as simple as possible:
>>>
>>> ASSOCIATIONS1_IN1=inventory,sensors,/xyz/openbmc_project/inventory/system/powersupply1
>>>
>>> ASSOCIATIONS2_IN1=chassis,contained_sensors,/xyz/openbmc_project/inventory/system/chassis
>>>
>>>
>>> What does everyone think?
>>
>> I think it's useful and straightforward to use, and easy to test.
>
> Have we considered the alternative of the inventory item creating the
> association? I only ask because in the past we've tried to keep
> redfish/ipmi specific things outside of the sensors. I think this
> proposal works fine btw, just seems like the alternative would work as
> well and would keep sensors as just 'sensors'.
>
After our discussion on IRC, I will look into adding the functionality
in phosphor-inventory-manager to add any required inventory
associations, which would cover LEDs, sensors, etc, and then you can do
the same for Entity-Manager. That way, the bmcweb Redfish code that
would use these can be common.
> -James
>
>>
>>>
>>> Thanks
>>> Matt
>>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-02-20 21:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-20 16:10 sensor->inventory associations in phosphor-hwmon Matt Spinler
2019-02-20 18:32 ` Patrick Venture
2019-02-20 18:47 ` James Feist
2019-02-20 21:39 ` Matt Spinler
-- strict thread matches above, loose matches on Subject: below --
2019-02-20 16:56 Matt Spinler
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.