Skip to content

feat(csi): add NetApp Trident support - #4098

Open
Dong Ma (larainema) wants to merge 10 commits into
mainfrom
feat/add-trident-csi
Open

Dong Ma (larainema) wants to merge 10 commits into
mainfrom
feat/add-trident-csi

Conversation

@larainema

@larainema Dong Ma (larainema) commented Jun 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Deploy NetApp Trident 26.10.0 for Kubernetes PVC provisioning with csi_driver: trident. The role creates ONTAP SAN/NAS backends and the general StorageClass, supporting iSCSI, Fibre Channel, NVMe/TCP, NFS, and SMB according to the backend driver.

Review changes

  • Vendor the operator Helm chart through .charts.yml, with a recorded patch for operator image environment overrides and separately managed TridentOrchestrator resources. Installation supports a custom namespace and downloads no installer archive.
  • Pin all ten operator, Trident, autosupport, Helm hook, and CSI sidecar images in _atmosphere_images. They use the release manifest, atmosphere_image_prefix, and registry mirror rules. Sidecars use Trident's supported operator environment overrides.
  • Delegate SAN multipath configuration to the existing multipathd role. Both CSI and standalone OpenStack runs use the same policy, without Trident rewriting individual lines or adding competing configuration blocks.
  • Let Trident choose the ONTAP API by default, force REST for NVMe, and reject explicit ZAPI selection for NVMe.
  • Include {{ .config.StoragePrefix }} in the default volume-name template.
  • Silence periodic autosupport reporting by default; expose an explicit opt-in.
  • Consolidate the feature release notes and remove redundant filesystem values from examples.
  • Add a Kind installation smoke test using the actual role, a custom namespace, and trident_csi_wait_for_backend: false.

Latest review round (cd3fa32a2)

  • Multipath per array: multipathd has named array profiles (netapp_ontap, pure_flasharray, pure_flasharray_nvme, nimble, powerstore). With multipathd_arrays set, it renders find_multipaths no with a .* device blacklist plus exceptions for the selected arrays, so local root, LVM, Ceph OSD and Nova disks are protected without a WWID inventory. With an empty list, the existing configuration is unchanged. Trident SAN asserts netapp_ontap is selected. Changes reload multipathd instead of restarting it.
  • Active map check: before rewriting multipath.conf, the role fails if an active multipath map belongs to an array that isn't listed (multipathd_check_active_maps).
  • Host preparation scope: Atmosphere schedules every PVC workload on the control plane, so the CSI playbook prepares only controllers, and only when csi_driver is trident (no fact gathering otherwise). The operator, controller plugin and node plugin use trident_csi_node_selector, defaulting to openstack-control-plane: enabled. Compute nodes are left to the multipathd and iscsi roles for Cinder.
  • Node requirements: iSCSI manual session scanning, initiator names and uniqueness checks; NVMe/TCP modules and persistent host NQNs; NFS client tools. Host-wide node.session.scan behaviour is documented.
  • Naming: the backend name defaults to the storage driver, and the default name template truncates the PVC name to 63 characters.
  • CI: the smoke test moved to its own path-filtered trident / smoke workflow, which labels the Kind node as a controller.
  • Upgrade note: existing hosts get one multipathd reload because the configuration is rewritten in a new format with the same settings.

Cinder NetApp backend support remains in #4108.

CI failure

The original Python job used Ansible Core 2.21.5. Its DataLoader leaves file-loaded templates untrusted unless requested explicitly. Commit 370600ec1 fixes the test fixture to trust the repository's own variable files where that API is available, retaining compatibility with older Ansible.

Validation

  • 89 Python tests passed locally (test_multipathd.py, test_multipath.py, test_resolve_images.py), covering multipath rendering for legacy and allow-list modes, the active-map filter, CSI play scoping, node selectors, backend naming, and the name template.
  • CI's exact chart-vendor revision reproduced all vendored chart files from upstream plus the recorded patch without changes.
  • pre-commit passed on changed files except ansible-lint's existing galaxy[no-changelog] on galaxy.yml, which this branch doesn't change.
  • Real ONTAP volume creation, attachment and SAN I/O remain untested.

Before merging, test on a controller with an ONTAP LUN and a local disk (multipath -ll, multipath -v3 -d), and test a Cinder attach on a compute with a second array.

Host preparation

For SAN backends, set multipathd_arrays on controllers to include netapp_ontap and any other array they use. Computes only need the arrays used by Cinder, for example:

# group_vars/controllers.yml
multipathd_arrays: [netapp_ontap]

