This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 13. Monitoring bare-metal events with the Bare Metal Event Relay
Bare Metal Event Relay is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
13.1. About bare-metal events
Use the Bare Metal Event Relay to subscribe applications that run in your OpenShift Container Platform cluster to events that are generated on the underlying bare-metal host. The Redfish service publishes events on a node and transmits them on an advanced message queue to subscribed applications.
Bare-metal events are based on the open Redfish standard that is developed under the guidance of the Distributed Management Task Force (DMTF). Redfish provides a secure industry-standard protocol with a REST API. The protocol is used for the management of distributed, converged or software-defined resources and infrastructure.
Hardware-related events published through Redfish includes:
- Breaches of temperature limits
- Server status
- Fan status
Begin using bare-metal events by deploying the Bare Metal Event Relay Operator and subscribing your application to the service. The Bare Metal Event Relay Operator installs and manages the lifecycle of the Redfish bare-metal event service.
The Bare Metal Event Relay works only with Redfish-capable devices on single-node clusters provisioned on bare-metal infrastructure.
13.2. How bare-metal events work
The Bare Metal Event Relay enables applications running on bare-metal clusters to respond quickly to Redfish hardware changes and failures such as breaches of temperature thresholds, fan failure, disk loss, power outages, and memory failure. These hardware events are delivered over a reliable low-latency transport channel based on Advanced Message Queuing Protocol (AMQP). The latency of the messaging service is between 10 to 20 milliseconds.
The Bare Metal Event Relay provides a publish-subscribe service for the hardware events, where multiple applications can use REST APIs to subscribe and consume the events. The Bare Metal Event Relay supports hardware that complies with Redfish OpenAPI v1.8 or higher.
13.2.1. Bare Metal Event Relay data flow
The following figure illustrates an example of bare-metal events data flow:
Figure 13.1. Bare Metal Event Relay data flow
13.2.1.1. Operator-managed pod
						The Operator uses custom resources to manage the pod containing the Bare Metal Event Relay and its components using the HardwareEvent CR.
					
13.2.1.2. Bare Metal Event Relay
At startup, the Bare Metal Event Relay queries the Redfish API and downloads all the message registries, including custom registries. The Bare Metal Event Relay then begins to receive subscribed events from the Redfish hardware.
						The Bare Metal Event Relay enables applications running on bare-metal clusters to respond quickly to Redfish hardware changes and failures such as breaches of temperature thresholds, fan failure, disk loss, power outages, and memory failure. The events are reported using the HardwareEvent CR.
					
13.2.1.3. Cloud native event
Cloud native events (CNE) is a REST API specification for defining the format of event data.
13.2.1.4. CNCF CloudEvents
CloudEvents is a vendor-neutral specification developed by the Cloud Native Computing Foundation (CNCF) for defining the format of event data.
13.2.1.5. AMQP dispatch router
The dispatch router is responsible for the message delivery service between publisher and subscriber. AMQP 1.0 qpid is an open standard that supports reliable, high-performance, fully-symmetrical messaging over the internet.
13.2.1.6. Cloud event proxy sidecar
The cloud event proxy sidecar container image is based on the ORAN API specification and provides a publish-subscribe event framework for hardware events.
13.2.2. Redfish message parsing service
					In addition to handling Redfish events, the Bare Metal Event Relay provides message parsing for events without a Message property. The proxy downloads all the Redfish message registries including vendor specific registries from the hardware when it starts. If an event does not contain a Message property, the proxy uses the Redfish message registries to construct the Message and Resolution properties and add them to the event before passing the event to the cloud events framework. This service allows Redfish events to have smaller message size and lower transmission latency.
				
13.2.3. Installing the Bare Metal Event Relay using the CLI
As a cluster administrator, you can install the Bare Metal Event Relay Operator by using the CLI.
Prerequisites
- A cluster that is installed on bare-metal hardware with nodes that have a RedFish-enabled Baseboard Management Controller (BMC).
- 
							Install the OpenShift CLI (oc).
- 
							Log in as a user with cluster-adminprivileges.
