Example #1
0
 def gen_client_user_data(self, test_mode):
     LOG.info("Preparing metadata for VMs... (Client)")
     client_list = self.testing_kloud.get_all_instances()
     KBScheduler.setup_vm_placement('Client', client_list, self.topology,
                                    self.testing_kloud.placement_az, "Round-robin")
     if test_mode != 'storage':
         role = 'HTTP_Client' if test_mode == 'http' else 'Multicast_Client'
         algo = '1:1' if test_mode == 'http' else '1:n'
         server_list = self.kloud.get_all_instances()
         clocks = " ".join(self.client_cfg['multicast_tool_configs']['ntp_clocks'])
         KBScheduler.setup_vm_mappings(client_list, server_list, algo)
         for idx, ins in enumerate(client_list):
             ins.user_data['role'] = role
             ins.user_data['vm_name'] = ins.vm_name
             ins.user_data['redis_server'] = self.kb_proxy.fixed_ip
             ins.user_data['redis_server_port'] = 6379
             ins.user_data['target_subnet_ip'] = server_list[idx].subnet_ip
             ins.user_data['target_shared_interface_ip'] = server_list[idx].shared_interface_ip
             if role == 'Multicast_Client':
                 ins.user_data['ntp_clocks'] = clocks
             ins.boot_info['flavor_type'] = 'KB.client' if \
                 not self.tenants_list['client'] else self.testing_kloud.flavor_to_use
             ins.boot_info['user_data'] = str(ins.user_data)
     else:
         for idx, ins in enumerate(client_list):
             ins.user_data['role'] = 'Storage_Client'
             ins.user_data['vm_name'] = ins.vm_name
             ins.user_data['redis_server'] = self.kb_proxy.fixed_ip
             ins.user_data['redis_server_port'] = 6379
             ins.boot_info['flavor_type'] = 'KB.client' if \
                 not self.tenants_list['client'] else self.testing_kloud.flavor_to_use
             ins.boot_info['user_data'] = str(ins.user_data)
Example #2
0
 def gen_client_user_data(self, test_mode):
     LOG.info("Preparing metadata for VMs... (Client)")
     client_list = self.testing_kloud.get_all_instances()
     KBScheduler.setup_vm_placement('Client', client_list, self.topology,
                                    self.testing_kloud.placement_az,
                                    "Round-robin")
     if test_mode != 'storage':
         role = 'HTTP_Client' if test_mode == 'http' else 'Multicast_Client'
         algo = '1:1' if test_mode == 'http' else '1:n'
         server_list = self.kloud.get_all_instances()
         clocks = " ".join(
             self.client_cfg['multicast_tool_configs']['ntp_clocks'])
         KBScheduler.setup_vm_mappings(client_list, server_list, algo)
         for idx, ins in enumerate(client_list):
             ins.user_data['role'] = role
             ins.user_data['vm_name'] = ins.vm_name
             ins.user_data['redis_server'] = self.kb_proxy.fixed_ip
             ins.user_data['redis_server_port'] = 6379
             ins.user_data['target_subnet_ip'] = server_list[idx].subnet_ip
             ins.user_data['target_shared_interface_ip'] = server_list[
                 idx].shared_interface_ip
             if role == 'Multicast_Client':
                 ins.user_data['ntp_clocks'] = clocks
             ins.boot_info['flavor_type'] = FLAVOR_KB_CLIENT
             ins.boot_info['user_data'] = str(ins.user_data)
     else:
         for idx, ins in enumerate(client_list):
             ins.user_data['role'] = 'Storage_Client'
             ins.user_data['vm_name'] = ins.vm_name
             ins.user_data['redis_server'] = self.kb_proxy.fixed_ip
             ins.user_data['redis_server_port'] = 6379
             ins.boot_info['flavor_type'] = FLAVOR_KB_CLIENT
             ins.boot_info['user_data'] = str(ins.user_data)
Example #3
0
 def gen_server_user_data(self, test_mode):
     LOG.info("Preparing metadata for VMs... (Server)")
     server_list = self.kloud.get_all_instances()
     idx = 0
     KBScheduler.setup_vm_placement('Server', server_list, self.topology,
                                    self.kloud.placement_az, "Round-robin")
     if test_mode == 'http':
         for ins in server_list:
             ins.user_data['role'] = 'HTTP_Server'
             ins.user_data['http_server_configs'] = ins.config[
                 'http_server_configs']
             ins.boot_info['flavor_type'] = FLAVOR_KB_SERVER
             ins.boot_info['user_data'] = str(ins.user_data)
     elif test_mode == 'multicast':
         # Nuttcp tests over first /25
         # Multicast Listeners over second /25
         mc_ad_st = self.client_cfg['multicast_tool_configs'][
             'multicast_address_start']
         listener_addr_start = mc_ad_st.split(".")
         listener_addr_start[-1] = "128"
         naddrs = self.client_cfg['multicast_tool_configs']['addresses'][-1]
         clocks = " ".join(
             self.client_cfg['multicast_tool_configs']['ntp_clocks'])
         nports = self.client_cfg['multicast_tool_configs']['ports'][-1]
         cfgs = self.client_cfg['multicast_tool_configs']
         listener_addr_start = ".".join(listener_addr_start)
         for ins in server_list:
             ins.user_data['role'] = 'Multicast_Server'
             ins.user_data['n_id'] = idx
             idx += 1
             ins.user_data['multicast_server_configs'] = cfgs
             ins.user_data['multicast_addresses'] = naddrs
             ins.user_data['multicast_ports'] = nports
             ins.user_data['multicast_start_address'] = mc_ad_st
             ins.user_data[
                 'multicast_listener_address_start'] = listener_addr_start
             ins.user_data['ntp_clocks'] = clocks
             ins.user_data[
                 'pktsizes'] = self.client_cfg.multicast_tool_configs.pktsizes
             ins.boot_info['flavor_type'] = FLAVOR_KB_SERVER
             ins.boot_info['user_data'] = str(ins.user_data)
