]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #42772 from Daniel-Pivonka/cephadm-add-existing-host
authorSebastian Wagner <sewagner@redhat.com>
Wed, 20 Oct 2021 09:49:33 +0000 (11:49 +0200)
committerGitHub <noreply@github.com>
Wed, 20 Oct 2021 09:49:33 +0000 (11:49 +0200)
mgr/cephadm: update host when adding host that already exists

Reviewed-by: Adam King <adking@redhat.com>
Reviewed-by: Sebastian Wagner <sewagner@redhat.com>
1  2 
src/pybind/mgr/cephadm/inventory.py
src/pybind/mgr/cephadm/module.py

Simple merge
index f48bb3693571fb3b5a6dca6a960b4abbac4a76c4,c6fddc271b795f6dce4b43e5e11ec4f5f6fc59f5..14f10af8095a76d4b15f0326198e337623c20377
@@@ -1277,7 -1378,31 +1277,12 @@@ class CephadmOrchestrator(orchestrator.
  
          return image
  
 -    def _schedulable_hosts(self) -> List[HostSpec]:
 -        """
 -        Returns all usable hosts that went through _refresh_host_daemons().
 -
 -        This mitigates a potential race, where new host was added *after*
 -        ``_refresh_host_daemons()`` was called, but *before*
 -        ``_apply_all_specs()`` was called. thus we end up with a hosts
 -        where daemons might be running, but we have not yet detected them.
 -        """
 -        return [
 -            h for h in self.inventory.all_specs()
 -            if (
 -                self.cache.host_had_daemon_refresh(h.hostname)
 -                and h.status.lower() not in ['maintenance', 'offline']
 -                and h.hostname not in self.offline_hosts
 -                and '_no_schedule' not in h.labels
 -            )
 -        ]
 -
      def _check_valid_addr(self, host: str, addr: str) -> str:
+         # make sure mgr is not resolving own ip
+         if addr in self.get_mgr_id():
+             raise OrchestratorError(
+                 "Can not automatically resolve ip address of host where active mgr is running. Please explicitly provide the address.")
          # make sure hostname is resolvable before trying to make a connection
          try:
              ip_addr = utils.resolve_ip(addr)