Procedure
- Create a namespace for the Bare Metal Event Relay. - Save the following YAML in the - bare-metal-events-namespace.yamlfile:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create the - NamespaceCR:- oc create -f bare-metal-events-namespace.yaml - $ oc create -f bare-metal-events-namespace.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Create an Operator group for the Bare Metal Event Relay Operator. - Save the following YAML in the - bare-metal-events-operatorgroup.yamlfile:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create the - OperatorGroupCR:- oc create -f bare-metal-events-operatorgroup.yaml - $ oc create -f bare-metal-events-operatorgroup.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Subscribe to the Bare Metal Event Relay. - Save the following YAML in the - bare-metal-events-sub.yamlfile:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create the - SubscriptionCR:- oc create -f bare-metal-events-sub.yaml - $ oc create -f bare-metal-events-sub.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
Verification
To verify that the Bare Metal Event Relay Operator is installed, run the following command:
oc get csv -n openshift-bare-metal-events -o custom-columns=Name:.metadata.name,Phase:.status.phase
$ oc get csv -n openshift-bare-metal-events -o custom-columns=Name:.metadata.name,Phase:.status.phaseExample output
Name Phase bare-metal-event-relay.4.11.0-xxxxxxxxxxxx Succeeded
Name                                                          Phase
bare-metal-event-relay.4.11.0-xxxxxxxxxxxx            Succeeded13.2.4. Installing the Bare Metal Event Relay using the web console
As a cluster administrator, you can install the Bare Metal Event Relay Operator using the web console.
Prerequisites
- A cluster that is installed on bare-metal hardware with nodes that have a RedFish-enabled Baseboard Management Controller (BMC).
- 
							Log in as a user with cluster-adminprivileges.
Procedure
- Install the Bare Metal Event Relay using the OpenShift Container Platform web console: - 
									In the OpenShift Container Platform web console, click Operators OperatorHub. 
- Choose Bare Metal Event Relay from the list of available Operators, and then click Install.
- On the Install Operator page, select or create a Namespace, select openshift-bare-metal-events, and then click Install.
 
- 
									In the OpenShift Container Platform web console, click Operators 
Verification
Optional: You can verify that the Operator installed successfully by performing the following check:
- 
							Switch to the Operators Installed Operators page. 
- Ensure that Bare Metal Event Relay is listed in the project with a Status of InstallSucceeded. Note- During installation an Operator might display a Failed status. If the installation later succeeds with an InstallSucceeded message, you can ignore the Failed message. 
If the Operator does not appear as installed, to troubleshoot further:
- 
							Go to the Operators Installed Operators page and inspect the Operator Subscriptions and Install Plans tabs for any failure or errors under Status. 
- 
							Go to the Workloads Pods page and check the logs for pods in the project namespace. 
13.3. Installing the AMQ messaging bus
To pass Redfish bare-metal event notifications between publisher and subscriber on a node, you must install and configure an AMQ messaging bus to run locally on the node. You do this by installing the AMQ Interconnect Operator for use in the cluster.
Prerequisites
- 
						Install the OpenShift Container Platform CLI (oc).
- 
						Log in as a user with cluster-adminprivileges.
Procedure
- 
						Install the AMQ Interconnect Operator to its own amq-interconnectnamespace. See Installing the AMQ Interconnect Operator.
Verification
- Verify that the AMQ Interconnect Operator is available and the required pods are running: - oc get pods -n amq-interconnect - $ oc get pods -n amq-interconnect- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - NAME READY STATUS RESTARTS AGE amq-interconnect-645db76c76-k8ghs 1/1 Running 0 23h interconnect-operator-5cb5fc7cc-4v7qm 1/1 Running 0 23h - NAME READY STATUS RESTARTS AGE amq-interconnect-645db76c76-k8ghs 1/1 Running 0 23h interconnect-operator-5cb5fc7cc-4v7qm 1/1 Running 0 23h- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Verify that the required - bare-metal-event-relaybare-metal event producer pod is running in the- openshift-bare-metal-eventsnamespace:- oc get pods -n openshift-bare-metal-events - $ oc get pods -n openshift-bare-metal-events- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - NAME READY STATUS RESTARTS AGE hw-event-proxy-operator-controller-manager-74d5649b7c-dzgtl 2/2 Running 0 25s - NAME READY STATUS RESTARTS AGE hw-event-proxy-operator-controller-manager-74d5649b7c-dzgtl 2/2 Running 0 25s- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
13.4. Subscribing to Redfish BMC bare-metal events for a cluster node
				As a cluster administrator, you can subscribe to Redfish BMC events generated on a node in your cluster by creating a BMCEventSubscription custom resource (CR) for the node, creating a HardwareEvent CR for the event, and a Secret CR for the BMC.
			
13.4.1. Subscribing to bare-metal events
You can configure the baseboard management controller (BMC) to send bare-metal events to subscribed applications running in an OpenShift Container Platform cluster. Example Redfish bare-metal events include an increase in device temperature, or removal of a device. You subscribe applications to bare-metal events using a REST API.
						You can only create a BMCEventSubscription custom resource (CR) for physical hardware that supports Redfish and has a vendor interface set to redfish or idrac-redfish.
					
						Use the BMCEventSubscription CR to subscribe to predefined Redfish events. The Redfish standard does not provide an option to create specific alerts and thresholds. For example, to receive an alert event when an enclosure’s temperature exceeds 40° Celsius, you must manually configure the event according to the vendor’s recommendations.
					
					Perform the following procedure to subscribe to bare-metal events for the node using a BMCEventSubscription CR.
				