# group_vars/computes.yml
multipathd_arrays: [pure_flasharray]

multipathd_blacklist_wwids remains an optional escape hatch. FC zoning and HBA presentation remain prerequisites.

Copy link
Copy Markdown
Member

orik-sh please review this

@orik-sh

orik-sh Bot commented Nov 2, 2026

Copy link
Copy Markdown

I'd request changes before merging this. The structure of the role is reasonable and validation is solid, but it conflicts with a role Atmosphere already runs on the same hosts, and two of its backend defaults break features the role says it supports. It also installs Trident differently from every other vendor CSI driver in the repo.

I checked this against the existing roles and playbooks, the v26.02.0 installer tarball, Trident's source at that tag, and NetApp's ONTAP SAN backend docs. I didn't run it against a real ONTAP array.

Must fix

  1. The multipath change is undone on every full deploy. site.yml runs csi.yml (controllers only) before openstack.yml. The "Configure operating system" play in openstack.yml then runs the existing multipathd role on controllers:computes. That role rewrites the whole /etc/multipath.conf from a template with find_multipaths yes hardcoded, which wipes out Trident's block. On the next run, the lineinfile task changes it back to no and restarts multipathd, then the multipathd role reverts it and restarts multipathd again. The result is two multipathd restarts per controller on every deploy, and a final state of yes, which is the opposite of what Trident needs. Compute nodes never get no at all, although the docs say "every Kubernetes node".

    • Fix: make find_multipaths a variable in roles/multipathd, plus any NetApp device stanza you want. The Trident role then sets that variable instead of editing the file itself. The existing iscsi role already covers the basic iSCSI packages and iscsid.
    • Also: find_multipaths no tells multipathd to claim every disk that isn't blacklisted. On controllers that also host Ceph OSDs or other local data disks, that needs a blacklist, or at least a warning in the docs.
  2. The useREST: false default breaks NVMe and forces the older ZAPI interface. NetApp's docs say "NVMe is supported only with ONTAP REST APIs and not supported with ONTAPI (ZAPI)". With the defaults, trident_csi_access_protocol: nvme produces a backend that can't work. Separately, Trident 24.06+ already switches to REST by itself on ONTAP 9.15.1+, and NetApp says to always use REST on ASA r2 systems. I'd drop useREST from the defaults and let Trident pick, or at least force true when nvme is selected.

  3. trident_csi_storage_prefix is silently ignored. In storage_drivers/ontap/ontap_common.go, getInternalVolumeNameCommon only adds StoragePrefix when no nameTemplate is set. When there is one, the template output is used as the full name. The default template here doesn't include the prefix, so atmosphere_ never reaches ONTAP. Add {{ .config.StoragePrefix }} to the front of the template, or remove the prefix variable.

  4. This installs Trident differently from the other vendor CSI drivers. At deploy time, the first controller downloads a 107 MB tarball from GitHub, and no checksum is checked by default (trident_csi_installer_checksum: ""). It then applies deploy/bundle.yaml, which uses docker.io/netapp/trident-operator:26.02.0. That image has no digest pin and doesn't go through atmosphere_image_prefix. The operator then pulls the Trident, autosupport and registry.k8s.io CSI sidecar images the same way. The consequences:

    • Air-gapped or mirrored deployments don't work.
    • Docker Hub rate limits apply.
    • None of these images show up in the image manifest.

    The same tarball contains helm/trident-operator-100.2602.0.tgz, and NetApp publishes it at https://netapp.github.io/trident-helm-chart. Vendoring it through .charts.yml like hpe-csi-driver, with images in _atmosphere_images, would match hpe_nimble_csi and fix all of the above. It also fixes a smaller problem: bundle.yaml hardcodes the trident namespace, so changing trident_csi_namespace currently breaks the install.

Should fix

  1. Autosupport telemetry is on by default. The TridentOrchestrator defaults to silenceAutosupport: false, so every Atmosphere cloud on this driver would send autosupport bundles to NetApp unless the operator opts out. I'd default to silenced, or at least say so in the docs.
  2. The Trident version is behind. It pins 26.02.0, while 26.02.1 (patch release), 26.06.2 and 26.10.0 are all out.
  3. The release notes need merging. The FC feature ships in the same PR as the driver, so it belongs in the first note, not a second one. The FC note also opens with "Atmosphere now supports…", which AGENTS.md says to avoid.
  4. There is no CI coverage. No molecule or Zuul job runs csi_driver: trident, so the only testing is the manual AIO smoke test. A csi scenario run with trident_csi_wait_for_backend: false would at least cover the operator install, the orchestrator becoming ready, and the StorageClass on every PR.

