Skip to content

Commit 8e5db6e

Browse files
committed
mgr/cephadm: create OSD daemon deploy specs through make_daemon_spec
That function handles setting up the extra container/entrypoint args for the daemon during initial deployment. Having the CephadmDaemonDeploySpec made directly in the OSD deployment workflow means initial deployments of OSDs won't have the extra container/entrypoint args from the spec Fixes: https://tracker.ceph.com/issues/69734 Signed-off-by: Adam King <[email protected]>
1 parent b7d3d39 commit 8e5db6e

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/pybind/mgr/cephadm/module.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1508,7 +1508,11 @@ def _osd_activate(self, host: List[str]) -> HandleCommandResult:
15081508
@forall_hosts
15091509
def run(h: str) -> str:
15101510
with self.async_timeout_handler(h, 'cephadm deploy (osd daemon)'):
1511-
return self.wait_async(self.osd_service.deploy_osd_daemons_for_existing_osds(h, 'osd'))
1511+
return self.wait_async(
1512+
self.osd_service.deploy_osd_daemons_for_existing_osds(
1513+
h, DriveGroupSpec(service_type='osd', service_id='')
1514+
)
1515+
)
15121516

15131517
return HandleCommandResult(stdout='\n'.join(run(host)))
15141518

src/pybind/mgr/cephadm/services/osd.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ async def create_single_host(self,
9595
raise RuntimeError(
9696
'cephadm exited with an error code: %d, stderr:%s' % (
9797
code, '\n'.join(err)))
98-
return await self.deploy_osd_daemons_for_existing_osds(host, drive_group.service_name(),
98+
return await self.deploy_osd_daemons_for_existing_osds(host, drive_group,
9999
replace_osd_ids)
100100

101-
async def deploy_osd_daemons_for_existing_osds(self, host: str, service_name: str,
101+
async def deploy_osd_daemons_for_existing_osds(self, host: str, spec: DriveGroupSpec,
102102
replace_osd_ids: Optional[List[str]] = None) -> str:
103103

104104
if replace_osd_ids is None:
@@ -142,11 +142,12 @@ async def deploy_osd_daemons_for_existing_osds(self, host: str, service_name: st
142142
continue
143143

144144
created.append(osd_id)
145-
daemon_spec: CephadmDaemonDeploySpec = CephadmDaemonDeploySpec(
146-
service_name=service_name,
145+
daemon_spec: CephadmDaemonDeploySpec = self.make_daemon_spec(
146+
spec=spec,
147147
daemon_id=str(osd_id),
148148
host=host,
149149
daemon_type='osd',
150+
network='', # required arg but only really needed for mons
150151
)
151152
daemon_spec.final_config, daemon_spec.deps = self.generate_config(daemon_spec)
152153
await CephadmServe(self.mgr)._create_daemon(
@@ -183,11 +184,12 @@ async def deploy_osd_daemons_for_existing_osds(self, host: str, service_name: st
183184
continue
184185

185186
created.append(osd_id)
186-
daemon_spec = CephadmDaemonDeploySpec(
187-
service_name=service_name,
187+
daemon_spec = self.make_daemon_spec(
188+
spec=spec,
188189
daemon_id=osd_id,
189190
host=host,
190191
daemon_type='osd',
192+
network='', # required arg but only really needed for mons
191193
)
192194
daemon_spec.final_config, daemon_spec.deps = self.generate_config(daemon_spec)
193195
await CephadmServe(self.mgr)._create_daemon(

0 commit comments

Comments
 (0)