Example #4
0
 def gen_user_data(self, role):
     LOG.info("Preparing metadata for VMs... (%s)" % role)
     if role == "Server":
         svr_list = self.kloud.get_all_instances()
         KBScheduler.setup_vm_placement(role, svr_list, self.topology,
                                        self.kloud.placement_az, "Round-robin")
         for ins in svr_list:
             ins.user_data['role'] = 'Server'
             ins.boot_info['flavor_type'] = 'kb.server' if \
                 not self.tenants_list['server'] else self.kloud.flavor_to_use
             ins.boot_info['user_data'] = str(ins.user_data)
     elif role == "Client":
         client_list = self.testing_kloud.get_all_instances()
         svr_list = self.kloud.get_all_instances()
         KBScheduler.setup_vm_mappings(client_list, svr_list, "1:1")
         KBScheduler.setup_vm_placement(role, client_list, self.topology,
                                        self.testing_kloud.placement_az, "Round-robin")
         for idx, ins in enumerate(client_list):
             ins.user_data['role'] = 'Client'
             ins.user_data['vm_name'] = ins.vm_name
             ins.user_data['redis_server'] = self.kb_proxy.fixed_ip
             ins.user_data['redis_server_port'] = 6379
             ins.user_data['target_subnet_ip'] = svr_list[idx].subnet_ip
             ins.user_data['target_shared_interface_ip'] = svr_list[idx].shared_interface_ip
             ins.user_data['http_tool'] = ins.config['http_tool']
             ins.user_data['http_tool_configs'] = ins.config['http_tool_configs']
             ins.boot_info['flavor_type'] = 'kb.client' if \
                 not self.tenants_list['client'] else self.testing_kloud.flavor_to_use
             ins.boot_info['user_data'] = str(ins.user_data)
Example #5
0
 def gen_server_user_data(self, test_mode):
     LOG.info("Preparing metadata for VMs... (Server)")
     server_list = self.kloud.get_all_instances()
     idx = 0
     KBScheduler.setup_vm_placement('Server', server_list, self.topology,
                                    self.kloud.placement_az, "Round-robin")
     if test_mode == 'http':
         for ins in server_list:
             ins.user_data['role'] = 'HTTP_Server'
             ins.user_data['http_server_configs'] = ins.config['http_server_configs']
             ins.boot_info['flavor_type'] = 'KB.server' if \
                 not self.tenants_list['server'] else self.kloud.flavor_to_use
             ins.boot_info['user_data'] = str(ins.user_data)
     elif test_mode == 'multicast':
         # Nuttcp tests over first /25
         # Multicast Listeners over second /25
         mc_ad_st = self.client_cfg['multicast_tool_configs']['multicast_address_start']
         listener_addr_start = mc_ad_st.split(".")
         listener_addr_start[-1] = "128"
         naddrs = self.client_cfg['multicast_tool_configs']['addresses'][-1]
         clocks = " ".join(self.client_cfg['multicast_tool_configs']['ntp_clocks'])
         nports = self.client_cfg['multicast_tool_configs']['ports'][-1]
         cfgs = self.client_cfg['multicast_tool_configs']
         listener_addr_start = ".".join(listener_addr_start)
         for ins in server_list:
             ins.user_data['role'] = 'Multicast_Server'
             ins.user_data['n_id'] = idx
             idx += 1
             ins.user_data['multicast_server_configs'] = cfgs
             ins.user_data['multicast_addresses'] = naddrs
             ins.user_data['multicast_ports'] = nports
             ins.user_data['multicast_start_address'] = mc_ad_st
             ins.user_data['multicast_listener_address_start'] = listener_addr_start
             ins.user_data['ntp_clocks'] = clocks
             ins.user_data['pktsizes'] = self.client_cfg.multicast_tool_configs.pktsizes
             ins.boot_info['flavor_type'] = 'KB.server' if \
                 not self.tenants_list['server'] else self.kloud.flavor_to_use
             ins.boot_info['user_data'] = str(ins.user_data)