Nits

  • In csi.rst, the examples set trident_csi_fs_type: ext4, which is already the default. There are also a couple of double spaces after periods.
  • The find_multipaths lineinfile regex matches anywhere in the file, including inside devices/device sections. This goes away if item 1 moves into the multipathd role.

Most of the work is fine to keep: the input validation, the protocol and driver mapping tables, no_log on the credential tasks, waiting for the orchestrator and backend to be ready, and the docs. Items 1–4 are what I'd want fixed before this merges.

Requested by Mohammed Naser (@mnaser) · Open in Orik

@mnaser Mohammed Naser (mnaser) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for pushing this through. The Trident install side looks good: I checked the operator source, and it honours DEFAULT_TRIDENT_IMAGE, DEFAULT_TRIDENT_AUTOSUPPORT_IMAGE and all six TRIDENT_CSI_SIDECAR_* variables, so the release manifest and mirrors cover every image. The things that need work are all on the host side.

1. Multipath: manage it per array instead of per driver

The current approach has a Trident-specific default in multipathd that switches find_multipaths to no. Because playbooks/openstack.yml runs multipathd on controllers:computes, every compute gets no as well, and local root, LVM, Ceph OSD and Nova disks are only protected by a per-host multipathd_blacklist_wwids list that nothing checks. It also doesn't answer what happens when a deployment runs Trident alongside another array such as Pure.

/etc/multipath.conf is one file per host, and find_multipaths is only accepted in the defaults section, so that setting is one value per host. Device stanzas and blacklist rules do combine, though, so several arrays can share a host cleanly if multipath allows only known array LUNs:

defaults {
    user_friendly_names no
    find_multipaths no
}

devices {
    # device stanzas for each enabled array (current Pure/Nimble entries move here)
}

blacklist {
    device {
        vendor  ".*"
        product ".*"
    }
}

blacklist_exceptions {
    device {
        vendor  "NETAPP"
        product "LUN.*"
    }
    device {
        vendor  "PURE"
        product "FlashArray"
    }
}

With this, find_multipaths no is safe because local disks never match an allowed array, and no per-host WWID inventory is needed. The blacklist has to use a device entry. In libmultipath/blacklist.c, filter_path() checks property, devnode, device, protocol and wwid one after another, and an exception only cancels a blacklist entry of the same category. So wwid ".*" combined with device exceptions would block every LUN.

Suggested shape:

  • multipathd stays the only owner of /etc/multipath.conf and loses all Trident references (the include_vars of ../trident_csi/vars/multipath.yml, the long multipathd_find_multipaths default, and the README text).
  • Add a built-in catalogue of array profiles in multipathd (for example netapp_ontap, pure_flasharray, pure_flasharray_nvme, nimble, powerstore). Each profile has the vendor/product match and optional device settings, and the existing Pure and Nimble stanzas move into it.
  • Operators list what each host group needs, for example multipathd_arrays: [netapp_ontap, pure_flasharray] in group vars. Controllers and computes can differ if needed.
  • When multipathd_arrays is set, render allow-list mode as above. When it's empty, keep today's config unchanged so existing deployments don't move.
  • trident_csi asserts that netapp_ontap is in multipathd_arrays for SAN drivers and fails with a clear message otherwise. It can call the same role with the same inventory. Because the CSI and OpenStack playbooks then render from the same variables, the OpenStack run no longer flips the setting back, which was the original bug.
  • multipathd_blacklist_wwids can stay as an escape hatch but is no longer a requirement.
  • Consider multipathd reconfigure (reload) in the handler instead of a full restart on all controllers at once.

Before merging, this needs testing on a node with both an ONTAP LUN and a local disk (multipath -ll, multipath -v3 -d), plus a Cinder attach on a compute with a second array to confirm os-brick behaves with find_multipaths no on allowed LUNs.

2. Host preparation scope

playbooks/csi.yml only targets controllers, but Kubernetes runs on all hosts and the trident-node DaemonSet lands on computes too, where the packages, services and initiator name were never set up. Either run the Trident host preparation as its own play against every Kubernetes node (when csi_driver == 'trident'), keeping the Helm, backend and StorageClass tasks run_once on controllers, or limit the node plugin to prepared nodes with nodePluginNodeSelector through trident_csi_orchestrator_options and document it. The first option is probably simpler for operators.

3. Node requirements from NetApp's 26.10 guide

