30
Redfish on OpenBMC Gunnar Mills IBM

Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

Redfish on OpenBMC

Gunnar Mills

IBM

Page 2: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

Agenda

What is Redfish

Getting Started with Redfish

OpenBMC’s Redfish Implementation

OpenBMC Releases

Redfish Data Model

Redfish Sessions

Redfish Major Collections

Page 3: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

What is Redfish?

• Open industry standard specification for hardware management

• Definition community-driven• Distributed Management Task Force (DMTF)

• History• Redfish Forum created in 2014• First Redfish specification Aug 2015• Latest 2019.2 (3Q 2019)

• 30 companies • Broadcom Inc., Cisco, Dell Inc., Ericsson AB, Hewlett Packard Enterprise, Intel

Corporation, Lenovo, Supermicro, Vertiv, VMware Inc.• American Megatrends, Inc., ARM, Inc, Artesyn Embedded Technologies, Atosm,

Cray, Inc., Eaton, Fujitsu, Google LLC, Huawei, IBM, Insyde Software Corp., Mellanox Technologies, Microchip Technology Inc., NetApp, New H3C Technologies Co., OSIsoft, LLC, Quanta Computer Inc, SolarflareCommunications, Toshiba Memory Corporation, Western Digital Corporation

• First release focused on Servers• Intended to meet OCP Remote Machine Management requirement• Full server category: Rackmount, Blades, HPC, Racks, Etc• Replacement for IPMI-over-LAN

• New specification every 4 months• Working with SNIA to cover more advanced Storage (Swordfish)• Working with The Green Grid & ASHRAE to cover Facilities (Power/Cooling)• Working with the IETF to cover some level of Ethernet Switching

Page 4: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

Redfish

• RESTful API, HTTPS, JSON

• Don’t invent anything new if robust solutions exist

• Schema-backed but human-readable

• OData (Open Data Protocol)

• Usable by Apps, GUIs, browser plug-ins, and scripts

• Extensible, Secure, Interoperable

• 80+ schemas, 2000+ properties• Most optional

• OCP Server and Baseline manageable device profiles • Can target for implementation

• Tools – redfishtool, Redfish-Service-Validator

Page 5: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData
Page 6: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

Getting started with Redfish

• https://www.dmtf.org/standards/redfish

Redfish Standard

• https://redfish.dmtf.org/

Developer Hub

• https://github.com/dmtf/redfish

Private repo

• Simple Rack Mounted Server

• https://redfish.dmtf.org/redfish/mockups/v1/863

Redfish Mockups

Page 7: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData
Page 8: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData
Page 9: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

OpenBMC’s Redfish Implementation• Bmcweb

• “Do everything" embedded webserver• Configurable

• Authentication middleware

• Virtual media, KVM• Redfish

• Transposes D-Bus interfaces to REST

• Static file hosting for Web Interface• Async

• Replaces phosphor-rest-server

• Uses Boost::Beast

• Adding translation layer• Means changes to our D-Bus API do not impact users

Page 10: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

Object Mapper

bmcweb mapperPhosphor inventory manager

GetSubTree (Inventory.Item.Cpu)

GetAll

xyz.openbmc_project.Inventory.manager

Processor properties

Page 11: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

dbus-send --system --print-reply \

--dest=xyz.openbmc_project.ObjectMapper \

/xyz/openbmc_project/object_mapper \

xyz.openbmc_project.ObjectMapper.GetSubTree \

string:"/" int32:0 array:string:"xyz.openbmc_project.Inventory.Item.Cpu"

method return time=1567567965.616423 sender=:1.23 -> destination=:1.148 serial=3

932 reply_serial=2

