def start_additional_servers(self, additional_servers, index=0): """Start additional servers. This method can be used to start a new daos_server during a test. Args: additional_servers (list of str): List of hostnames to start daos_server. index (int): Determines which server_managers to use when creating the new server. """ self.server_managers.append( DaosServerManager(self.server_managers[index].manager.job, self.manager_class, self.server_managers[index].dmg.yaml)) self.server_managers[-1].manager.assign_environment( EnvironmentVariables({"PATH": None}), True) self.server_managers[-1].hosts = (additional_servers, self.workdir, self.hostfile_servers_slots) self.log.info("Starting %s: group=%s, hosts=%s, config=%s", "server", self.server_managers[-1].get_config_value("name"), self.server_managers[-1].hosts, self.server_managers[-1].get_config_value("filename")) self.server_managers[-1].verify_socket_directory(getuser()) self.server_managers[-1].start()
def add_server_manager(self, config_file=None, dmg_config_file=None, common_cfg=None, timeout=20): """Add a new daos server manager object to the server manager list. When adding multiple server managers unique yaml config file names and common config setting (due to the server group name) should be used. Args: config_file (str, optional): daos server config file name. Defaults to None, which will use a default file name. dmg_config_file (str, optional): dmg config file name. Defaults to None, which will use a default file name. common_cfg (CommonConfig, optional): daos server config file settings shared between the agent and server. Defaults to None, which uses the class CommonConfig. timeout (int, optional): number of seconds to wait for the daos server to start before reporting an error. Defaults to 60. """ self.log.info("--- ADDING SERVER MANAGER ---") # Setup defaults if config_file is None: config_file = self.get_config_file("daos", "server") if common_cfg is None: common_cfg = CommonConfig( self.server_group, DaosServerTransportCredentials(self.workdir)) if dmg_config_file is None: dmg_config_file = self.get_config_file("daos", "dmg") transport_dmg = DmgTransportCredentials(self.workdir) dmg_cfg = DmgYamlParameters(dmg_config_file, self.server_group, transport_dmg) # Create a ServerCommand to manage with a new ServerManager object server_cfg = DaosServerYamlParameters(config_file, common_cfg) server_cmd = DaosServerCommand(self.bin, server_cfg, timeout) self.server_managers.append( DaosServerManager(server_cmd, self.manager_class, dmg_cfg))