build_pxe_for_discover(cluster_id, client, deployment_interface)
elif conf['host'] and conf['host'] == 'yes':
isbare = False if 'isbare' in conf and conf['isbare'] == 0 else True
+ enable_dpdk = True if 'scenario' in conf and 'ovs_dpdk' in conf['scenario'] else False
print("discover host...")
discover_host(hosts_name, client)
time.sleep(10)
hosts_info = get_hosts(client)
cluster_info = get_cluster(client)
cluster_id = cluster_info.id
- add_hosts_interface(cluster_id, hosts_info, mac_address_map,
- host_interface_map, vip, isbare, client)
+ update_hosts_interface(cluster_id, hosts_info, mac_address_map,
+ host_interface_map, vip, isbare, client, enable_dpdk)
if len(hosts_name) == 1:
protocol_type = 'LVM'
service_name = 'cinder'
return cluster_info
-def add_hosts_interface(cluster_id, hosts_info, mac_address_map,
- host_interface_map,
- vip, isbare, client):
+def update_hosts_interface(cluster_id, hosts_info, mac_address_map,
+ host_interface_map, vip,
+ isbare, client, enable_dpdk):
for host in hosts_info:
dha_host_name = None
host = host.to_dict()
if interface_name in host_interface_map:
interface['assigned_networks'] = \
host_interface_map[interface_name]
+ if enable_dpdk:
+ for assigned_network in interface['assigned_networks']:
+ if assigned_network['name'] == 'physnet1':
+ interface['vswitch_type'] = 'dvs'
+ break
for nodename in mac_address_map:
if interface['mac'] in mac_address_map[nodename]:
dha_host_name = nodename
host['os_version'] = iso_path + filename
if host['os_version'] == iso_path:
print("do not have os iso file in /var/lib/daisy/kolla/.")
+ if enable_dpdk:
+ host['hugepages'] = '20'
+ host['hugepagesize'] = '1G'
client.hosts.update(host['id'], **host)
+ host_info = client.hosts.get(host['id']).to_dict()
+ if host_info.get('suggest_dvsc_cpus') and host_info['suggest_dvsc_cpus'][0] > 0:
+ host_isolcpus = {'isolcpus': host_info['suggest_dvsc_cpus']}
+ client.hosts.update(host['id'], **host_isolcpus)
print("update role...")
add_host_role(cluster_id, host['id'], dha_host_name, vip, client)
update_network,
get_hosts,
get_cluster,
- add_hosts_interface,
+ update_hosts_interface,
add_host_role,
enable_cinder_backend,
enable_opendaylight
@pytest.mark.parametrize('isbare', [
(False), (True)])
-def test_add_hosts_interface(isbare, tmpdir):
+def test_update_hosts_interface(isbare, tmpdir):
res_old_val = deploy.tempest.iso_path
deploy.tempest.iso_path = os.path.join(tmpdir.dirname, tmpdir.basename) + '/'
iso_file_path = os.path.join(deploy.tempest.iso_path, 'test_os.iso')
{'ip': '', 'name': 'physnet1'}],
'ens9': [{'ip': '', 'name': 'HEARTBEAT'}]}
vip = '10.20.11.11'
- add_hosts_interface(1, hosts_info, mac_address_map,
- host_interface_map,
- vip, isbare, client)
+ update_hosts_interface(1, hosts_info, mac_address_map,
+ host_interface_map,
+ vip, isbare, client, True)
deploy.tempest.iso_path = res_old_val
if isbare:
assert client.hosts.get(host_id1).metadata == {
'ipmi_user': 'zteroot', 'ipmi_passwd': 'superuser',
'interfaces': [{'name': 'ens8', 'mac': '11:11:11:11:11:11',
'assigned_networks': [{'ip': '', 'name': 'EXTERNAL'}]}],
+ 'hugepagesize': '1G',
+ 'hugepages': '20',
}
assert client.hosts.get(host_id2).metadata == {
'id': host_id2, 'name': 'controller02', 'cluster_id': cluster_id,
{'ip': '', 'name': 'MANAGEMENT'},
{'ip': '', 'name': 'PUBLICAPI'},
{'ip': '', 'name': 'STORAGE'},
- {'ip': '', 'name': 'physnet1'}]}],
+ {'ip': '', 'name': 'physnet1'}],
+ 'vswitch_type': 'dvs'}],
+ 'hugepagesize': '1G',
+ 'hugepages': '20',
}
assert client.hosts.get(host_id3).metadata == {
'id': host_id3, 'name': 'computer01', 'cluster_id': cluster_id,
'ipmi_user': 'zteroot', 'ipmi_passwd': 'superuser',
'interfaces': [{'name': 'ens9', 'mac': '33:33:33:33:33:33',
'assigned_networks': [{'ip': '', 'name': 'HEARTBEAT'}]}],
+ 'hugepagesize': '1G',
+ 'hugepages': '20',
}
else:
assert client.hosts.get(host_id1).metadata == {
'cluster': cluster_id, 'os_version': iso_file_path,
'interfaces': [{'name': 'ens8', 'mac': '11:11:11:11:11:11',
'assigned_networks': [{'ip': '', 'name': 'EXTERNAL'}]}],
+ 'hugepagesize': '1G',
+ 'hugepages': '20',
}
assert client.hosts.get(host_id2).metadata == {
'id': host_id2, 'name': 'controller02', 'cluster_id': cluster_id,
{'ip': '', 'name': 'MANAGEMENT'},
{'ip': '', 'name': 'PUBLICAPI'},
{'ip': '', 'name': 'STORAGE'},
- {'ip': '', 'name': 'physnet1'}]}],
+ {'ip': '', 'name': 'physnet1'}],
+ 'vswitch_type': 'dvs'}],
+ 'hugepagesize': '1G',
+ 'hugepages': '20',
}
assert client.hosts.get(host_id3).metadata == {
'id': host_id3, 'name': 'computer01', 'cluster_id': cluster_id,
'cluster': cluster_id, 'os_version': iso_file_path,
'interfaces': [{'name': 'ens9', 'mac': '33:33:33:33:33:33',
'assigned_networks': [{'ip': '', 'name': 'HEARTBEAT'}]}],
+ 'hugepagesize': '1G',
+ 'hugepages': '20',
}
tmpdir.remove()