Skip to content

Commit 272f8be

Browse files
committed
docs: minor changes and reorganized section 2.5.1
Signed-off-by: David Allen <davidallendj@gmail.com>
1 parent db37645 commit 272f8be

1 file changed

Lines changed: 91 additions & 43 deletions

File tree

content/docs/tutorial.md

Lines changed: 91 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ The cluster should now be able to be communicated with. Verify by checking the
11871187
status of one of the services:
11881188

11891189
```bash
1190-
curl https://demo.openchami.cluster:8443/boot-service/health
1190+
ochami boot service status
11911191
```
11921192

11931193
The output should be:
@@ -1243,7 +1243,7 @@ export DEMO_ACCESS_TOKEN=$(sudo podman exec tokensmith /bin/sh -c "/usr/local/bi
12431243
```
12441244

12451245
{{< callout context="tip" title="Tip" icon="outline/bulb" >}}
1246-
**Keep this command handy! Tokens expire after a short period of time.**
1246+
**Keep this command handy! Tokens expire after an hour.**
12471247

12481248
If the following output is observed:
12491249
```
@@ -2397,7 +2397,7 @@ To set boot parameters using the BSS backend, it's necessary to pass:
23972397

23982398
***OR:***
23992399

2400-
4. A file containing the boot parameter data (this method will be used here)
2400+
4. A file containing the boot parameter data in YAML or JSON (this method will be used here)
24012401

24022402
#### 2.5.1 Create the Boot Configuration
24032403

@@ -2407,10 +2407,36 @@ Create a directory for the boot configs:
24072407
sudo mkdir -p /etc/openchami/data/boot
24082408
```
24092409

2410-
Then, create the payload for boot-service,
2411-
**/etc/openchami/data/boot/compute-debug-rocky9.yaml**, that contains the
2410+
Then, create the payload file for boot-service,
2411+
either **/etc/openchami/data/boot/compute-debug-rocky9.yaml** or **/etc/openchami/boot/compute-debug-rocky9.json**, that contains the
24122412
URIs for the boot artifacts:
24132413

2414+
{{< tabs "Payload File" >}}
2415+
{{< tab "YAML" >}}
2416+
2417+
```bash
2418+
URIS=$(s3cmd ls -Hr s3://boot-images | grep compute/debug | awk '{print $4}' | sed 's-s3://-http://172.16.0.254:7070/-' | xargs)
2419+
URI_IMG=$(echo "$URIS" | cut -d' ' -f1)
2420+
URI_INITRAMFS=$(echo "$URIS" | cut -d' ' -f2)
2421+
URI_KERNEL=$(echo "$URIS" | cut -d' ' -f3)
2422+
cat << EOF | sudo tee /etc/openchami/data/boot/bss/compute-debug-rocky9.yaml
2423+
---
2424+
kernel: '${URI_KERNEL}'
2425+
initrd: '${URI_INITRAMFS}'
2426+
params: 'nomodeset ro root=live:${URI_IMG} ip=dhcp overlayroot=tmpfs overlayroot_cfgdisk=disabled apparmor=0 selinux=0 console=ttyS0,115200 ip6=off cloud-init=enabled ds=nocloud-net;s=http://172.16.0.254:8081/cloud-init'
2427+
macs:
2428+
- 52:54:00:be:ef:01
2429+
- 52:54:00:be:ef:02
2430+
- 52:54:00:be:ef:03
2431+
- 52:54:00:be:ef:04
2432+
- 52:54:00:be:ef:05
2433+
EOF
2434+
```
2435+
2436+
{{< /tab >}}
2437+
2438+
{{< tab "JSON" >}}
2439+
24142440
```bash
24152441
URIS=$(s3cmd ls -Hr s3://boot-images | grep compute/debug | awk '{print $4}' | sed 's-s3://-http://172.16.0.254:7070/-' | xargs)
24162442
URI_IMG=$(echo "$URIS" | cut -d' ' -f1)
@@ -2432,13 +2458,19 @@ cat << EOF | sudo tee /etc/openchami/data/boot/compute-debug-rocky9.json
24322458
EOF
24332459
```
24342460

2461+
{{< /tab >}}
2462+
{{< /tabs >}}
2463+
24352464
Examine the `tee` output to make sure that the URIs got populated properly. For example:
24362465

24372466
{{< callout context="caution" title="Warning" icon="outline/alert-triangle" >}}
24382467
The file will not look like the one below due to differences in kernel versions
24392468
over time. Be sure to update with the output of `s3cmd ls` as stated above!
24402469
{{< /callout >}}
24412470

2471+
{{< tabs "Output verification" >}}
2472+
{{< tab "JSON" >}}
2473+
24422474
```json
24432475
{
24442476
"macs": [
@@ -2452,81 +2484,97 @@ over time. Be sure to update with the output of `s3cmd ls` as stated above!
24522484
"kernel": "http://172.16.0.254:7070/boot-images/efi-images/compute/debug/vmlinuz-5.14.0-611.47.1.el9_7.x86_64",
24532485
"initrd": "http://172.16.0.254:7070/boot-images/efi-images/compute/debug/initramfs-5.14.0-611.47.1.el9_7.x86_64.img"
24542486
}
2487+
```
24552488

2489+
{{< /tab >}}
2490+
{{ tab "YAML" }}
2491+
2492+
```yaml
2493+
kernel: 'http://172.16.0.254:7070/boot-images/efi-images/compute/debug/vmlinuz-5.14.0-611.24.1.el9_7.x86_64'
2494+
initrd: 'http://172.16.0.254:7070/boot-images/efi-images/compute/debug/initramfs-5.14.0-611.24.1.el9_7.x86_64.img'
2495+
params: 'nomodeset ro root=live:http://172.16.0.254:7070/boot-images/compute/debug/rocky9.7-compute-debug-rocky9 ip=dhcp overlayroot=tmpfs overlayroot_cfgdisk=disabled apparmor=0 selinux=0 console=ttyS0,115200 ip6=off cloud-init=enabled ds=nocloud-net;s=http://172.16.0.254:8081/cloud-init'
2496+
macs:
2497+
- 52:54:00:be:ef:01
2498+
- 52:54:00:be:ef:02
2499+
- 52:54:00:be:ef:03
2500+
- 52:54:00:be:ef:04
2501+
- 52:54:00:be:ef:05
24562502
```
24572503

2458-
Now, we set the boot configuration using one of the backends below.
2504+
{{ /tab }}
2505+
{{< /tabs >}}
24592506

24602507
{{< callout context="note" title="Note" icon="outline/info-circle" >}}
24612508
`ochami` supports both `add` and `set`. The difference is idempotency. If
24622509
using the `add` command, `boot-service` will reject replacing an existing boot
24632510
configuration.
24642511
{{< /callout >}}
24652512

2513+
Now, we set the boot configuration using one of the backends below.
2514+
2515+
{{< tabs "Set Boot Config" >}}
2516+
2517+
{{< tab "Using YAML" >}}
2518+
2519+
If you created the payload file in YAML, you can only use `ochami` to set the
2520+
boot config since the `boot-service` CLI can only be set in JSON.
2521+
2522+
{{< callout context="note" title="Note" icon="outline/info-circle" > }}
2523+
24662524
Update the `ochami` config to set the `boot-service` URI. We will need set this
2467-
to make requests to `boot-service` through haproxy.
2525+
to make requests to `boot-service` through haproxy with `ochami`.
24682526

24692527
```bash
2470-
sudo ochami config --system cluster set demo boot-service.uri: /boot-service
2528+
sudo ochami config --system cluster set demo boot-service.uri /boot-service
24712529
```
24722530

2473-
Setting the boot configuration with the `boot-service` backend is a little
2474-
different than with the BSS backend. Instead of using the `ochami` client, we
2475-
will be using the client generated for `boot-service` with `fabrica`.
2476-
Unfortunately, the client command can only take a JSON value with the `--spec`
2477-
flag and cannot be set using a file. However, for the purpose of this tutorial,
2478-
we will create a file to make comparing this method to the `ochami` easier.
2531+
{{< /callout >}}
24792532

2480-
**Edit as root:** **`/etc/openchami/data/boot/compute-debug-rocky9.json`**
2533+
```bash
2534+
ochami boot config add -d @/etc/openchami/data/boot/compute-debug-rocky9.json --uri https://demo.openchami.cluster:8443 -l debug
2535+
```
24812536

2482-
```json
2483-
{
2484-
"macs": [
2485-
"52:54:00:be:ef:01",
2486-
"52:54:00:be:ef:02",
2487-
"52:54:00:be:ef:03",
2488-
"52:54:00:be:ef:04",
2489-
"52:54:00:be:ef:05"
2490-
],
2491-
"params": "nomodeset ro root=live:http://172.16.0.254:7070/boot-images/compute/debug/rocky9.7-compute-debug-rocky9 ip=dhcp overlayroot=tmpfs overlayroot_cfgdisk=disabled apparmor=0 selinux=0 console=ttyS0,115200 ip6=off cloud-init=enabled ds=nocloud-net;s=http://172.16.0.254:8081/cloud-init",
2492-
"kernel": "http://172.16.0.254:7070/boot-images/efi-images/compute/debug/vmlinuz-5.14.0-611.24.1.el9_7.x86_64",
2493-
"initrd": "http://172.16.0.254:7070/boot-images/efi-images/compute/debug/initramfs-5.14.0-611.24.1.el9_7.x86_64.img"
2537+
Verify that it was set properly.You should see the contents in JSON.
24942538

2495-
}
2539+
```bash
2540+
ochami boot config list -F json-pretty
24962541
```
24972542

2498-
Notice that the values in this file should be the same values from section
2499-
2.5.2.a but in JSON.
2500-
2501-
The things to check are:
2543+
{{< /tab >}}
25022544

2503-
- `initrd` URL points to debug initrd (try `curl`ing it to make sure it works)
2504-
- `kernel` URL points to debug kernel (try `curl`ing it to make sure it works)
2505-
- `root=live:` URL points to debug image (try `curl`ing it to make sure it works)
2545+
{{< tab "Using JSON" >}}
25062546

2507-
Set the boot configuration and verify with the `ochami` or `boot-service` client.
2547+
If you created the payload file in JSON, you can use either `ochami` with the
2548+
`-f json` flag or the `boot-service` CLI to set the boot config.
25082549

2509-
Using the `ochami` CLI:
2550+
To set with `ochami` using the `config add` subcommand:
25102551

25112552
```bash
25122553
# Set/add the boot configuration
2513-
ochami boot config add -d @/etc/openchami/data/boot/compute-debug-rocky9.json --uri https://demo.openchami.cluster:8443 -l debug
2554+
ochami boot config add -d @/etc/openchami/data/boot/compute-debug-rocky9.json --uri https://demo.openchami.cluster:8443 -l debug -f json
2555+
```
25142556

2515-
# Verify that it was set properly
2557+
Verify that it was set properly.You should see the contents in JSON.
2558+
2559+
```bash
25162560
ochami boot config list -F json-pretty
25172561
```
25182562

2519-
Or using the generated `boot-service` CLI:
2563+
To set with the `boot-service` CLI with the `create` subcommand:
25202564

25212565
```bash
2522-
# Set/add the boot configuration
25232566
boot-service-client bootconfiguration create --spec $(cat /etc/openchami/data/boot/boot-service/compute-debug-rocky9.json) --server https://demo.openchami.cluster:8443
2567+
```
2568+
2569+
Verify that it was set properly
25242570

2525-
# Verify that it was set properly
2571+
```bash
25262572
boot-service-client bootconfiguration list --server https://demo.openchami.cluster:8443
25272573
```
2574+
{{< /tab >}}
25282575

2529-
2576+
{{< /tabs >}}
2577+
25302578
The things to check are:
25312579

25322580
- `initrd` URL points to debug initrd (try `curl`ing it to make sure it works)

0 commit comments

Comments
 (0)