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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For our samples it should be master, like in all the other MachineConfigs we have in our samples.

It's only worker when we are deploying in a 3 master and N workers deployment and OpenStack control plane will be running on the workers.

This is described in the generic documents PR:

> **⚠ Attention:** `MachineConfig` examples in the following sections are using

> **⚠ Attention:** `MachineConfig` examples in the following sections are using
label `machineconfiguration.openshift.io/role: worker` instructing OpenShift to
apply those changes on `worker` nodes (`workers` is an automatically created
`MachineConfigPool`)  This assumes we have an OpenShift cluster with 3 master
nodes and 3 `worker` nodes.  If we are deploying in a 3 node OpenShift cluster
where all nodes are `master` and `worker` we need to change it to use `master`
instead (`master` is another automatically created `MachineConfigPool`).

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