Skip to content

v1.1

Compare
Choose a tag to compare
@martin-belanger martin-belanger released this 18 May 16:53
· 580 commits to main since this release
012a859

nvme-stas version 1.1 introduces two new stacd configuration parameters:

udev-rule=

Takes a string argument "enabled" or "disabled". This option determines whether nvme-cli's udev rule will be executed or ignored.

A udev rule gets intalled with nvme-cli that tells the udev daemon (udevd) to look for Asychronous Event Notifications (AEN) indicating a change of discovery log page entries (DPLE). The udev rule is installed as: /usr/lib/udev/rules.d/70-nvmf-autoconnect.rules

When an AEN is detected, udevd simply instructs systemd to start a one-shot service that will retrieve the changed DPLEs and connect to all the I/O Contollers (IOC) listed in the DPLEs. This is basically the same as perfoming nvme-cli's "connect-all" command.

Unfortunately, stafd and stacd also perform the same operations when an AEN is received. This results in a race condition between udevd and stafd/stacd.

This is not really a problem. stafd and stacd are designed to handle this type of race condition and will conclude, eventually, that the connections succeeded. The only downside is that there may be error messages printed to the syslog when the race condition happens. These messages are printed by the kernel because two processes are trying to connect to the same IOC at the same time. One of them will be rejected by the kernel, but the other will succeed.

The udev-rule option allows a user to disable nvme-cli's udev rule so that udevd will not take action on received AENs. Instead, only stafd/stacd will be allowed to react to AENs and set up IOC connections.

Defaults to "enabled", which means that udevd and stafd/stacd will react to AENs. It also means that the race condition will happen by default and error messages will be printed to the syslog.

sticky-connections=

Takes a string argument "enabled" or "disabled". This option determines whether connections to I/O controllers will be maintained after Discovery Log Page Entry (DLPE) removal.

Zoning configuration is performed at Discovery Controllers (DC). A zone is used to specify the list of I/O controllers that a host is allowed to access. The zone contains a list of hosts and the I/O controllers that these hosts can access. Users can add or remove I/O controllers and/or hosts from zones.

DCs notify hosts of zoning configuration changes by sending Asynchronous Event Notifications (AEN) indicating a "Change of Discovery Log Page (DLP)". The host uses these AENs as a trigger to retrieve the new list of DLPEs (i.e. I/O controllers) by issuing a Get DLP command. This happens in real time, which means that a host that was previously connected to an I/O controller may suddenly be told that it is no longer allowed to connect to that I/O controller and should disconnect from it.

The parameter sticky-connections determines how stacd reacts to the removal of an I/O controller DLPE. In other words, whether it should immediately disconnect from I/O controllers when the DPLE is removed, or whether it should maintain the connection.

Note that nvme-stas was modeled after nvme-cli. nvme-cli maintains I/O controller connections by default (i.e. connections are sticky). That's why nvme-stas also maintains I/O controller connections by default.

With sticky-connections=enabled, the default, stacd does not disconnect from I/O controllers when a DPLE is removed. Instead, users can issue the nvme-cli command "nvme disconnect" to disconnect (or wait until the next system reboot at which time all connections will be removed).

With sticky-connections=disabled, stacd immediately disconnects from a previously connected I/O controller if the response to a Get DLP command no longer contains a DLPE matching that I/O controller.

List of commits bundled in v1.1:

Martin Belanger (12):
      doc: add TOC to api.rst
      stacd: allow disabling nvme-cli auto-connect udev rule.
      stacd: Document the udev-rule option and set version to 1.1
      test: add coverage
      test: add more coverage tests
      test: adding more coverage test cases
      test: fine tune coverage script
      staslib: better handling and clean up of singleton objects.
      doc: troubleshoot guide for missing mDNS packets
      build: add 'uninstall' target
      stacd: Add configuration parameter 'sticky-connections'
      release: complete version 1.1 documentation

dependabot[bot] (4):
      build(deps): bump docker/metadata-action from 3.7.0 to 3.8.0
      build(deps): bump docker/login-action from 1.14.1 to 2
      build(deps): bump docker/metadata-action from 3.8.0 to 4.0.1
      build(deps): bump docker/build-push-action from 2.10.0 to 3