opencomputeproject / HWMgmt-DeviceMgr-DeviceManager

Device Manager collects device data and notifications from each device, and make the data available on a predetermined output bus for consumers.
Apache License 2.0
23 stars 12 forks source link

Device Manager functionality

Device Manager retrieves and collects information from devices (Redfish compliant) by using Redfish API. It uses ODIM's services to present data on northbound API.

Hardware requirements

The Device Manager supports running the Ubuntu Desktop 18.04 version. For a single node deployment minimum requirement are

Prerequisites

Before building Device Manager, the following steps are required:

Install Device Manager using single command

Use this command to install and run Device Manager together with ODIM services, Redis and Etcd as Docker containers.

$ make all

Once that make is complete, the Redfish interface will be available at 127.0.0.1:45000. The port number is specified by the odimra_config.json file, property APIGatewayConf.Port. The Redfish interface is used to create a connection to Device Manager.

Register Device Manager

After installation, you have to register Device Manager to ODIM. This is done by using Aggregation Sources. First, we need to know ID of Connection Method, which is of variant DM_v1.0.0. To do so, perform HTTP GET on the following URI https://{device-manager_host}:{port}/redfish/v1/AggregationService/ConnectionMethods, providing {user}:{password} (your chosen username and password). Check each record, to find the proper Connection Method.

curl  -k -u  '{user}:{password}' https://127.0.0.1:45000/redfish/v1/AggregationService/ConnectionMethods/3326bd25-c230-4083-95d7-a51b7af5bec3 | jq
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100   642    0   642    0     0   6356      0 --:--:-- --:--:-- --:--:--  6356
{
"@odata.type": "#ConnectionMethod.v1_0_0.ConnectionMethod",
"@odata.id": "/redfish/v1/AggregationService/ConnectionMethods/3326bd25-c230-4083-95d7-a51b7af5bec3",
"@odata.context": "/redfish/v1/$metadata#ConnectionMethod.v1_0_0.ConnectionMethod",
"Id": "3326bd25-c230-4083-95d7-a51b7af5bec3",
"Name": "Connection Method",
"ConnectionMethodType": "Redfish",
"ConnectionMethodVariant": "Compute:BasicAuth:DM_v1.0.0",
"Links": {
"AggregationSources": []
}
}

Next, perform HTTP POST on the URI: https://{device-manager_host}:{port}/redfish/v1/AggregationService/AggregationSources with the following body (remember to replace ConnectionMethod with one that was found in previous request):

curl --location -X POST -k -u '{user}:{password}' 'https://127.0.0.1:45000/redfish/v1/AggregationService/AggregationSources' \
--header 'Content-Type: application/json' \
--data-raw '{
"HostName": "device-manager:45003",
"UserName": "admin",
"Password": "your_password",
"Links": {
"ConnectionMethod": {
"@odata.id": "/redfish/v1/AggregationService/ConnectionMethods/3326bd25-c230-4083-95d7-a51b7af5bec3"
}
}
}' |jq

After sending the request, Redfish task is created and a link to the task monitor associated with it is returned.

To add a BMC as an Aggregation source, firstly certificates must be imported in BMC server. Then, you can send another HTTP POST on the URI: https://{device-manager_host}:{port}/redfish/v1/AggregationService/AggregationSources with the following body:

curl --location -X POST -k -u '{user}:{password}' 'https://127.0.0.1:45000/redfish/v1/AggregationService/AggregationSources' \
--header 'Content-Type: application/json' \
--data-raw '{
"HostName": "{BMC_address}",
"UserName": "{BMC_UserName}",
"Password": "{BMC_Password}",
"Links": {
"ConnectionMethod": {
"@odata.id": "/redfish/v1/AggregationService/ConnectionMethods/3326bd25-c230-4083-95d7-a51b7af5bec3"
}
}
}' |jq

After sending the request, Redfish task is created and a link to the task monitor associated with it is returned.

When tasks are finished, the following GET send on https://{device-manager_host}:{port}/redfish/v1/AggregationService/ConnectionMethods/{ConnectionMethodID} will show two previously added Aggregation sources.

curl  -k -u  '{user}:{password}' https://127.0.0.1:45000/redfish/v1/AggregationService/ConnectionMethods/3326bd25-c230-4083-95d7-a51b7af5bec3 | jq
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100   642    0   642    0     0   6356      0 --:--:-- --:--:-- --:--:--  6356
{
"@odata.type": "#ConnectionMethod.v1_0_0.ConnectionMethod",
"@odata.id": "/redfish/v1/AggregationService/ConnectionMethods/3326bd25-c230-4083-95d7-a51b7af5bec3",
"@odata.context": "/redfish/v1/$metadata#ConnectionMethod.v1_0_0.ConnectionMethod",
"Id": "3326bd25-c230-4083-95d7-a51b7af5bec3",
"Name": "Connection Method",
"ConnectionMethodType": "Redfish",
"ConnectionMethodVariant": "Compute:BasicAuth:DM_v1.0.0",
"Links": {
"AggregationSources": [
{
"@odata.id": "/redfish/v1/AggregationService/AggregationSources/99999999-9999-9999-9999-999999999999"
},
{
"@odata.id": "/redfish/v1/AggregationService/AggregationSources/207c0230-ed7b-412c-968a-d604c03aea16.1"
}
]
}
}