Skip to content

Commit 40a9bbb

Browse files
committed
mgr/cephadm: block deploying nvmeof daemons on the same host
Previously, we had added a commit to block deploying nvmeof daemons on hosts with other nvmeof daemons that share a group. However, after discussion with the nvmeof team, they'd prefer we blocking co-locating nvmeof daemon entirely Signed-off-by: Adam King <[email protected]>
1 parent 3222cb8 commit 40a9bbb

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)