Repository navigation
VF-LAG host configure #2682
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
base: stackhpc/2026.1
Are you sure you want to change the base?
VF-LAG host configure #2682
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,138 @@ | ||
| --- | ||
| # Setup of VF-LAG systemd configuration. | ||
| # This playbook should execute after kayobe overcloud host configure has completed. | ||
|
|
||
| - name: Enable SRIOV | ||
| hosts: vflag | ||
| tags: | ||
| - sriov | ||
| handlers: | ||
| - name: Reboot | ||
| ansible.builtin.set_fact: | ||
| kayobe_needs_reboot: true | ||
| tasks: | ||
| # NOTE: define sriov_devices in group_vars | ||
| - name: Include SRIOV role | ||
| ansible.builtin.include_role: | ||
| name: stackhpc.linux.sriov | ||
| vars: | ||
| sriov_install_enabled: true | ||
| when: | ||
| - sriov_devices is defined | ||
| - sriov_devices | length > 0 | ||
|
|
||
| - name: Prepare hosts for VF-LAG support | ||
| hosts: vflag | ||
| tags: | ||
| - vflag | ||
| vars: | ||
| # This playbook will execute after nodes are deployed | ||
| # and before overcloud host configure - we can't assume | ||
| # users and venvs exist. | ||
| ansible_user: "{{ ansible_user }}" | ||
| ansible_python_interpreter: "/usr/bin/python3" | ||
| tasks: | ||
| # TC offload requires kernel-modules-extra (act_ct module) | ||
| - name: Ensure kernel-modules-extra is installed | ||
| ansible.builtin.package: | ||
| name: kernel-modules-extra | ||
| state: present | ||
| become: true | ||
| when: ansible_facts.os_family == "RedHat" | ||
|
|
||
| # /etc/sysconfig is a RedHat convention - create equivalent here | ||
| - name: Create /etc/sysconfig for Ubuntu | ||
| become: true | ||
| ansible.builtin.file: | ||
| path: /etc/sysconfig | ||
| owner: "root" | ||
| group: "root" | ||
| mode: 0755 | ||
| state: directory | ||
| when: ansible_facts.os_family == "Debian" | ||
|
|
||
| # Write /etc/sysconfig/sriov configuration to match this host | ||
| - name: Define parameters in /etc/sysconfig/sriov | ||
| ansible.builtin.template: | ||
| src: "sysconfig-sriov.j2" | ||
| dest: "/etc/sysconfig/sriov" | ||
| owner: "root" | ||
| group: "root" | ||
| mode: 0755 | ||
| become: true | ||
| notify: Reboot and wait | ||
|
|
||
| - name: Transfer VF-LAG helper scripts to /usr/local/bin | ||
| ansible.builtin.copy: | ||
| src: "{{ item }}" | ||
| dest: "/usr/local/bin/{{ item }}" | ||
| owner: "root" | ||
| group: "root" | ||
| mode: 0755 | ||
| become: true | ||
| with_items: | ||
| - "mlnx-vflag-early" | ||
| - "mlnx-vflag-final" | ||
| notify: Reboot and wait | ||
|
|
||
| - name: Transfer VF-LAG systemd units to /etc/systemd/system | ||
| ansible.builtin.template: | ||
| src: "{{ item }}.j2" | ||
| dest: "/etc/systemd/system/{{ item }}" | ||
| owner: "root" | ||
| group: "root" | ||
| mode: 0644 | ||
| become: true | ||
| with_items: | ||
| - "mlnx-vflag-early.service" | ||
| - "mlnx-vflag-final.service" | ||
| notify: Reboot and wait | ||
|
|
||
| - name: Enable VF-LAG systemd units | ||
| ansible.builtin.systemd: | ||
| daemon_reload: true | ||
| name: "{{ item }}" | ||
| enabled: true | ||
| become: true | ||
| with_items: | ||
| - "mlnx-vflag-early.service" | ||
| - "mlnx-vflag-final.service" | ||
| notify: Reboot and wait | ||
|
|
||
| # Purge some stuff that OFED typically installs | ||
| # which may race with the setup we perform. | ||
|
|
||
| - name: Disable OFED openibd service | ||
| ansible.builtin.systemd: | ||
| name: "openibd.service" | ||
| enabled: false | ||
| state: "stopped" | ||
| become: true | ||
|
Comment on lines
+105
to
+110
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Check that If a VF-LAG host has no OFED service installed, this task fails rather than treating the service as already stopped. Ansible’s systemd module checks that the unit exists before it applies either
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure whether this is important to catch, should we be running this script if OFED isn't installed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
rg -n -i -C3 'ofed|openibd|vf-lag|vf_lag|vflag' --glob '!*.lock' --glob '!*.svg' . | head -n 280
fd -i 'mlnx-vflag|sysconfig-sriov'
ast-grep outline etc/kayobe/ansible/deployment/vf-lag-host-configure.ymlLength of output: 22668
If OFED must already be installed, you do not need to support hosts without OFED. In that case, failing is reasonable. An explicit prerequisite check could give a clearer error, but it is not essential to this change. The remaining question is whether every supported OFED/DOCA installation provides My original Major rating was too strong without establishing that a supported host can lack the service. You are interacting with an AI system. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Let's go with this option @holliefae |
||
|
|
||
| - name: Move the openib config file | ||
| ansible.builtin.command: "mv /etc/infiniband/openib.cf /etc/infiniband/openib.cf-" | ||
| args: | ||
| removes: "/etc/infiniband/openib.cf" | ||
| creates: "/etc/infiniband/openib.cf-" | ||
| become: true | ||
|
|
||
| # There appears to be an issue where the reciprocal symlink from a | ||
| # WantedBy= to a Wants= doesn't get created. Explicitly ensure it exists. | ||
| - name: Ensure the .wants symlink exists (Ubuntu) | ||
| when: ansible_facts.os_family == "Debian" | ||
| become: true | ||
| block: | ||
| - name: Ensure the .wants directory exists | ||
| ansible.builtin.file: | ||
| path: "/etc/systemd/system/systemd-networkd.service.wants" | ||
| state: "directory" | ||
| - name: Ensure the .wants symlink exists | ||
| ansible.builtin.file: | ||
| path: "/etc/systemd/system/systemd-networkd.service.wants/mlnx-vflag-early.service" | ||
| src: "/etc/systemd/system/mlnx-vflag-early.service" | ||
| state: "link" | ||
|
|
||
| handlers: | ||
| - name: Reboot and wait | ||
| ansible.builtin.set_fact: | ||
| kayobe_needs_reboot: true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| [Unit] | ||
| Description=Early configuration for Mellanox SR-IOV and VF-LAG | ||
| {% for nic in vflag_pfs %} | ||
| Requires=sys-subsystem-net-devices-{{ nic }}.device | ||
| After=sys-subsystem-net-devices-{{ nic }}.device | ||
| {% endfor %} | ||
| Requires=network-pre.target | ||
| Before=network-pre.target | ||
| {% if ansible_facts.os_family == "Debian" %} | ||
| Requires=systemd-networkd.service | ||
| Before=systemd-networkd.service | ||
| {% endif %} | ||
|
|
||
| [Service] | ||
| Type=oneshot | ||
| ExecStart=/usr/local/bin/mlnx-vflag-early | ||
| RemainAfterExit=yes | ||
|
|
||
| [Install] | ||
| WantedBy=network-pre.target | ||
| {% if ansible_facts.os_family == "Debian" %} | ||
| WantedBy=systemd-networkd.service | ||
| {% endif %} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| [Unit] | ||
| Description=Final configuration for Mellanox SR-IOV and VF-LAG | ||
| Wants=network-online.target | ||
| After=network-online.target | ||
| Before=docker.service | ||
|
|
||
| [Service] | ||
| Type=oneshot | ||
| ExecStart=/usr/local/bin/mlnx-vflag-final | ||
| RemainAfterExit=yes | ||
|
|
||
| [Install] | ||
| WantedBy=docker.service |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| features: | ||
| - | | ||
| Move VF-LAG host configure script from SMSLab Ansible to SKC. |
Uh oh!
There was an error while loading. Please reload this page.