Redfish on OpenBMC - OSFC · 2019. 9. 5. · Redfish •RESTful API, HTTPS, JSON •Don’t invent...

Preview:

Citation preview

Redfish on OpenBMC

Gunnar Mills

IBM

Agenda

What is Redfish

Getting Started with Redfish

OpenBMC’s Redfish Implementation

OpenBMC Releases

Redfish Data Model

Redfish Sessions

Redfish Major Collections

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

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

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

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

Object Mapper

bmcweb mapperPhosphor inventory manager

GetSubTree (Inventory.Item.Cpu)

GetAll

xyz.openbmc_project.Inventory.manager

Processor properties

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"

]

)

]

)

]

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 ""

)

]

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

2.7 Redfish Functionality

Firmware Update

Inventory Logging

NetworkPartial

CertificatesPower & Thermal

State Management

TimeManagement

User Management

SSL certificate panel using Redfish API

2.8 Redfish Functionality

All Sensors

Event Service

Full Certificate Management

LDAP

LED

Multiple Firmware Image Support

Telemetry Service

Subscription Collection

Virtual Media

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

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

Basic Authorization

• Curl

• Postman

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

Token based authorization

Sessions/redfish/v1/SessionService/Sessions/

How simple is REST using

JSON?

Python3 code to get the system model:

Output:

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.

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",

System

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

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

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

"Actions": {

"#ComputerSystem.Reset": {

"ResetType@Redfish.AllowableValues": [

"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",

"BootSourceOverrideTarget@Redfish.AllowableValues": [

"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"

},

Host power on

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

Manager

"Actions": {

"#Manager.Reset": {

"ResetType@Redfish.AllowableValues": [

"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"

}

],

"Members@odata.count": 1,

"Name": "Manager Collection"

}

Backup