These come from https://docs.netapp.com/us-en/trident/trident-use/worker-node-prep.html and should be handled by the role on each node:

  • NFS: install nfs-common (Debian) or nfs-utils (RHEL). Nothing in the repo installs them today, so ontap-nas fails at mount time. The Kind smoke test doesn't mount a volume, so it can't catch this.
  • iSCSI: set node.session.scan = manual in /etc/iscsi/iscsid.conf and restart iscsid when it changes.
  • NVMe/TCP: install linux-modules-extra-{{ ansible_kernel }} where needed, load nvme-tcp (community.general.modprobe), persist it in /etc/modules-load.d/, and check that each node has a unique /etc/nvme/hostnqn. The iSCSI initiator name should get the same uniqueness check.
  • SMB: Trident only supports SMB volumes on Windows worker nodes with csi-proxy. Atmosphere nodes are Linux, so please drop smb from the supported protocols, docs and release note.

Smaller items

  • Add an assertion to molecule/csi/trident-smoke.yml that the trident-controller pods use the pinned sidecar images. That is the main thing the chart patch exists for, and nothing tests it today.
  • Remove no_log from "Create Trident backend". The object only references the Secret by name, and hiding its output makes failures harder to debug.
  • _trident_csi_multipath_defaults in roles/trident_csi/vars/main.yml looks up role_path, which resolves to whatever role is running when the value is first used. This goes away with item 1.
  • The ci / trident-smoke paragraph belongs in the role README, not the deploy guide.
  • The --- added to roles/csi/meta/main.yml is unrelated churn.
  • roles/trident_csi/meta/main.yml lists focal and jammy but not noble.

As the description says, volume creation, attach and I/O haven't been tested on ONTAP yet. Once the multipath and host preparation changes land, one iSCSI run on real hardware would give us confidence.

Dong Ma (larainema) and others added 10 commits November 25, 2026 17:11
Signed-off-by: Dong Ma <winterma.dong@gmail.com>
Signed-off-by: Yaguang Tang <yaguang.tang@vexxhost.com>
Signed-off-by: Dong Ma <winterma.dong@gmail.com>
Signed-off-by: Dong Ma <winterma.dong@gmail.com>
OpenStack host configuration runs after CSI setup and rewrites
/etc/multipath.conf with find_multipaths yes, overriding Trident's
required no setting and causing ONTAP LUN node staging to fail.

Make the generic role's setting configurable and follow the Trident SAN
value when SAN host preparation and multipath configuration are enabled.
Resolve the defaults when OpenStack runs separately, preserve the existing
policy for other drivers, and document the override.

Signed-off-by: Yaguang Tang <yaguang.tang@vexxhost.com>
Signed-off-by: Yaguang Tang <yaguang.tang@vexxhost.com>
Signed-off-by: Yaguang Tang <yaguang.tang@vexxhost.com>
Vendor the Trident 26.10.0 operator chart and record the image override patch. Pin operator, Trident, autosupport, hook, and CSI sidecar images in the release manifest. Delegate SAN configuration to multipathd, select REST for NVMe, preserve the storage prefix, and silence autosupport by default. Add a Kind installation smoke job and consolidate the feature release note.

Signed-off-by: Yaguang Tang <yaguang.tang@vexxhost.com>
Prepare iSCSI, NVMe/TCP and multipath on the controllers, where every
workload with persistent volumes runs, and keep the Trident operator,
controller plugin and node plugin on the control plane. Compute nodes
are left to the multipathd and iscsi roles for Cinder. Restrict
multipathd to the storage arrays listed in multipathd_arrays.

- Add a CSI preparation play for controllers that runs only when
  csi_driver is trident and splits host setup into iSCSI, NVMe and
  validation tasks.
- Schedule Trident with trident_csi_node_selector, defaulting to
  openstack-control-plane: enabled.
- Rework the multipathd role around named array profiles with an
  allow-list blacklist, reload instead of restart on changes, and fail
  before rewriting multipath.conf when active maps belong to arrays
  that are not listed (multipathd_check_active_maps).
- Default the backend name to the storage driver and truncate the PVC
  name in the default volume name template.
- Document host-wide iSCSI scan behaviour, multipath array selection
  and volume naming.
- Run the Trident smoke test in its own path-filtered workflow.
- Add an upgrade note for the one-time multipathd reload.

Signed-off-by: Yaguang Tang <yaguang.tang@vexxhost.com>
The Cinder volume and backup services run on the controllers and attach
volumes there, so controllers need the Cinder arrays in
multipathd_arrays alongside netapp_ontap. Explain how hosts in both
groups receive one list and that the active map check only covers
volumes attached during the run.

Signed-off-by: Mohammed Naser <mnaser@vexxhost.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants