You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/master-the-redfish-server-states-to-improve-your-monitoring-and-manageme.md
+22-22Lines changed: 22 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,43 +16,43 @@ tags:
16
16
- ProLiant
17
17
- Synergy
18
18
---
19
-
#### Updated July 25, 2023
19
+
Updated February 26, 2024
20
20
21
21
## Introduction
22
22
23
-
Server management and monitoring often require the knowledge of the state of the managed servers (On, Off....). The [Redfish®](https://www.dmtf.org/standards/redfish) standard defines the [`PowerState`](https://redfish.dmtf.org/schemas/v1/ComputerSystem.v1_5_0.json)property with 0 (`Off`) and 1 (`On`) as possible values. However, when the system is in the `On` state, we'd like to know in which sub-state the server is: Pre-OS Tasks (POST), UEFI, OS...
23
+
Server management and monitoring often require the knowledge of the state of the managed servers (On, Off....). The [Redfish®](https://www.dmtf.org/standards/redfish) standard defines the <ahref="https://redfish.dmtf.org/schemas/v1/ComputerSystem.v1_5_0.json"target="_blank">PowerState</a> property `Off``On` as possible values. However, when the system is in the `On` state, you may want to know in which sub-state the server is: Pre-OS Tasks (POST), UEFI, OS. You may want to know if the storage controllers or network cards have been discovered properly.
24
24
25
-
This blog presents the [`PostState`](https://servermanagementportal.ext.hpe.com/docs/redfishservices/ilos/ilo6/ilo6_145/ilo6_computersystem_resourcedefns145/#oemhpepoststate)property available in an`Oem.Hpe` Redfish sub-tree of HPE servers (Gen9, Gen10 and Gen11)and providing a fine grained server state.
25
+
This blog presents the <ahref="https://servermanagementportal.ext.hpe.com/docs/redfishservices/ilos/ilo6/ilo6_156/ilo6_computersystem_resourcedefns156/#oemhpepoststate"target="_blank">PostState</a> property available in the`Oem.Hpe`extension of the `ComputerSystem`Redfish sub-tree of HPE servers (Gen9, Gen10 and Gen11). It presents as well the `DeviceDiscoveryComplete` <ahref="https://servermanagementportal.ext.hpe.com/docs/redfishservices/ilos/ilo6/ilo6_156/ilo6_computersystem_resourcedefns156/#oemhpedevicediscoverycomplete"target="_blank">property</a>, part of the same OEM extension and extremely important when you want to configure <ahref="https://developer.hpe.com/blog/overview-of-the-platform-level-data-model-for-redfish%C2%AE-device-enablement-standard/"target="_blank">PLDM for RDE</a> devices.
26
26
27
27
## HPE PostState
28
28
29
29
As mentioned in the [HPE iLO 4](https://hewlettpackard.github.io/ilo-rest-api-docs/ilo4/#poststate) API Reference documents, the `PostState` property can have the following values: `Null`, `Unknown`, `Reset`, `PowerOff`, `InPost`, `InPostDiscoveryComplete` and `FinishedPost`.
30
30
31
-
[Following HPE iLO generations ](https://servermanagementportal.ext.hpe.com/docs/redfishservices/ilos/ilo6/ilo6_145/ilo6_computersystem_resourcedefns145/#oemhpepoststate) have one more value: `InPostDiscoveryStart`.
31
+
<ahref="https://servermanagementportal.ext.hpe.com/docs/redfishservices/ilos/ilo6/ilo6_156/ilo6_computersystem_resourcedefns156/#oemhpepoststate"target="_blank">Following HPE iLO generations</a> have one more value: `InPostDiscoveryStart`.
32
32
33
-
Since the first four values have a straight forward meaning, we will only focus on the other ones.
33
+
Since the first four values have a straight forward meaning, I'll focus only focus on the other ones.
34
34
35
35
The `InPost` value means that the server is still performing the Pre-OS Tasks (tests and hardware discovery). With a graphical console opened, when a server is in this state you can see a green progress bar:
36
36
37
37

38
38
39
39

40
40
41
-
`InPostDiscoveryStart` follows the `InPost` state and then, `InPostDiscoveryComplete`. For the purpose of this blog, we assume that it corresponds to the state in which UEFI is loaded and running:
41
+
`InPostDiscoveryStart` follows the `InPost` state and then, `InPostDiscoveryComplete`. For the purpose of this blog, I'll assume that it corresponds to the state in which UEFI is loaded and running:
Note that when an UEFI executable is running (i.e. UEFI Shell, `grubx64.efi`...) the server stays in the `InPostDiscoveryComplete` state.
46
46
47
47
The last possible value for the `PostState` key is `FinishedPost`. In this state, the server is either booting an installed OS or has completely finished its boot process.
48
48
49
-
## `PostState` use cases
49
+
## PostState use cases
50
50
51
51
The first obvious use case for probing the `PostState` of a server or a set of servers is in a monitoring application. Combined with the health status of the different components of the server, you will be able to draw dashboards or create reports.
52
52
53
53
In a server management and configuration context, several properties can only be modified when the server is in a particular state. For example, the boot order can only be modified in the `Off` or in the `FinishedPost` states (OS booted).
54
54
55
-
In the following screenshot we use [ilorest](http://hpe.com/info/resttool) to change the next boot entry of a server being in the `InPostDiscoveryComplete` state. In this case, the iLO returns a `[400]` error code with an explicit message.
55
+
In the following screenshot I used <ahref="https://github.com/HewlettPackard/python-redfish-utility/releases/latest"target="_blank">iLOrest</a> to change the next boot entry of a server being in the `InPostDiscoveryComplete` state. In this case, the iLO returns a `[400]` error code with an explicit message.
56
56
57
57

58
58
@@ -64,15 +64,15 @@ Hence, as a best practice, it is wise to pool the managed nodes and check for po
64
64
65
65
## How do I retrieve the Server State
66
66
67
-
The easiest way to obtain the `PostState` of a server is to issue the `serverstate` macro command of the [iLOrest](http://hpe.com/info/resttool)utility. ILOrest automatically detects the generation of the server (Gen9, Gen10...) and fetches the `PostState` value from the right Redfish path.
67
+
The easiest way to obtain the `PostState` of a server is to issue the `serverstate` macro command of the <ahref="https://servermanagementportal.ext.hpe.com/docs/redfishclients/ilorest-userguide/ilocommands/#serverstate-command"target="_blank">iLOrest</a> utility. ILOrest automatically detects the generation of the server (Gen9, Gen10...) and fetches the `PostState` value from the right Redfish URI.
68
68
69
-
The [Open Source](https://github.com/HewlettPackard/python-redfish-utility)version of iLOrest contains the source of this [`ServerState` macro command](https://github.com/HewlettPackard/python-redfish-utility/blob/master/src/extensions/iLO_COMMANDS/ServerStateCommand.py)in python. Feel free to consult it.
69
+
The <ahref="https://github.com/HewlettPackard/python-redfish-utility"target="_blank">Open Source</a> version of iLOrest contains the source of this <ahref="https://github.com/HewlettPackard/python-redfish-utility/blob/master/src/extensions/iLO_COMMANDS/ServerStateCommand.py"target="_blank">ServerState</a> macro command in Python. Feel free to consult it.
70
70
71
-

71
+

72
72
73
-
If you decide to create your own Redfish client, you will have to adapt your code to the potential Redfish [data model changes](https://servermanagementportal.ext.hpe.com/docs/redfishservices/ilos/ilo5/ilo5_adaptation/#ilo-5-data-model-changes) between the different generations of servers or iLOs.
73
+
If you decide to create your own Redfish client, you will have to adapt your code to the potential Redfish <ahref="https://servermanagementportal.ext.hpe.com/docs/redfishservices/ilos/ilo5/ilo5_adaptation/#ilo-5-data-model-changes"target="_blank">data model changes</a> between the different generations of servers or iLOs.
74
74
75
-
As a concrete example, in an HPE rack mount server the `PostState` property has moved from `/redfish/v1/Systems/1/oem/hp` in Gen9 models to `/redfish/v1/Systems/1/oem/hpe` in Gen10s and Gen11s.
75
+
As a concrete example, in an HPE rack mount server the `PostState` property has moved from `/redfish/v1/Systems/1/Oem/Hp` in Gen9 models to `/redfish/v1/Systems/1/Oem/Hpe` in Gen10s and Gen11s.
76
76
77
77
## The HPE Agentless Management Service is your friend
78
78
@@ -82,9 +82,9 @@ What if the system is stuck in the boot process and never reaches the target lev
82
82
83
83
There are multiples ways to solve this problem, including the use of `ping`, `ssh` or SNMP queries to the host OS. However, this is not always possible or desired.
84
84
85
-
An alternative is using the [HPE Agentless Management Service (AMS)](https://www.hpe.com/us/en/product-catalog/detail/pip.5219980.html) combined to Redfish.
85
+
An alternative is using the <ahref="https://www.hpe.com/us/en/product-catalog/detail/pip.5219980.html"target="_blank">HPE Agentless Management Service</a> (AMS) combined to Redfish.
86
86
87
-
The AMS is a very high level service running in a bare-metal Operating System and communicating with the iLO through an internal path (CHIF driver over PCIe bus). Among other things, it communicates the OS hostname to the iLO which stores it in the `HostName` property of the `/redfish/v1/Systems/{item}` sub-tree.
87
+
The AMS is a very high level service running in a bare-metal Operating System and communicating with the iLO through an internal path (<ahref="https://developer.hpe.com/blog/chif-driver-not-found/"target="_blank">CHIF driver</a> over PCIe bus). Among other things, it communicates the OS hostname to the iLO which stores it in the `HostName` property of the `/redfish/v1/Systems/{item}` sub-tree.
88
88
89
89
By setting this resource to a null or known string when the server is `Off`, and then by polling it regularly during the boot process you can detect its change and conclude with a small risk of error that the OS is running fine.
90
90
@@ -94,7 +94,7 @@ Note that this resource can only be modified when the system is `Off` or in `Fin
94
94
95
95
In summary, the deployment process of a bare-metal server could be written as:
96
96
97
-
```cwl
97
+
```shell
98
98
Set server in`Off` state
99
99
set`HostName` to a null or a well-known string different from the final OS hostname
100
100
Configure other needed parameters including OS deployment bootstraps
@@ -107,11 +107,11 @@ done
107
107
108
108
**Restriction**: The configuration of the `HostName` property using Redfish on **Gen9** servers is possible with firmware 2.60 or later.
109
109
110
-
## The `DeviceDiscoveryComplete` collection
110
+
## The DeviceDiscoveryComplete collection
111
111
112
-
In addition to the `PowerState` and `PostState` properties, the `DeviceDiscoveryComplete` collection returns the discovery state of the AMS, SmartArrays (if any) and a third generic state for all other devices.
112
+
In addition to the `PowerState` and `PostState` properties, the <ahref="https://servermanagementportal.ext.hpe.com/docs/redfishservices/ilos/ilo6/ilo6_156/ilo6_computersystem_resourcedefns156/#oemhpedevicediscoverycomplete"target="_blank">DeviceDiscoveryComplete{} collection</a> returns the states of the AMS, SmartArrays (if any) and a third generic discovery state for all devices.
113
113
114
-
It may happen during startup that a system returns `InPostDiscoveryComplete` while not all of its devices have been discovered.
114
+
It may happen during startup that a system returns `InPostDiscoveryComplete` while not all of its devices have been discovered, like <ahref="https://developer.hpe.com/blog/overview-of-the-platform-level-data-model-for-redfish%C2%AE-device-enablement-standard/"target="_blank">PLDM for RDE</a> capable devices.
115
115
116
116
The following script polls every other second the `PostState` and the `DeviceDiscoveryComplete` properties:
117
117
@@ -130,7 +130,7 @@ while [ 1 ] ; do
130
130
done
131
131
```
132
132
133
-
The following picture shows three iterations of the the script during the start of a server. In iteration 55 the server is `InPost` while the SmartArray is in a `Cached` state meaning that it will answer queries with cached data.
133
+
The following picture shows three iterations of the above script during the start of a server. In iteration 55 the server is `InPost` while the SmartArray is in a `Cached` state meaning that it will answer queries with cached data.
134
134
135
135
Two seconds later the next iteration returns the `InPostDiscoveryComplete` state and shows the SmartArray in `Busy` mode which means that it will return an error if queried during this state.
136
136
@@ -142,6 +142,6 @@ In iteration 62 we are still in `InPostDiscoveryComplete` but both `DeviceDiscov
142
142
143
143
Combining the `PowerState` Redfish property with specific HPE features like the `PostState`, `DeviceDiscoveryComplete` and the Agentless Management Service, you will be able to increase the efficiency of your monitoring and management applications.
144
144
145
-
HPE provides as well a rich Redfish ecosystem including the free [`ilorest` tool](https://hpe.com/info/resttool), its [Open Source](https://github.com/HewlettPackard/python-redfish-utility)version and a [Python library](https://github.com/HewlettPackard/python-ilorest-library). PowerShell developers have the possibility to use a set of specific Redfish [Cmdlets](https://www.powershellgallery.com/packages/HPRESTCmdlets/)required to run the [GitHub ProLiant SDK](https://github.com/HewlettPackard/PowerShell-ProLiant-SDK).
145
+
HPE provides as well a rich Redfish ecosystem including the free <ahref="https://github.com/HewlettPackard/python-redfish-utility/releases/latest"target="_blank">iLOrest tool</a>, its <ahref="https://github.com/HewlettPackard/python-redfish-utility"target="_blank">Open Source</a> version and a <ahref="https://github.com/HewlettPackard/python-ilorest-library"target="_blank">Python library</a>. PowerShell developers have the possibility to use a set of specific Redfish <ahref="https://www.powershellgallery.com/packages/HPRESTCmdlets/"target="_blank">Cmdlets</a> required to run the <ahref="https://github.com/HewlettPackard/PowerShell-ProLiant-SDK"target="_blank">GitHub ProLiant SDK</a>.
146
146
147
-
In addition to the above, technical [Redfish videos](https://www.youtube.com/channel/UCIZhrIYcNh3wHLiY4ola5ew/search?query=redfish) can help you learning more on this new way for managing servers.
147
+
Don't forget to check out some of my other <ahref="https://developer.hpe.com/search/?term=donze"target="_blank">blog posts</a> on the HPE Developer portal to learn more about Redfish tips and tricks.
0 commit comments