Skip to content

Commit cb0d9c4

Browse files
authored
Merge pull request ceph#62585 from adk3798/block-nvmeof-deployment-all-groups
mgr/cephadm: block deploying nvmeof daemons on the same host Reviewed-by: John Mulligan <[email protected]>
2 parents 5419b42 + 40a9bbb commit cb0d9c4

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,18 +251,15 @@ def post_remove(self, daemon: DaemonDescription, is_failed_deploy: bool) -> None
251251
self.mgr.log.error(f"Unable to send monitor command {cmd}, error {err}")
252252

253253
def get_blocking_daemon_hosts(self, service_name: str) -> List[HostSpec]:
254-
# we should not deploy nvmeof daemons on hosts that have nvmeof daemons
255-
# from services with a different "group" attribute (as recommended by
256-
# the nvmeof team)
254+
# we should not deploy nvmeof daemons on hosts that already have nvmeof daemons
257255
spec = cast(NvmeofServiceSpec, self.mgr.spec_store[service_name].spec)
258-
nvmeof_group = cast(NvmeofServiceSpec, spec).group
259256
blocking_daemons: List[DaemonDescription] = []
260-
other_group_nvmeof_services = [
257+
other_nvmeof_services = [
261258
nspec for nspec in self.mgr.spec_store.get_specs_by_type('nvmeof').values()
262-
if cast(NvmeofServiceSpec, nspec).group != nvmeof_group
259+
if nspec.service_name() != spec.service_name()
263260
]
264-
for other_group_nvmeof_service in other_group_nvmeof_services:
265-
blocking_daemons += self.mgr.cache.get_daemons_by_service(other_group_nvmeof_service.service_name())
261+
for other_nvmeof_service in other_nvmeof_services:
262+
blocking_daemons += self.mgr.cache.get_daemons_by_service(other_nvmeof_service.service_name())
266263
blocking_daemon_hosts = [
267264
HostSpec(hostname=blocking_daemon.hostname)
268265
for blocking_daemon in blocking_daemons if blocking_daemon.hostname is not None

0 commit comments

Comments
 (0)