Skip to content

Commit 1852b5c

Browse files
committed
Update Blog “master-the-redfish-server-states-to-improve-your-monitoring-and-manageme”
1 parent f2dd8f7 commit 1852b5c

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

content/blog/master-the-redfish-server-states-to-improve-your-monitoring-and-manageme.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,43 +16,43 @@ tags:
1616
- ProLiant
1717
- Synergy
1818
---
19-
#### Updated July 25, 2023
19+
Updated February 26, 2024
2020

2121
## Introduction
2222

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 <a href="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.
2424

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 <a href="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` <a href="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 <a href="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.
2626

2727
## HPE PostState
2828

2929
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`.
3030

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+
<a href="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`.
3232

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.
3434

3535
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:
3636

3737
![InPost state 1](https://redfish-lab.sourceforge.io/media/redfish-wiki/Master-the-Redfish-Server-States/1-InPost.png)
3838

3939
![InPost state 2](https://redfish-lab.sourceforge.io/media/redfish-wiki/Master-the-Redfish-Server-States/2-InPost.png)
4040

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:
4242

4343
![InPostDiscoveryComplete / UEFI](https://redfish-lab.sourceforge.io/media/redfish-wiki/Master-the-Redfish-Server-States/3-InPostDiscoveryComplete.png)
4444

4545
Note that when an UEFI executable is running (i.e. UEFI Shell, `grubx64.efi`...) the server stays in the `InPostDiscoveryComplete` state.
4646

4747
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.
4848

49-
## `PostState` use cases
49+
## PostState use cases
5050

5151
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.
5252

5353
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).
5454

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 <a href="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.
5656

5757
![Boot Order cannot be changed when in POST](https://redfish-lab.sourceforge.io/media/redfish-wiki/Master-the-Redfish-Server-States/4-CannotChangeBootOrderWhenInPost.png)
5858

@@ -64,15 +64,15 @@ Hence, as a best practice, it is wise to pool the managed nodes and check for po
6464

6565
## How do I retrieve the Server State
6666

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 <a href="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.
6868

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 <a href="https://github.com/HewlettPackard/python-redfish-utility" target="_blank">Open Source</a> version of iLOrest contains the source of this <a href="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.
7070

71-
![Retrieve `PostState` with `ilorest`](https://redfish-lab.sourceforge.io/media/redfish-wiki/Master-the-Redfish-Server-States/5-RetrieveServerStateWithIlorest.png)
71+
![Retrieve `PostState` with iLOrest](https://redfish-lab.sourceforge.io/media/redfish-wiki/Master-the-Redfish-Server-States/5-RetrieveServerStateWithIlorest.png)
7272

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 <a href="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.
7474

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.
7676

7777
## The HPE Agentless Management Service is your friend
7878

@@ -82,9 +82,9 @@ What if the system is stuck in the boot process and never reaches the target lev
8282

8383
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.
8484

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 <a href="https://www.hpe.com/us/en/product-catalog/detail/pip.5219980.html" target="_blank">HPE Agentless Management Service</a> (AMS) combined to Redfish.
8686

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 (<a href="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.
8888

8989
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.
9090

@@ -94,7 +94,7 @@ Note that this resource can only be modified when the system is `Off` or in `Fin
9494

9595
In summary, the deployment process of a bare-metal server could be written as:
9696

97-
```cwl
97+
```shell
9898
Set server in `Off` state
9999
set `HostName` to a null or a well-known string different from the final OS hostname
100100
Configure other needed parameters including OS deployment bootstraps
@@ -107,11 +107,11 @@ done
107107

108108
**Restriction**: The configuration of the `HostName` property using Redfish on **Gen9** servers is possible with firmware 2.60 or later.
109109

110-
## The `DeviceDiscoveryComplete` collection
110+
## The DeviceDiscoveryComplete collection
111111

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 <a href="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.
113113

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 <a href="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.
115115

116116
The following script polls every other second the `PostState` and the `DeviceDiscoveryComplete` properties:
117117

@@ -130,7 +130,7 @@ while [ 1 ] ; do
130130
done
131131
```
132132

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.
134134

135135
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.
136136

@@ -142,6 +142,6 @@ In iteration 62 we are still in `InPostDiscoveryComplete` but both `DeviceDiscov
142142

143143
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.
144144

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 <a href="https://github.com/HewlettPackard/python-redfish-utility/releases/latest" target="_blank">iLOrest tool</a>, its <a href="https://github.com/HewlettPackard/python-redfish-utility" target="_blank">Open Source</a> version and a <a href="https://github.com/HewlettPackard/python-ilorest-library" target="_blank">Python library</a>. PowerShell developers have the possibility to use a set of specific Redfish <a href="https://www.powershellgallery.com/packages/HPRESTCmdlets/" target="_blank">Cmdlets</a> required to run the <a href="https://github.com/HewlettPackard/PowerShell-ProLiant-SDK" target="_blank">GitHub ProLiant SDK</a>.
146146

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 <a href="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

Comments
 (0)