Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO-JIRA: faq: clean up dynamic secondary device example #1509

Merged
merged 1 commit into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ systemd:
DefaultDependencies=false
After=systemd-udev-settle.service
Before=local-fs-pre.target
ConditionPathExists=!/etc/secondary-dev.env
ConditionPathExists=!/etc/found-secondary-device

# break boot if we fail
OnFailure=emergency.target
Expand All @@ -360,8 +360,7 @@ systemd:
Before=local-fs.target

[Mount]
EnvironmentFile=/etc/secondary-dev.env
What=$VAR_LIB_FOOBAR_DEV
What=/dev/disk/by-label/foobar
Where=/var/lib/foobar
Type=xfs

Expand All @@ -381,9 +380,9 @@ storage:
for serial in foobar bazboo; do
blkdev=/dev/disk/by-id/virtio-$serial
if [ -b "$blkdev" ]; then
mkfs.xfs -f "$blkdev"
mkfs.xfs -f "$blkdev" -L foobar
echo "Found secondary block device $blkdev" >&2
echo "VAR_LIB_FOOBAR_DEV=$blkdev" > /etc/secondary-dev.env
touch /etc/found-secondary-device
exit
fi
done
Expand All @@ -394,6 +393,8 @@ storage:

Note this approach uses `After=systemd-udev-settle.service` which is not usually desirable as it may slow down boot. Another related approach is writing a udev rule to create a more stable symlink instead of this dynamic systemd service + script approach.

This script is also written in a way that also makes it compatible to be used day-2 via a MachineConfig.

The larger issue tracking machine-specific MachineConfigs is at https://github.com/openshift/machine-config-operator/issues/1720.

## Q: Does RHCOS support the use of `NetworkManager` keyfiles? Does RHCOS support the use of `ifcfg` files?
Expand Down