Skip to content

Commit f9bc36e

Browse files
authored
Merge pull request #53180 from amolnar-rh/TELCODOCS-642
TELCODOCS-642: Factory precaching tool
2 parents 30dc46d + d055d32 commit f9bc36e

File tree

9 files changed

+883
-0
lines changed

9 files changed

+883
-0
lines changed

_attributes/common-attributes.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,5 @@ endif::[]
153153
//Formerly known as CodeReady Containers and CodeReady Workspaces
154154
:openshift-local-productname: Red Hat OpenShift Local
155155
:openshift-dev-spaces-productname: Red Hat OpenShift Dev Spaces
156+
:factory-prestaging-tool: factory-precaching-cli tool
157+
:factory-prestaging-tool-caps: Factory-precaching-cli tool

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2458,6 +2458,8 @@ Topics:
24582458
File: ztp-updating-gitops
24592459
- Name: Adding worker nodes to single-node OpenShift cluster
24602460
File: ztp-sno-additional-worker-node
2461+
- Name: Pre-caching images for single-node OpenShift deployments
2462+
File: ztp-precaching-tool
24612463
---
24622464
Name: Specialized hardware and driver enablement
24632465
Dir: hardware_enablement

installing/installing_sno/install-sno-installing-sno.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,5 @@ include::modules/install-sno-monitoring-the-installation-manually.adoc[leveloffs
4949
include::modules/install-sno-installing-with-usb-media.adoc[leveloffset=+1]
5050

5151
include::modules/install-booting-from-an-iso-over-http-redfish.adoc[leveloffset=+1]
52+
53+
include::modules/creating-custom-live-rhcos-iso.adoc[leveloffset=+1]
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * installing/installing_sno/install-sno-installing-sno.adoc
4+
5+
:_module-type: PROCEDURE
6+
[id="create-custom-live-rhcos-iso_{context}"]
7+
= Creating a custom live {op-system} ISO for remote server access
8+
9+
In some cases, you cannot attach an external disk drive to a server, however, you need to access the server remotely to provision a node.
10+
It is recommended to enable SSH access to the server.
11+
You can create a live {op-system} ISO with SSHd enabled and with predefined credentials so that you can access the server after it boots.
12+
13+
.Prerequisites
14+
15+
* You installed the `butane` utility.
16+
17+
.Procedure
18+
19+
. Download the `coreos-installer` binary from the `coreos-installer` image link:https://mirror.openshift.com/pub/openshift-v4/clients/coreos-installer/latest/[mirror] page.
20+
21+
. Download the latest live {op-system} ISO from link:https://mirror.openshift.com/pub/openshift-v4/x86_64/dependencies/rhcos/latest/rhcos-live.x86_64.iso[mirror.openshift.com].
22+
23+
. Create the `embedded.yaml` file that the `butane` utility uses to create the Ignition file:
24+
+
25+
[source,yaml]
26+
----
27+
variant: rhcos
28+
version: 0.1.0
29+
passwd:
30+
users:
31+
- name: root
32+
ssh_authorized_keys:
33+
- '<ssh_key>'
34+
password_hash: '$2b$05$aAd9TkvWnvUmeDQEA9vkiOoCqCZgd6cWn0xXwe.ii/TqeCxUC0Z0G' <1>
35+
storage:
36+
files:
37+
- path: /etc/ssh/sshd_config
38+
contents:
39+
local: ./live-sshd_config
40+
mode: 0600
41+
overwrite: true
42+
----
43+
<1> `yescrypt` passwords are not supported in {op-system}. Use `bcrypt` instead when you create the `password_hash`.
44+
45+
. Create the `files-dir/` folder and copy the default `sshd_config` file into the folder.
46+
47+
. Update the following fields in the `files-dir/sshd_config` file:
48+
+
49+
[source,bash]
50+
----
51+
[...]
52+
PermitRootLogin yes <1>
53+
[...]
54+
PasswordAuthentication yes <2>
55+
----
56+
<1> Allows access to the server as a root user.
57+
<2> Allows access to the server by using a password.
58+
59+
+
60+
[IMPORTANT]
61+
====
62+
The modified `sshd_config` file overrides the default `sshd_config` file.
63+
====
64+
65+
. Pass the YAML file and the folder to the `butane` utility:
66+
+
67+
[source,terminal]
68+
----
69+
$ butane -p embedded.yaml -d files-dir/ > embedded.ign
70+
----
71+
72+
. Once the Ignition file is created, you can include the configuration in a new live {op-system} ISO, which is named `rhcos-sshd-4.11.0-x86_64-live.x86_64.iso`, with the `coreos-installer` utility:
73+
+
74+
[source,terminal]
75+
----
76+
$ coreos-installer iso ignition embed -i embedded.ign rhcos-4.11.0-x86_64-live.x86_64.iso -o rhcos-sshd-4.11.0-x86_64-live.x86_64.iso
77+
----
78+
79+
.Verification
80+
81+
. Check that the custom live ISO can be used to boot the server by running the following command:
82+
+
83+
[source,terminal]
84+
----
85+
# coreos-installer iso ignition show rhcos-sshd-4.11.0-x86_64-live.x86_64.iso
86+
----
87+
88+
+
89+
.Example output
90+
[source,json]
91+
----
92+
{
93+
"ignition": {
94+
"version": "3.2.0"
95+
},
96+
"passwd": {
97+
"users": [
98+
{
99+
"name": "root",
100+
"passwordHash": "$2b$05$aAd9TkvWnvUmeDQEA9vkiOoCqCZgd6cWn0xXwe.ii/TqeCxUC0Z0G",
101+
"sshAuthorizedKeys": [
102+
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCZnG8AIzlDAhpyENpK2qKiTT8EbRWOrz7NXjRzopbPu215mocaJgjjwJjh1cYhgPhpAp6M/ttTk7I4OI7g4588Apx4bwJep6oWTU35LkY8ZxkGVPAJL8kVlTdKQviDv3XX12l4QfnDom4tm4gVbRH0gNT1wzhnLP+LKYm2Ohr9D7p9NBnAdro6k++XWgkDeijLRUTwdEyWunIdW1f8G0Mg8Y1Xzr13BUo3+8aey7HLKJMDtobkz/C8ESYA/f7HJc5FxF0XbapWWovSSDJrr9OmlL9f4TfE+cQk3s+eoKiz2bgNPRgEEwihVbGsCN4grA+RzLCAOpec+2dTJrQvFqsD [email protected]"
103+
]
104+
}
105+
]
106+
},
107+
"storage": {
108+
"files": [
109+
{
110+
"overwrite": true,
111+
"path": "/etc/ssh/sshd_config",
112+
"contents": {
113+
"compression": "gzip",
114+
"source": "data:;base64,H4sIAAAAAAAC/4RXX2/bOBJ/16eYWy2QFoj/pdtDN8A9qI6SGLEdw3b22qeAlsY21xQpkJQd3cN99sUMZcUuvFsXbUXO8Mf5P8MYwu/X5xL118XdL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OxaVoBjFE2PshZXkBxcF3lTvYZxMH2A8fB0uv89S+pi+TNL5aEify9GEt4bP43Gy5M/J8zRdJvPv/J0uFslDujhFG77Oklk6Z6AknE7u7ubpYsGA6TidPT5PA1SaLF7m6SSdLs8RRnfpdDm6Hw2T5eh5yhDjMQv6kjykJ7zfJs93o/tROl+Q/u0r8GgssybTuWoVXhouWhw/mye/W/uS/g+PY7nCN8x6pkTN49Tal51m4o9iSN9EUSok0OYifsOEkujCE7JE26EOBCvhJI/MPtsCD3hCG53tqZKG33n+8pAUfhcKwAn1PXNPNu+NzfA4aWZ7d3yn/BUAAP//SwsNmNoQAAA="
115+
},
116+
"mode": 384
117+
}
118+
]
119+
}
120+
}
121+
----
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * scalability_and_performance/ztp_far_edge/ztp-pre-caching-tool.adoc
4+
5+
:_module-type: PROCEDURE
6+
[id="ztp-booting-from-live-os_{context}"]
7+
= Booting from a live operating system image
8+
9+
You can use the {factory-prestaging-tool} with to boot servers where only one disk is available and external disk drive cannot be attached to the server.
10+
11+
[WARNING]
12+
====
13+
{op-system} requires the disk to not be in use when the disk is about to be written with an {op-system} image.
14+
====
15+
16+
Depending on the server hardware, you can mount the {op-system} live ISO on the blank server using one of the following methods:
17+
18+
* Using the Dell RACADM tool on a Dell server.
19+
* Using the HPONCFG tool on a HP server.
20+
* Using the Redfish BMC API.
21+
22+
[NOTE]
23+
====
24+
It is recommended to automate the mounting procedure. To automate the procedure, you need to pull the required images and host them on a local HTTP server.
25+
====
26+
27+
.Prerequisites
28+
29+
* You powered up the host.
30+
* You have network connectivity to the host.
31+
32+
.Procedure
33+
34+
[NOTE]
35+
====
36+
This example procedure uses the Redfish BMC API to mount the {op-system} live ISO.
37+
====
38+
39+
. Mount the {op-system} live ISO:
40+
41+
.. Check virtual media status:
42+
+
43+
[source,terminal]
44+
----
45+
$ curl --globoff -H "Content-Type: application/json" -H \
46+
"Accept: application/json" -k -X GET --user ${username_password} \
47+
https://$BMC_ADDRESS/redfish/v1/Managers/Self/VirtualMedia/1 | python -m json.tool
48+
----
49+
50+
.. Mount the ISO file as a virtual media:
51+
+
52+
[source,terminal]
53+
----
54+
$ curl --globoff -L -w "%{http_code} %{url_effective}\\n" -ku ${username_password} -H "Content-Type: application/json" -H "Accept: application/json" -d '{"Image": "http://[$HTTPd_IP]/RHCOS-live.iso"}' -X POST https://$BMC_ADDRESS/redfish/v1/Managers/Self/VirtualMedia/1/Actions/VirtualMedia.InsertMedia
55+
----
56+
57+
.. Set the boot order to boot from the virtual media once:
58+
+
59+
[source,terminal]
60+
----
61+
$ curl --globoff -L -w "%{http_code} %{url_effective}\\n" -ku ${username_password} -H "Content-Type: application/json" -H "Accept: application/json" -d '{"Boot":{ "BootSourceOverrideEnabled": "Once", "BootSourceOverrideTarget": "Cd", "BootSourceOverrideMode": "UEFI"}}' -X PATCH https://$BMC_ADDRESS/redfish/v1/Systems/Self
62+
----
63+
64+
. Reboot and ensure that the server is booting from virtual media.

0 commit comments

Comments
 (0)