]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
nvmeof: Add mount for log location
authorRoy Sahar <royswi@gmail.com>
Thu, 8 Feb 2024 15:58:43 +0000 (17:58 +0200)
committerAdam King <adking@redhat.com>
Wed, 28 Feb 2024 18:27:33 +0000 (13:27 -0500)
Signed-off-by: Roy Sahar <royswi@gmail.com>
(cherry picked from commit 5c613b3788d9ae686b4dc29d9414674ecb6f6adb)

src/cephadm/cephadmlib/daemons/nvmeof.py

index 673761e8e6ebb68fe8578937a8541eb05e4c3fee..f22147c775c373362c0e33c80393445a7e09f4fb 100644 (file)
@@ -63,7 +63,7 @@ class CephNvmeof(ContainerDaemonForm):
         return DaemonIdentity(self.fsid, self.daemon_type, self.daemon_id)
 
     @staticmethod
-    def _get_container_mounts(data_dir: str) -> Dict[str, str]:
+    def _get_container_mounts(data_dir: str, log_dir: str) -> Dict[str, str]:
         mounts = dict()
         mounts[os.path.join(data_dir, 'config')] = '/etc/ceph/ceph.conf:z'
         mounts[os.path.join(data_dir, 'keyring')] = '/etc/ceph/keyring:z'
@@ -73,13 +73,15 @@ class CephNvmeof(ContainerDaemonForm):
         mounts[os.path.join(data_dir, 'configfs')] = '/sys/kernel/config'
         mounts['/dev/hugepages'] = '/dev/hugepages'
         mounts['/dev/vfio/vfio'] = '/dev/vfio/vfio'
+        mounts[log_dir] = '/var/log/ceph:z'
         return mounts
 
     def customize_container_mounts(
         self, ctx: CephadmContext, mounts: Dict[str, str]
     ) -> None:
         data_dir = self.identity.data_dir(ctx.data_dir)
-        mounts.update(self._get_container_mounts(data_dir))
+        log_dir = os.path.join(ctx.log_dir, self.identity.fsid)
+        mounts.update(self._get_container_mounts(data_dir, log_dir))
 
     def customize_container_binds(
         self, ctx: CephadmContext, binds: List[List[str]]