os-brick/os_brick/initiator
Stephen Finucane ee34d925ff rbd: Warn if ceph udev rules are not configured
The LUKS encryptor feature expects devices to have a symbolic link that
it can overwrite in order to enable transparent encryption/decryption
for instances [1]. This is generally the case for RBD volumes, as Ceph
uses udev rules [2] to create a '/dev/rbd/{pool}/{device}' ->
'/dev/rbdN' symlink. However, in an environment where udev daemon is not
present or configured correctly, this symlink will never be configured.
This causes things to crash and burn in a rather non-obvious manner when
locally attaching an encrypted RBD volume:

  oslo_concurrency.processutils.ProcessExecutionError: Unexpected error while running command.
  Command: cryptsetup luksOpen --key-file=- /dev/rbd/volumes/volume-foo crypt-volume-foo
  Exit code: 4
  Stdout: ''
  Stderr: "Device /dev/rbd/volumes/foo doesn't exist or access denied.\n"

('foo' being a stand-in for a very long 'device-$UUID' name)

The long term fix here is to probably stop relying on the side effects
of these udev rules, i.e. the symlinks, but that is a far more involved
fix that would not be backportable. Instead, for now we simply leave a
breadcrumb for the user, informing them as to what's gone wrong and
encouraging them to look at the bug report for more information.

[1] https://github.com/openstack/os-brick/blob/3.1.0/os_brick/encryptors/luks.py#L191-L195
[2] https://github.com/ceph/ceph/blob/v14.0.0/udev/50-rbd.rules

Change-Id: I2775f55039695c7ec029106c0dafe4d46255b336
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Related-Bug: #1884114
2020-07-27 13:18:02 +01:00
..
connectors rbd: Warn if ceph udev rules are not configured 2020-07-27 13:18:02 +01:00
windows Update hacking version 2019-01-18 21:30:00 -05:00
__init__.py Remove Sheepdog connector 2019-12-19 07:44:16 -06:00
connector.py Remove Sheepdog connector 2019-12-19 07:44:16 -06:00
host_driver.py Fix race in check and access of /dev/disk/by-path/ 2015-07-28 18:30:06 +02:00
initiator_connector.py Update FC connection_properties examples 2019-11-11 15:49:53 +01:00
linuxfc.py Fix FC scan too broad 2019-11-11 15:47:59 +01:00
linuxrbd.py Merge "Add attribute 'name' to class RBDVolume." 2017-10-10 03:41:31 +00:00
linuxscsi.py linuxscsi: Stop waiting for multipath devices during extend_volume 2019-06-11 10:20:51 +01:00
utils.py Context manager to handle shared_targets 2018-10-30 16:55:01 +01:00