def _get_cluster_hosts_information(host, cluster): for c in conductor.cluster_get_all(context.ctx()): if c.id == cluster.id: continue for i in u.get_instances(c): if i.instance_name == host: return g.generate_etc_hosts(c) return None
def _configure_instances(self, cluster): """Configure active instances. * generate /etc/hosts * setup passwordless login * etc. """ hosts_file = g.generate_etc_hosts(cluster) with context.ThreadGroup() as tg: for node_group in cluster.node_groups: for instance in node_group.instances: tg.spawn("configure-instance-%s" % instance.instance_name, self._configure_instance, instance, hosts_file)