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

NVMe sample: Fix nvme ids #446

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
38 changes: 38 additions & 0 deletions config/samples/backends/bases/nvmeof/fix-ocp-nvme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# The OpenShift image has the NVMe hostid and hostnqn hardcoded, so it ends up
# being the same in all the control plane nodes, which is problematic.
# This MachineConfig fixes this issue by recreating both files when the hostid
# doesn't match the system-uuid of the machine it is running on.
# Bugs:
# https://issues.redhat.com/browse/OCPBUGS-34629
# https://github.com/openshift/os/issues/1519
# https://github.com/openshift/os/pull/1520
#
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
component: fix-nvme-ids
machineconfiguration.openshift.io/role: master
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I just spotted this now, but should the role be worker? I think our other machineConfig specify master nodes, and that works in our small environments where nodes are both.

service: cinder
name: 99-master-cinder-fix-nvme-ids
spec:
config:
Systemd:
Units:
- name: cinder-nvme-fix.service
enabled: true
Contents: |
[Unit]
Description=Cinder fix nvme ids

[Service]
Type=oneshot
RemainAfterExit=yes
Restart=on-failure
RestartSec=5
ExecStart=bash -c "if ! grep $(/usr/sbin/dmidecode -s system-uuid) /etc/nvme/hostid; then /usr/sbin/dmidecode -s system-uuid > /etc/nvme/hostid; /usr/sbin/nvme gen-hostnqn > /etc/nvme/hostnqn; fi"

[Install]
WantedBy=multi-user.target
ignition:
version: 3.2.0
1 change: 1 addition & 0 deletions config/samples/backends/bases/nvmeof/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
resources:
- nvme-fabrics.yaml
- fix-ocp-nvme.yaml
Loading