Repository navigation
feat(csi): add NetApp Trident support - #4098
Dong Ma (larainema) wants to merge 10 commits into
Conversation
0e2d577 to
1cb990c
Compare
1cb990c to
5060bd6
Compare
a66035a to
a4dac85
Compare
7e3de9f to
8dbfe89
Compare
|
orik-sh please review this |
|
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
Should fix
Nits
Most of the work is fine to keep: the input validation, the protocol and driver mapping tables, Requested by Mohammed Naser (@mnaser) · Open in Orik |
8dbfe89 to
0ad6eda
Compare
Mohammed Naser (mnaser)
left a comment
There was a problem hiding this comment.
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:
multipathdstays the only owner of/etc/multipath.confand loses all Trident references (theinclude_varsof../trident_csi/vars/multipath.yml, the longmultipathd_find_multipathsdefault, and the README text).- Add a built-in catalogue of array profiles in
multipathd(for examplenetapp_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_arraysis set, render allow-list mode as above. When it's empty, keep today's config unchanged so existing deployments don't move. trident_csiasserts thatnetapp_ontapis inmultipathd_arraysfor 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_wwidscan 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) ornfs-utils(RHEL). Nothing in the repo installs them today, soontap-nasfails at mount time. The Kind smoke test doesn't mount a volume, so it can't catch this. - iSCSI: set
node.session.scan = manualin/etc/iscsi/iscsid.confand restartiscsidwhen it changes. - NVMe/TCP: install
linux-modules-extra-{{ ansible_kernel }}where needed, loadnvme-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
smbfrom the supported protocols, docs and release note.
Smaller items
- Add an assertion to
molecule/csi/trident-smoke.ymlthat 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_logfrom "Create Trident backend". The object only references the Secret by name, and hiding its output makes failures harder to debug. _trident_csi_multipath_defaultsinroles/trident_csi/vars/main.ymllooks uprole_path, which resolves to whatever role is running when the value is first used. This goes away with item 1.- The
ci / trident-smokeparagraph belongs in the role README, not the deploy guide. - The
---added toroles/csi/meta/main.ymlis unrelated churn. roles/trident_csi/meta/main.ymllists 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.
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>
cd3fa32 to
b46be5d
Compare
Summary
Deploy NetApp Trident 26.10.0 for Kubernetes PVC provisioning with
csi_driver: trident. The role creates ONTAP SAN/NAS backends and thegeneralStorageClass, supporting iSCSI, Fibre Channel, NVMe/TCP, NFS, and SMB according to the backend driver.Review changes
.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._atmosphere_images. They use the release manifest,atmosphere_image_prefix, and registry mirror rules. Sidecars use Trident's supported operator environment overrides.multipathdrole. Both CSI and standalone OpenStack runs use the same policy, without Trident rewriting individual lines or adding competing configuration blocks.{{ .config.StoragePrefix }}in the default volume-name template.trident_csi_wait_for_backend: false.Latest review round (
cd3fa32a2)multipathdhas named array profiles (netapp_ontap,pure_flasharray,pure_flasharray_nvme,nimble,powerstore). Withmultipathd_arraysset, it rendersfind_multipaths nowith 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 assertsnetapp_ontapis selected. Changes reload multipathd instead of restarting it.multipath.conf, the role fails if an active multipath map belongs to an array that isn't listed (multipathd_check_active_maps).csi_driveristrident(no fact gathering otherwise). The operator, controller plugin and node plugin usetrident_csi_node_selector, defaulting toopenstack-control-plane: enabled. Compute nodes are left to themultipathdandiscsiroles for Cinder.node.session.scanbehaviour is documented.trident / smokeworkflow, which labels the Kind node as a controller.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
370600ec1fixes the test fixture to trust the repository's own variable files where that API is available, retaining compatibility with older Ansible.Validation
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.galaxy[no-changelog]ongalaxy.yml, which this branch doesn't change.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_arrayson controllers to includenetapp_ontapand any other array they use. Computes only need the arrays used by Cinder, for example:multipathd_blacklist_wwidsremains an optional escape hatch. FC zoning and HBA presentation remain prerequisites.