array [

dict entry(

string "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"

array [

dict entry(

string "xyz.openbmc_project.Inventory.Manager"

array [

string "org.freedesktop.DBus.Introspectable"

string "org.freedesktop.DBus.Peer"

string "org.freedesktop.DBus.Properties"

string "xyz.openbmc_project.Inventory.Decorator.Asset"

string "xyz.openbmc_project.Inventory.Decorator.Cacheable"

string "xyz.openbmc_project.Inventory.Decorator.Replaceable"

string "xyz.openbmc_project.Inventory.Decorator.Revision"

string "xyz.openbmc_project.Inventory.Item"

string "xyz.openbmc_project.Inventory.Item.Cpu"

string "xyz.openbmc_project.State.Decorator.OperationalStatus"

]

)

]

)

dict entry(

string "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1"

array [

dict entry(

string "xyz.openbmc_project.Inventory.Manager"

array [

string "org.freedesktop.DBus.Introspectable"

string "org.freedesktop.DBus.Peer"

string "org.freedesktop.DBus.Properties"

string "xyz.openbmc_project.Inventory.Decorator.Asset"

string "xyz.openbmc_project.Inventory.Decorator.Cacheable"

string "xyz.openbmc_project.Inventory.Decorator.Replaceable"

string "xyz.openbmc_project.Inventory.Decorator.Revision"

string "xyz.openbmc_project.Inventory.Item"

string "xyz.openbmc_project.Inventory.Item.Cpu"

string "xyz.openbmc_project.State.Decorator.OperationalStatus"

]

)

]

)

]

Page 12: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

dbus-send --system --print-reply \

--dest=xyz.openbmc_project.Inventory.Manager \

/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1 \

org.freedesktop.DBus.Properties.GetAll string:""

method return time=1567569558.219323 sender=:1.14 -> destination=:1.168 serial=1338

reply_serial=2

array [

dict entry(

string "Functional"

variant boolean true

)

dict entry(

string "PrettyName"

variant string "PROCESSOR MODULE"

)

dict entry(

string "Present"

variant boolean true

)

dict entry(

string "Version"

variant string "22"

)

dict entry(

string "FieldReplaceable"

variant boolean true

)

dict entry(

string "Cached"

variant boolean false

)

dict entry(

string "PartNumber"

variant string "02CY211"

)

dict entry(

string "SerialNumber"

variant string "YA1934302965"

)

dict entry(

string "Manufacturer"

variant string "IBM"

)

dict entry(

string "BuildDate"

variant string "1996-01-01 - 00:00:00"

)

dict entry(

string "Model"

variant string ""

)

]

Page 13: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

OpenBMC Community Releases

• Release planning work group

• Release every 6 months following Yocto releases

• 2.6• February 2019

• First release as Linux foundation community

• 2.7• August 2019

• Redfish a big part

• 2.8• February 2020

Page 14: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

2.7 Redfish Functionality

Firmware Update

Inventory Logging

NetworkPartial

CertificatesPower & Thermal

State Management

TimeManagement

User Management

Page 15: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

SSL certificate panel using Redfish API

Page 16: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

2.8 Redfish Functionality

All Sensors

Event Service

Full Certificate Management

LDAP

LED

Multiple Firmware Image Support

Telemetry Service

Subscription Collection

Virtual Media

Page 17: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData
Page 18: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

Moving OpenBMCInterfaces to Redfish

• 2.7 release – August 2019• Properties that were already in the Redfish

• Today web Interface and openbmctooluse both D-Bus REST API and Redfish

• Needs SNMP (not in the spec), multiple firmware image Redfish support (2019.2), etc.

• Continue to upstream properties to Redfish

• Eventually will move away from exposing D-Bus API

• Web interface will use all Redfish

Page 19: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

Redfish data model

• All resources linked from the Service root

• /redfish/v1/

• Root can be read unauthenticated

• 3 major collections

• ComputerSystem

• Logical view of the system as seen from OS

• Memory

• Processors

• Chassis

• A physical view of a box

• Fans

• Power supplies

• Sensors

• Managers

• BMC

Page 20: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

Basic Authorization

• Curl

• Postman

• Passing the username and password as part of URI• root:<password>@<bmc>

Page 21: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

Token based authorization

Page 22: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

Sessions/redfish/v1/SessionService/Sessions/

Page 23: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

How simple is REST using

JSON?

Python3 code to get the system model:

Output:

Page 24: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

CommonRedfish

Properties

• "@odata.type“: specifies the schema and version.format "#<schema>.<version>.<entity>”

• "@odata.id“: the URI of the Resource – a “self” pointer.

• "@odata.context“: used by OData clients.

• "Id": a unique ID within the current URI. Usually the last segment of the URI.

• "Name": a human friendly name for the resource.

• "Status“: includes the "State“, “Health”, and "HealthRollUp“ of resource and children.

• "Links“: contains references to related resources.

• "Actions“: the list of actions supported.

• "OEM“: is used to separate vendor extensions from the standard.

Page 25: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

Service Root

curl -k https://${bmc}/redfish/v1/

{

"@odata.context": "/redfish/v1/$metadata#ServiceRoot.ServiceRoot",

"@odata.id": "/redfish/v1",

"@odata.type": "#ServiceRoot.v1_5_0.ServiceRoot",

"AccountService": {

"@odata.id": "/redfish/v1/AccountService"

},

"CertificateService": {

"@odata.id": "/redfish/v1/CertificateService"

},

"Chassis": {

"@odata.id": "/redfish/v1/Chassis"

},

"Id": "RootService",

"JsonSchemas": {

"@odata.id": "/redfish/v1/JsonSchemas"

},

"Links": {

"Sessions": {

"@odata.id": "/redfish/v1/SessionService/Sessions"

}

},

"Managers": {

"@odata.id": "/redfish/v1/Managers"

},

"Name": "Root Service",

"RedfishVersion": "1.6.1",

Page 26: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

System

"@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem",

"@odata.id": "/redfish/v1/Systems/system",

"@odata.type": "#ComputerSystem.v1_6_0.ComputerSystem",

"Actions": {

"#ComputerSystem.Reset": {

"[email protected]": [

"On",

"ForceOff",

"ForceOn",

"ForceRestart",

"GracefulRestart",

"GracefulShutdown",

"PowerCycle",

"Nmi"

],

"target": "/redfish/v1/Systems/system/Actions/ComputerSystem.Reset"

}

},

"AssetTag": "",

"BiosVersion": "IBM-witherspoon-OP9-v2.3-rc2-3.28",

"Boot": {

"BootSourceOverrideEnabled": "Disabled",

"BootSourceOverrideMode": "Legacy",

"BootSourceOverrideTarget": "None",

"[email protected]": [

"None",

"Pxe",

"Hdd",

"Cd",

"Diags",

"BiosSetup"

]

},

"Description": "Computer System",

"Id": "0000000000000000",

"Name": "system",

"PartNumber": "",

"PowerState": "Off",

"ProcessorSummary": {

"Count": 2,

"Status": {

"State": "Enabled"

}

},

"Processors": {

"@odata.id": "/redfish/v1/Systems/system/Processors"

},

Page 27: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

Host power on

Page 28: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

Chassis

curl -k https://${bmc}/redfish/v1/Chassis/chassis

{

"@odata.context": "/redfish/v1/$metadata#Chassis.Chassis",

"@odata.id": "/redfish/v1/Chassis/chassis",

"@odata.type": "#Chassis.v1_4_0.Chassis",

"ChassisType": "RackMount",

"Id": "chassis",

"Links": {

"ComputerSystems": [

{

"@odata.id": "/redfish/v1/Systems/system"

}

],

"ManagedBy": [

{

"@odata.id": "/redfish/v1/Managers/bmc"

}

]

},

"Name": "chassis",

"Power": {

"@odata.id": "/redfish/v1/Chassis/chassis/Power"

},

"PowerState": "On",

"Status": {

"Health": "OK",

"HealthRollup": "OK",

"State": "Enabled"

},

"Thermal": {

"@odata.id": "/redfish/v1/Chassis/chassis/Thermal"

}

}

Chassis

Thermal

Fans

Temperatures

Power

Voltages

Power supplies

Page 29: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

Manager

"Actions": {

"#Manager.Reset": {

"[email protected]": [

"GracefulRestart"

],

"target": "/redfish/v1/Managers/bmc/Actions/Manager.Reset"

}

},

"DateTime": "2029-08-04T16:44:30+00:00",

"Description": "Baseboard Management Controller",

"EthernetInterfaces": {

"@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces"

},

"FirmwareVersion": "2.8.0-dev-183-gda12d34-dirty",

"GraphicalConsole": {

"ConnectTypesSupported": [

"KVMIP"

],

"ServiceEnabled": true

},

curl -k https://${bmc}/redfish/v1/Managers

{

"@odata.context":

"/redfish/v1/$metadata#ManagerCollection.ManagerCollection",

"@odata.id": "/redfish/v1/Managers",

"@odata.type": "#ManagerCollection.ManagerCollection",

"Members": [

{

"@odata.id": "/redfish/v1/Managers/bmc"

}

],

"[email protected]": 1,

"Name": "Manager Collection"

}

Page 30: Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent anything new if robust solutions exist •Schema-backed but human-readable •OData

Backup