]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm/smb: add ctdb ports to smb daemon endpoint
authorSachin Prabhu <sprabhu@redhat.com>
Sun, 9 Feb 2025 12:38:14 +0000 (12:38 +0000)
committerSachin Prabhu <sprabhu@redhat.com>
Mon, 24 Feb 2025 16:28:09 +0000 (16:28 +0000)
When setting up a clustered SMB service, make sure that the port for the
ctdb service is opened up on the firewall. This port is used by the ctdb
servers to communicate with each other.

Signed-off-by: Sachin Prabhu <sp@spui.uk>
src/cephadm/cephadmlib/daemons/smb.py

index 09f91c5c0227f9b4fcbba9346620c6dab1f42055..506a7ebf22d2ba764d6c9362fa587354a2618e02 100644 (file)
@@ -84,6 +84,7 @@ class Config:
     user_sources: List[str] = dataclasses.field(default_factory=list)
     custom_dns: List[str] = dataclasses.field(default_factory=list)
     smb_port: int = 0
+    ctdb_port: int = 0
     ceph_config_entity: str = 'client.admin'
     vhostname: str = ''
     metrics_image: str = ''
@@ -404,6 +405,7 @@ class SMB(ContainerDaemonForm):
         self._cached_layout: Optional[ContainerLayout] = None
         self._rank_info = context_getters.fetch_rank_info(ctx) or (-1, -1)
         self.smb_port = 445
+        self.ctdb_port = 4379
         self.metrics_port = 9922
         self._network_mapper = _NetworkMapper(ctx)
         logger.debug('Created SMB ContainerDaemonForm instance')
@@ -491,6 +493,7 @@ class SMB(ContainerDaemonForm):
             domain_member=Features.DOMAIN.value in instance_features,
             clustered=Features.CLUSTERED.value in instance_features,
             smb_port=self.smb_port,
+            ctdb_port=self.ctdb_port,
             ceph_config_entity=ceph_config_entity,
             vhostname=vhostname,
             metrics_image=metrics_image,
@@ -719,6 +722,10 @@ class SMB(ContainerDaemonForm):
     ) -> None:
         if not any(ep.port == self.smb_port for ep in endpoints):
             endpoints.append(EndPoint('0.0.0.0', self.smb_port))
+        if self._cfg.clustered and not any(
+            ep.port == self.ctdb_port for ep in endpoints
+        ):
+            endpoints.append(EndPoint('0.0.0.0', self.ctdb_port))
         if self.metrics_port > 0:
             if not any(ep.port == self.metrics_port for ep in endpoints):
                 endpoints.append(EndPoint('0.0.0.0', self.metrics_port))