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
In a [previous blog](/blog/how-to-change-the-factory-generated-ilo-administrator-password), I explained how the RESTful interface tool ([iLOREST](http://www.hpe.com/info/resttool)) (former `hprest`) is able to communicate securely with the underlying iLO and perform in band management of the lower layers of the server. This blog provides a method to create a custom bootable LiveCD that embeds the `ilorest` utility and potentially other management tools.
16
+
Updated March 4 2024
17
+
18
+
In a <ahref="https://developer.hpe.com/blog/in-band-management-with-ilorest-and-a-livecd"target="_blank">previous blog</a>, I explained how the HPE RESTful interface tool (<ahref="https://github.com/HewlettPackard/python-redfish-utility/releases/latest"target="_blank">iLOREST</a>) is able to communicate securely with the underlying iLO and perform in band management of the lower layers of the server. This blog post provides a method to create a custom bootable LiveCD that embeds the HPE ilorest utility and potentially other management tools.
14
19
15
20
After booting the server on the LiveCD, it is possible, locally or from a remote location, to perform in-band management operations.
16
21
17
-
Although the solution presented here is based on Red Hat / CentOS distributions, it can be adapted to other Linux distributions as well as to Windows since the support of `ilorest` in WinPE exists since `hprest` version 1.5 (at that time this utilitiy was still called `hprest`).
22
+
Although the solution presented here is based on Red Hat / CentOS distributions, it can be adapted to other Linux distributions as well as to Windows since the support of iLOrest in WinPE exists since `hprest` version 1.5 (at that time this utility was still called `hprest`).
18
23
19
24
## High level solution description
20
25
21
26
The Red Hat / CentOS ecosystem provides the `livecd-tools` package for an easy generation of customized bootable media. It contains the `livecd-creator` utility for the creation of bootable ISO using a classical kickstart configuration file.
22
27
23
28
The basic steps for embedding `ilorest` in a customized bootable LiveCD are:
24
29
25
-
1. Setup of a RHEL / CentOS Media Server configured with the `livecd-tools` and the `createrepo` packages. The custom repository containing `ilorest` (see next step) will also be hosted on this Media Server
26
-
2. Creation of a custom repository on the Media Server holding the `ilorest` package (and potentially other packages).
30
+
1. Setup of a RHEL / CentOS Media Server configured with the `livecd-tools` and the `createrepo` packages. The custom repository containing iLOrest (see next step) will also be hosted on this Media Server
31
+
2. Creation of a custom repository on the Media Server holding the iLOrest package (and potentially other packages).
27
32
3. Customization of the LiveCD configuration file.
28
33
4. Creation of the ISO bootable image.
29
34
30
35
Once the LiveCD ISO file is created we will describe how to use it:
36
+
31
37
1. Presentation of the LiveCD to a managed server as an iLO Virtual Drive.
32
38
2. Boot of the managed server on the LiveCD ISO image.
33
-
3. Submission of `ilorest` in band management commands to the managed server using `ssh`
39
+
3. Submission of iLOrest in band management commands to the managed server using SSH.
34
40
35
41
## Media Server setup
36
42
37
43
The following instructions suppose you are logged in as root in a CentOS or RHEL 7 server with an Internet connection or with the ability to retrieve all required packages mentioned below.
38
44
39
45
The first step in the above list is not fully described in this article; I assume that [Apache](https://httpd.apache.org/download.cgi) or another Web server application is installed and configured to provide Linux YUM repositories to other servers on your network.
40
46
41
-
You can obtain the `livecd-tools` package from the [Extra Packages for Enterprise Linux 7](http://fedoraproject.org/wiki/EPEL) (EPEL) repository.
47
+
You can obtain the `livecd-tools` package from the <ahref="http://fedoraproject.org/wiki/EPEL"target="_blank">Extra Packages for Enterprise Linux 7</a> (EPEL) repository.
If not already done, download the [latest RESTful Interface Tool package](http://h20565.www2.hpe.com/hpsc/swd/public/readIndex?sp4ts.oid=7630409&ac.admitted=1415623837684.876444892.492883150&lang=en&lang=en&cc=us&cc=us) and store it on your Media Server in a location accessible from the network:
90
+
If not already done, download the <ahref="https://github.com/HewlettPackard/python-redfish-utility/releases/latest"target="_blank">latest RESTful Interface Tool package</a> and store it on your Media Server in a location accessible from the network:
85
91
86
92
~~~
87
93
MediaServer# ls myrepo
88
94
ilorest-2.1-73.x86_64.rpm
89
95
~~~
90
96
91
-
Create your custom `ilorest` repository with `createrepo(8`)and verify that a `repodata` directory has been created along with the `ilorest` package. The `createrepo` utility is present by default on RHEL / CentOS, so you should not have to install it:
97
+
Create your custom iLOrest repository with `createrepo(8`)and verify that a `repodata` directory has been created along with the iLOrest package. The `createrepo` utility is present by default on RHEL / CentOS, so you should not have to install it:
92
98
93
99
~~~
94
100
MediaServer# createrepo myrepo
@@ -97,7 +103,7 @@ MediaServer# ls myrepo
97
103
ilorest-2.1-73.x86_64.rpm repodata
98
104
~~~
99
105
100
-
Ultimately, you should verify that this repository can be accessed by other servers on your network. A simple local test could be to retrieve the `repomd.xm`l file using `wget` or `curl`:
106
+
Ultimately, you should verify that this repository can be accessed by other servers on your network. A simple local test could be to retrieve the `repomd.xm` file using `wget` or `curl`:
101
107
102
108
103
109
~~~
@@ -114,9 +120,9 @@ It is now time to edit and customize the RHEL/CentOS LiveCD configuration file.
114
120
115
121
· Start service `sshd`
116
122
117
-
· Add the `ilorest` repository
123
+
· Add the iLOrest repository
118
124
119
-
· Add the `ilorest` package
125
+
· Add the iLOrest package
120
126
121
127
· Modify the `sshd` config file to allow root’s SSH connections with a null password because the LiveCD post configuration script deletes the root password string (`passwd -d root`).
122
128
@@ -163,28 +169,29 @@ The last step is to generate the LivCD ISO bootable file:
163
169
Host# livecd-creator --config centos-7-livecd.cfg
164
170
~~~
165
171
166
-
The above command generates a bootable `livecd-centos-7-livecd-<timestamp>.iso` image containing an OS and the required packages including `ilorest`.
172
+
The above command generates a bootable `livecd-centos-7-livecd-<timestamp>.iso` image containing an OS and the required packages including iLOrest.
173
+
167
174
## Presenting the LiveCD to a server
168
175
169
176
To boot the server on this image, we just need to present it as an iLO Virtual Drive and make sure it boots automatically during next reboot. The iLO Web Graphical User Interface can help to perform those tasks in an interactive manner.
170
177
171
-
However, for didactic reasons, we will use the ilorest interface tool in an Out-Of-Band manner from the Media Server. This tool provides atomic and macro commands for reading and setting parameters in the iLO, the BIOS or other subsystems
178
+
However, for didactic reasons, we will use the iLOrest interface tool in an Out-Of-Band manner from the Media Server. This tool provides atomic and macro commands for reading and setting parameters in the iLO, the BIOS or other subsystems
172
179
173
-
Moreover, it respects the good practices rules described in the *Getting Started with the iLO X Redfish API – A primer for coders* articles ([iLO 4](https://sourceforge.net/p/redfish-lab/wiki/Getting-started-with-the-iLO4-Redfish-API/), [iLO 5](https://sourceforge.net/p/redfish-lab/wiki/Getting-started-with-the-iLO5-Redfish-API/)]: It does not assume that REST objects are at a specific location, but smartly crawls the entire mesh of REST types and subtypes.
180
+
Moreover, it respects the good practices rules described in the *Getting Started with the iLO X Redfish API – A primer for coders* articles ([iLO 4](https://sourceforge.net/p/redfish-lab/wiki/Getting-started-with-the-iLO4-Redfish-API/), [iLO 5](https://sourceforge.net/p/redfish-lab/wiki/Getting-started-with-the-iLO5-Redfish-API/)]: It does not assume that REST objects are at a specific location, but smartly crawls the entire mesh of REST types and sub-types.
174
181
175
-
Fortunately, `ilorest` provides a buildin macro command described in its [online documentation](https://hewlettpackard.github.io/python-redfish-utility/#virtualmedia-command).
182
+
Fortunately, iLOrest provides a builtin macro command described in its <ahref="https://servermanagementportal.ext.hpe.com/docs/redfishclients/ilorest-userguide/ilocommands/#virtualmedia-command"target="_blank">online documentation</a>.
176
183
177
184
To present the LiveCD to the managed server, the following basics steps will be performed from the Media Server:
178
185
179
-
1.Open an `ilorest` session with the managed iLO.
186
+
1.Open an iLOrest session with the managed iLO.
180
187
181
188
2.Retrieve the ID number of the CD/DvD media type (usually 2):
182
189
183
-
3.Present the LiveCD as a Virtual CD/DVD using the buildin `virtualmedia` command with the `--bootnextreset` option to trigger the next reboot on this Virtual Drive.
190
+
3.Present the LiveCD as a Virtual CD/DVD using the builtin `virtualmedia` command with the `--bootnextreset` option to trigger the next reboot on this Virtual Drive.
184
191
185
192
3.Close the session
186
193
187
-
Opening an Out-of-Band management session with `ilorest` is very straightforward. You just need to supply the IP address of the managed iLO and the privileged credentials:
194
+
Opening an Out-of-Band management session with iLOrest is very straightforward. You just need to supply the IP address of the managed iLO and the privileged credentials:
Once the managed server is powered on, it boots on the LiveCD and can be accessed via SSH, as root without supplying any password. This gives us the possibility to send `ilorest` in-band management commands to the managed server:
222
+
Once the managed server is powered on, it boots on the LiveCD and can be accessed via SSH, as root without supplying any password. This gives us the possibility to send iLOrest in-band management commands to the managed server:
216
223
217
224
~~~
218
225
MediaServer# ssh root@livecd ilorest login
@@ -225,4 +232,6 @@ The above commands can be includes in a shell script file to perform specific ac
225
232
226
233
## Conclusion
227
234
228
-
We’ve learned how to create a Linux (RHEL / CentOS) LiveCD embedding the RESTful interface tool (`ilorest`) and enabling in band management of a single managed server. In case you have more than one server to manage, it is also possible to use this solution and to configure all of them the exact same way at once. In this case you would use a tool like the parallel distributed shell (`pdsh`) or the cluster shell (`clush`). Look forward to more blogs that will cover topics like `pdsh` or `clush`.
235
+
We’ve learned how to create a Linux (RHEL / CentOS) LiveCD embedding the iLOrest RESTful interface tool and enabling in band management of a single managed server. In case you have more than one server to manage, it is also possible to use this solution and to configure all of them the exact same way at once. In this case you would use a tool like the parallel distributed shell (`pdsh`) or the cluster shell (`clush`). Look forward to more blogs that will cover topics like `pdsh` or `clush`.
236
+
237
+
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