cinder/releasenotes/notes/lvm-nvmet-fixes-fc5e867abc699633.yaml
Gorka Eguileor 00793ac09b LVM-nvmet: Use nvmetcli as library instead of CLI
The nvmet target was using the nvmetcli command to manage the NVMe-oF
targets, but the command has a big limitation when it comes to
controlling it's behaviour through the command line, as it can only
restore all its configuration and small parts, such as ports or
subsystems, cannot be directly modified without entering into the
interactive mode.

Due to this limitation the nvmet target would:

- Save current nvmet configuration
- Make changes to the json data
- Restore the updated configuration

The problem with this process, besides being slow because it runs a CLI
command and uses temporary files, is that the restoration completely
deletes EVERYTHING, before recreating it again.  This means that all
hosts that are connected to volumes will suddenly experience a
disconnect to the volumes (because the namespace and subsystems have
disappeared) and will keep retrying to connect.  The reconnect succeeds
after the configuration has been restored by nvmet, but that's 10 to 20
seconds that hosts cannot access volumes (this may block things in VMs)
and will present nnvme kernel log error messages.

To fix all these issues, speed and disconnect, this patch stops using
the nvmetcli as a CLI and uses it as a Python library, since that's the
most feature rich functionality of nvmetcli.

Querying the nvmet system can be done directly with the library, but to
make changes (create/destroy ports, subsystems, namespaces) it requires
privileges, so this patch adds a privsep wrapper for the operations that
we use and cannot be done as a normal user.

The nvmet wrapper doesn't provide privsep support for ALL operations,
only for those that we currently use.

Due to the client-server architecture of privsep and nvmet using non
primitive instances as parameters, the privsep wrapper needs custom
serialization code to pass these instances.

As a side effect of the refactoring we also fix a bug were we tried to
create the port over and over again on each create_export call which
resulted in nvme kernel warning logs.

Closes-Bug: #1964391
Closes-Bug: #1964394
Change-Id: Icae9802713867fa148bc041c86beb010086dacc9
2022-11-24 15:38:41 +01:00

13 lines
380 B
YAML

---
fixes:
- |
LVM nvmet target `bug #1964391
<https://bugs.launchpad.net/cinder/+bug/1964391>`_: Fixed temporary
disconnection of all volumes from all hosts when creating and removing
volume exports.
- |
LVM nvmet target `bug #1964394
<https://bugs.launchpad.net/cinder/+bug/1964394>`_: Fixed annoying kernel
log message when exporting a volume.