各大主板厂商纷纷支持下一代带外管理标准redfish。
其实Dell的idrac管理做的是相当好的,那么来看看对redfish的支持吧。
先看看v1都有什么命令
1curl -s "https://10.16.24.15/redfish/v1" -k -u root:xxxxxxxx | jq .
2
3结果如下:
4
5{
6 "@odata.context": "/redfish/v1/$metadata#ServiceRoot.ServiceRoot",
7 "@odata.id": "/redfish/v1",
8 "@odata.type": "#ServiceRoot.v1_1_0.ServiceRoot",
9 "AccountService": {
10 "@odata.id": "/redfish/v1/Managers/iDRAC.Embedded.1/AccountService"
11 },
12 "Chassis": {
13 "@odata.id": "/redfish/v1/Chassis"
14 },
15 "Description": "Root Service",
16 "EventService": {
17 "@odata.id": "/redfish/v1/EventService"
18 },
19 "Id": "RootService",
20 "JsonSchemas": {
21 "@odata.id": "/redfish/v1/JSONSchemas"
22 },
23 "Links": {
24 "Sessions": {
25 "@odata.id": "/redfish/v1/Sessions"
26 }
27 },
28 "Managers": {
29 "@odata.id": "/redfish/v1/Managers"
30 },
31 "Name": "Root Service",
32 "Oem": {
33 "Dell": {
34 "@odata.type": "#DellServiceRoot.v1_0_0.ServiceRootSummary",
35 "IsBranded": 0,
36 "ManagerMACAddress": "50:9A:4C:82:B9:3F",
37 "ServiceTag": "7Q9N8P2"
38 }
39 },
40 "RedfishVersion": "1.0.2",
41 "Registries": {
42 "@odata.id": "/redfish/v1/Registries"
43 },
44 "SessionService": {
45 "@odata.id": "/redfish/v1/SessionService"
46 },
47 "Systems": {
48 "@odata.id": "/redfish/v1/Systems"
49 },
50 "Tasks": {
51 "@odata.id": "/redfish/v1/TaskService"
52 },
53 "UpdateService": {
54 "@odata.id": "/redfish/v1/UpdateService"
55 }
56}
好多服务撒,挑其中一个分支看看:
1curl -s "https://10.16.24.15/redfish/v1/Chassis" -k -u root:alibaba | jq .
2
3结果如下:
4
5{
6 "@odata.context": "/redfish/v1/$metadata#ChassisCollection.ChassisCollection",
7 "@odata.id": "/redfish/v1/Chassis/",
8 "@odata.type": "#ChassisCollection.ChassisCollection",
9 "Description": "Collection of Chassis",
10 "Members": [
11 {
12 "@odata.id": "/redfish/v1/Chassis/System.Embedded.1"
13 },
14 {
15 "@odata.id": "/redfish/v1/Chassis/Enclosure.Internal.0-1:RAID.Integrated.1-1"
16 }
17 ],
18 "Members@odata.count": 2,
19 "Name": "Chassis Collection"
20}
再试试Session的管理:
1curl -v -k -X POST -d '{"UserName":"root","Password":"xxxxxxxx"}' -H "Content-Type: application/json" https://10.16.24.15/redfish/v1/Sessions | jq .
注意Dell官方的文档里居然不提json的事,直接用它给的命令会报错的,post的数据明显是个json。
1结果:
2
3* About to connect() to 10.16.24.15 port 443 (#0)
4* Trying 10.16.24.15... connected
5* Connected to 10.16.24.15 (10.16.24.15) port 443 (#0)
6* Initializing NSS with certpath: sql:/etc/pki/nssdb
7* warning: ignoring value of ssl.verifyhost
8* skipping SSL peer certificate verification
9* SSL connection using TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
10* Server certificate:
11* subject: E=support@dell.com,CN=idrac-7Q9N8P2,OU=Remote Access Group,O=Dell Inc.,L=Round Rock,ST=Texas,C=US
12* start date: Mar 15 06:13:00 2018 GMT
13* expire date: Mar 15 06:14:22 2028 GMT
14* common name: idrac-7Q9N8P2
15* issuer: E=support@dell.com,CN=idrac-7Q9N8P2,OU=Remote Access Group,O=Dell Inc.,L=Round Rock,ST=Texas,C=US
16> POST /redfish/v1/Sessions HTTP/1.1
17> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.21 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
18> Host: 10.16.24.15
19> Accept: */*
20> Content-Type: application/json
21> Content-Length: 39
22>
23} [data not shown]
24< HTTP/1.1 201 Created
25< OData-Version: 4.0
26< Keep-Alive: timeout=60, max=199
27< Content-Type: application/json;odata.metadata=minimal;charset=utf-8
28< Server: iDRAC/8
29< Location: /redfish/v1/Sessions/13
30< Date: Wed, 05 Sep 2018 08:26:55 GMT
31< X-Auth-Token: d42c621ee25ad8b49c0d24bbd763f54f
32< Cache-Control: no-cache
33< Content-Length: 745
34< Connection: Keep-Alive
35< Access-Control-Allow-Origin: *
36< Accept-Ranges: bytes
37<
38{ [data not shown]
39* Connection #0 to host 10.16.24.15 left intact
40* Closing connection #0
41{
42 "@Message.ExtendedInfo": [
43 {
44 "Message": "The resource has been created successfully",
45 "MessageArgs": [],
46 "MessageArgs@odata.count": 0,
47 "MessageId": "Base.1.0.Created",
48 "RelatedProperties": [],
49 "RelatedProperties@odata.count": 0,
50 "Resolution": "None",
51 "Severity": "OK"
52 },
53 {
54 "Message": "A new resource is successfully created.",
55 "MessageArgs": [],
56 "MessageArgs@odata.count": 0,
57 "MessageId": "IDRAC.1.6.SYS414",
58 "RelatedProperties": [],
59 "RelatedProperties@odata.count": 0,
60 "Resolution": "No response action is required.",
61 "Severity": "Informational"
62 }
63 ],
64 "@odata.context": "/redfish/v1/$metadata#Session.Session",
65 "@odata.id": "/redfish/v1/Sessions/13",
66 "@odata.type": "#Session.v1_0_2.Session",
67 "Description": "User Session",
68 "Id": "13",
69 "Name": "User Session",
70 "Password": null,
71 "UserName": "root"
72}
记下这行:X-Auth-Token: d42c621ee25ad8b49c0d24bbd763f54f
试试这种Session的功效
1curl -k https://10.16.24.15/redfish/v1/Chassis -s --header "X-Auth-Token: d42c621ee25ad8b49c0d24bbd763f54f" | jq .
2
3结果:
4
5{
6 "@odata.context": "/redfish/v1/$metadata#ChassisCollection.ChassisCollection",
7 "@odata.id": "/redfish/v1/Chassis/",
8 "@odata.type": "#ChassisCollection.ChassisCollection",
9 "Description": "Collection of Chassis",
10 "Members": [
11 {
12 "@odata.id": "/redfish/v1/Chassis/System.Embedded.1"
13 },
14 {
15 "@odata.id": "/redfish/v1/Chassis/Enclosure.Internal.0-1:RAID.Integrated.1-1"
16 }
17 ],
18 "Members@odata.count": 2,
19 "Name": "Chassis Collection"
20}
搞定,如果还想需要更多的功能,就去看手册吧。