Prerequisites
- 
							Install the OpenShift CLI (oc).
- 
							Log in as a user with cluster-adminprivileges.
- Get the user name and password for the BMC.
- Deploy a bare-metal node with a Redfish-enabled Baseboard Management Controller (BMC) in your cluster, and enable Redfish events on the BMC. Note- Enabling Redfish events on specific hardware is outside the scope of this information. For more information about enabling Redfish events for your specific hardware, consult the BMC manufacturer documentation. 
Procedure
- Confirm that the node hardware has the Redfish - EventServiceenabled by running the following- curlcommand:- curl https://<bmc_ip_address>/redfish/v1/EventService --insecure -H 'Content-Type: application/json' -u "<bmc_username>:<password>" - curl https://<bmc_ip_address>/redfish/v1/EventService --insecure -H 'Content-Type: application/json' -u "<bmc_username>:<password>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - where: - bmc_ip_address
- is the IP address of the BMC where the Redfish events are generated.
 - Example output - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Get the Bare Metal Event Relay service route for the cluster by running the following command: - oc get route -n openshift-bare-metal-events - $ oc get route -n openshift-bare-metal-events- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD hw-event-proxy hw-event-proxy-openshift-bare-metal-events.apps.compute-1.example.com hw-event-proxy-service 9087 edge None - NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD hw-event-proxy hw-event-proxy-openshift-bare-metal-events.apps.compute-1.example.com hw-event-proxy-service 9087 edge None- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create a - BMCEventSubscriptionresource to subscribe to the Redfish events:- Save the following YAML in the - bmc_sub.yamlfile:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Specifies the name or UUID of the worker node where the Redfish events are generated.
- 2
- Specifies the bare-metal event proxy service, for example,https://hw-event-proxy-openshift-bare-metal-events.apps.compute-1.example.com/webhook.
 
- Create the - BMCEventSubscriptionCR:- oc create -f bmc_sub.yaml - $ oc create -f bmc_sub.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Optional: To delete the BMC event subscription, run the following command: - oc delete -f bmc_sub.yaml - $ oc delete -f bmc_sub.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Optional: To manually create a Redfish event subscription without creating a - BMCEventSubscriptionCR, run the following- curlcommand, specifying the BMC username and password.- curl -i -k -X POST -H "Content-Type: application/json" -d '{"Destination": "https://<proxy_service_url>", "Protocol" : "Redfish", "EventTypes": ["Alert"], "Context": "root"}' -u <bmc_username>:<password> 'https://<bmc_ip_address>/redfish/v1/EventService/Subscriptions' –v- $ curl -i -k -X POST -H "Content-Type: application/json" -d '{"Destination": "https://<proxy_service_url>", "Protocol" : "Redfish", "EventTypes": ["Alert"], "Context": "root"}' -u <bmc_username>:<password> 'https://<bmc_ip_address>/redfish/v1/EventService/Subscriptions' –v- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - where: - proxy_service_url
- 
										is the bare-metal event proxy service, for example, https://hw-event-proxy-openshift-bare-metal-events.apps.compute-1.example.com/webhook.
 - bmc_ip_address
- is the IP address of the BMC where the Redfish events are generated.
 - Example output - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
13.4.2. Querying Redfish bare-metal event subscriptions with curl
					Some hardware vendors limit the amount of Redfish hardware event subscriptions. You can query the number of Redfish event subscriptions by using curl.
				
Prerequisites
- Get the user name and password for the BMC.
- Deploy a bare-metal node with a Redfish-enabled Baseboard Management Controller (BMC) in your cluster, and enable Redfish hardware events on the BMC.
Procedure
- Check the current subscriptions for the BMC by running the following - curlcommand:- curl --globoff -H "Content-Type: application/json" -k -X GET --user <bmc_username>:<password> https://<bmc_ip_address>/redfish/v1/EventService/Subscriptions - $ curl --globoff -H "Content-Type: application/json" -k -X GET --user <bmc_username>:<password> https://<bmc_ip_address>/redfish/v1/EventService/Subscriptions- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - where: - bmc_ip_address
- is the IP address of the BMC where the Redfish events are generated.
 - Example output - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - In this example, a single subscription is configured: - /redfish/v1/EventService/Subscriptions/1.
- Optional: To remove the - /redfish/v1/EventService/Subscriptions/1subscription with- curl, run the following command, specifying the BMC username and password:- curl --globoff -L -w "%{http_code} %{url_effective}\n" -k -u <bmc_username>:<password >-H "Content-Type: application/json" -d '{}' -X DELETE https://<bmc_ip_address>/redfish/v1/EventService/Subscriptions/1- $ curl --globoff -L -w "%{http_code} %{url_effective}\n" -k -u <bmc_username>:<password >-H "Content-Type: application/json" -d '{}' -X DELETE https://<bmc_ip_address>/redfish/v1/EventService/Subscriptions/1- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - where: - bmc_ip_address
- is the IP address of the BMC where the Redfish events are generated.
 
