]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: give ceph-iscsi permissions to configfs 34898/head
authorMatthew Oliver <moliver@suse.com>
Tue, 5 May 2020 06:17:06 +0000 (16:17 +1000)
committerMatthew Oliver <moliver@suse.com>
Tue, 5 May 2020 06:17:06 +0000 (16:17 +1000)
The cephadm container mounts the configfs and then bind mounts (-v) it
into the container. Currently the container is not a priviliaged
container which leads to 2 problems:

 1. The container can't insert the iscsi_target_mod kernel module; and
 2. The container can't write to the configfs as that's only writeable
    by root.

We _can_ get around 1, by preloading the kernel module. I.E add it the
systemd unit file. But that doesn't help with 2.

I've tried mounting the configfs with uid and gid options, but configfs
doesn't use them.

If we make the container a priviliged container then magically both 1
and 2 are solved. We don't need to preload the module so that's one less
workaround. But more importantly, configfs can be written to so we can
create ISCSI targets etc.

So that's what this patch does, it makes iscsi containers privileged
containers by setting the CephContainer --priviliged while creating it.

Fixes: https://tracker.ceph.com/issues/45252
Signed-off-by: Matthew Oliver <moliver@suse.com>
src/cephadm/cephadm

index 54ca99701ffea56ffc5b698593e46f2038174d8c..c0f97c1c0e0e5932d6eee2e397586864ed9c7aa9 100755 (executable)
@@ -1649,6 +1649,9 @@ def get_container(fsid, daemon_type, daemon_id,
     elif daemon_type == CephIscsi.daemon_type:
         entrypoint = CephIscsi.entrypoint
         name = '%s.%s' % (daemon_type, daemon_id)
+        # So the container can modprobe iscsi_target_mod and have write perms
+        # to configfs we need to make this a privileged container.
+        privileged = True
     else:
         entrypoint = ''
         name = ''