Skip to content

Commit 5f8eda9

Browse files
authored
Merge pull request #2372 from hpe-dev-incubator/cms/blog/in-band-management-with-ilorest-and-a-livecd
Update Blog “in-band-management-with-ilorest-and-a-livecd”
2 parents d596868 + 5e402bf commit 5f8eda9

File tree

1 file changed

+38
-29
lines changed

1 file changed

+38
-29
lines changed

content/blog/in-band-management-with-ilorest-and-a-livecd.md

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,50 @@
11
---
2-
title: "In-band management with ilorest and a LiveCD"
2+
title: In-band management with HPE iLOrest and a LiveCD
33
date: 2018-03-30T11:19:26.056Z
4-
author: François Donzé
5-
tags: ["iLO","ilorest","ProLiant"]
6-
authorimage: "/img/blogs/Avatar4.svg"
74
featuredBlog: false
8-
priority:
9-
thumbnailimage:
5+
priority: null
6+
author: François Donzé
7+
authorimage: /img/fdz-photoprofile.png
8+
thumbnailimage: null
9+
tags:
10+
- iLO
11+
- ilorest
12+
- ProLiant
1013
---
11-
# In-band management with `ilorest` and a LiveCD
14+
<style> li { font-size: 27px; line-height: 33px; max-width: none; } </style>
1215

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

1520
After booting the server on the LiveCD, it is possible, locally or from a remote location, to perform in-band management operations.
1621

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`).
1823

1924
## High level solution description
2025

2126
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.
2227

2328
The basic steps for embedding `ilorest` in a customized bootable LiveCD are:
2429

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).
2732
3. Customization of the LiveCD configuration file.
2833
4. Creation of the ISO bootable image.
2934

3035
Once the LiveCD ISO file is created we will describe how to use it:
36+
3137
1. Presentation of the LiveCD to a managed server as an iLO Virtual Drive.
3238
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.
3440

3541
## Media Server setup
3642

3743
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.
3844

3945
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.
4046

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 <a href="http://fedoraproject.org/wiki/EPEL" target="_blank">Extra Packages for Enterprise Linux 7</a> (EPEL) repository.
4248

4349
On a CentOS server issue:
4450

@@ -81,14 +87,14 @@ MediaServer# wget https://raw.githubusercontent.com/CentOS/sig-core-livemedia/ma
8187
We will customize this kickstart file later.
8288
## Create a package repository for `ilorest`
8389

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

8692
~~~
8793
MediaServer# ls myrepo
8894
ilorest-2.1-73.x86_64.rpm
8995
~~~
9096

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

9399
~~~
94100
MediaServer# createrepo myrepo
@@ -97,7 +103,7 @@ MediaServer# ls myrepo
97103
ilorest-2.1-73.x86_64.rpm repodata
98104
~~~
99105

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`:
101107

102108

103109
~~~
@@ -114,9 +120,9 @@ It is now time to edit and customize the RHEL/CentOS LiveCD configuration file.
114120

115121
· Start service `sshd`
116122

117-
· Add the `ilorest` repository
123+
· Add the iLOrest repository
118124

119-
· Add the `ilorest` package
125+
· Add the iLOrest package
120126

121127
· 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`).
122128

@@ -163,28 +169,29 @@ The last step is to generate the LivCD ISO bootable file:
163169
Host# livecd-creator --config centos-7-livecd.cfg
164170
~~~
165171

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+
167174
## Presenting the LiveCD to a server
168175

169176
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.
170177

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
172179

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

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 <a href="https://servermanagementportal.ext.hpe.com/docs/redfishclients/ilorest-userguide/ilocommands/#virtualmedia-command" target="_blank">online documentation</a>.
176183

177184
To present the LiveCD to the managed server, the following basics steps will be performed from the Media Server:
178185

179-
1. Open an `ilorest` session with the managed iLO.
186+
1. Open an iLOrest session with the managed iLO.
180187

181188
2. Retrieve the ID number of the CD/DvD media type (usually 2):
182189

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

185192
3. Close the session
186193

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

189196
~~~
190197
Host# ilorest login <iLO_IP> -u <username> -p <password>
@@ -202,17 +209,17 @@ We are now ready to present the virtual CD/DVD with:
202209
Host# ilorest virtualmedia $VID http://<MediaServerIP>/livecd-centos-7-livecd-<timestamp>.iso --bootnextreset
203210
~~~
204211

205-
Make sure you logout this `ilorest` session:
212+
Make sure you logout this iLOrest session:
206213

207214
~~~
208215
Host# ilorest logout
209216
~~~
210217

211218

212219

213-
## In-Band Management with `ilorest`
220+
## In-Band Management with iLOrest
214221

215-
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:
216223

217224
~~~
218225
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
225232

226233
## Conclusion
227234

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