13.4.3. Creating the bare-metal event and Secret CRs
					To start using bare-metal events, create the HardwareEvent custom resource (CR) for the host where the Redfish hardware is present. Hardware events and faults are reported in the hw-event-proxy logs.
				
Prerequisites
- 
							Install the OpenShift CLI (oc).
- 
							Log in as a user with cluster-adminprivileges.
- Install the Bare Metal Event Relay.
- 
							Create a BMCEventSubscriptionCR for the BMC Redfish hardware.
						Multiple HardwareEvent resources are not permitted.
					
Procedure
- Create the - HardwareEventcustom resource (CR):- Save the following YAML in the - hw-event.yamlfile:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Required. Use thenodeSelectorfield to target nodes with the specified label, for example,node-role.kubernetes.io/hw-event: "".
- 2
- Required. AMQP host that delivers the events at the transport layer using the AMQP protocol.
- 3
- Optional. The default value isdebug. Sets the log level inhw-event-proxylogs. The following log levels are available:fatal,error,warning,info,debug,trace.
- 4
- Optional. Sets the timeout value in milliseconds for the Message Parser. If a message parsing request is not responded to within the timeout duration, the original hardware event message is passed to the cloud native event framework. The default value is 10.
 
- Create the - HardwareEventCR:- oc create -f hardware-event.yaml - $ oc create -f hardware-event.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Create a BMC username and password - SecretCR that enables the hardware events proxy to access the Redfish message registry for the bare-metal host.- Save the following YAML in the - hw-event-bmc-secret.yamlfile:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Enter plain text values for the various items understringData.
 
- Create the - SecretCR:- oc create -f hw-event-bmc-secret.yaml - $ oc create -f hw-event-bmc-secret.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
13.5. Subscribing applications to bare-metal events REST API reference
Use the bare-metal events REST API to subscribe an application to the bare-metal events that are generated on the parent node.
				Subscribe applications to Redfish events by using the resource address /cluster/node/<node_name>/redfish/event, where <node_name> is the cluster node running the application.
			
				Deploy your cloud-event-consumer application container and cloud-event-proxy sidecar container in a separate application pod. The cloud-event-consumer application subscribes to the cloud-event-proxy container in the application pod.
			
				Use the following API endpoints to subscribe the cloud-event-consumer application to Redfish events posted by the cloud-event-proxy container at http://localhost:8089/api/ocloudNotifications/v1/ in the application pod:
			
- /api/ocloudNotifications/v1/subscriptions- 
								POST: Creates a new subscription
- 
								GET: Retrieves a list of subscriptions
 
- 
								
- /api/ocloudNotifications/v1/subscriptions/<subscription_id>- 
								PUT: Creates a new status ping request for the specified subscription ID
 
- 
								
- /api/ocloudNotifications/v1/health- 
								GET: Returns the health status ofocloudNotificationsAPI
 
- 
								
					9089 is the default port for the cloud-event-consumer container deployed in the application pod. You can configure a different port for your application as required.
				
api/ocloudNotifications/v1/subscriptions
HTTP method
				GET api/ocloudNotifications/v1/subscriptions
			
Description
				Returns a list of subscriptions. If subscriptions exist, a 200 OK status code is returned along with the list of subscriptions.
			
Example API response
HTTP method
				POST api/ocloudNotifications/v1/subscriptions
			
Description
				Creates a new subscription. If a subscription is successfully created, or if it already exists, a 201 Created status code is returned.
			
| Parameter | Type | 
|---|---|
| subscription | data | 
Example payload
{
  "uriLocation": "http://localhost:8089/api/ocloudNotifications/v1/subscriptions",
  "resource": "/cluster/node/openshift-worker-0.openshift.example.com/redfish/event"
}
{
  "uriLocation": "http://localhost:8089/api/ocloudNotifications/v1/subscriptions",
  "resource": "/cluster/node/openshift-worker-0.openshift.example.com/redfish/event"
}api/ocloudNotifications/v1/subscriptions/<subscription_id>
HTTP method
				GET api/ocloudNotifications/v1/subscriptions/<subscription_id>
			
Description
				Returns details for the subscription with ID <subscription_id>
			
| Parameter | Type | 
|---|---|
| 
								 | string | 
Example API response
api/ocloudNotifications/v1/health/
HTTP method
				GET api/ocloudNotifications/v1/health/
			
Description
				Returns the health status for the ocloudNotifications REST API.
			
Example API response
OK
OK