summaryrefslogtreecommitdiffstats
path: root/deploy/tempest.py
diff options
context:
space:
mode:
authorAlex Yang <yangyang1@zte.com.cn>2017-07-29 20:29:52 +0800
committerAlex Yang <yangyang1@zte.com.cn>2017-07-31 15:35:11 +0800
commitb35baf61e48a1d2aff88e7c3e100aa996422d849 (patch)
treeded0fe80802a336d1729f607baadac9a90e3b5e5 /deploy/tempest.py
parente47fc2d62d07633c1883253d42f8e2cade35e868 (diff)
Correct the mapping of nodes and roles in virtual deploy
JIRA: DAISY-56 Now the roles are assigned to nodes randomly, because the function 'add_hosts_interface' in tempest.py just uses zip to map the host's name to the host. libvirt_utils.py: get mac addresses from VM environment.py: save the mac addresses daisy_server.py: write a new deploy.yml which contains the mac addresses and copy the file to daisy server get_conf.py: get mac addresses from the new deploy.yml tempest.py: assigned roles to nodes when the mac addresses matched controller.xml: increase the RAM to make difference with computer nodes deploy.sh: apply this change to bash script Change-Id: Ia61b60d39d319c5d01e3505727fafc63a0585858 Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
Diffstat (limited to 'deploy/tempest.py')
-rw-r--r--deploy/tempest.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/deploy/tempest.py b/deploy/tempest.py
index ebd040ba..3c1a6c7d 100644
--- a/deploy/tempest.py
+++ b/deploy/tempest.py
@@ -68,7 +68,7 @@ def prepare_install():
print("get config...")
conf = cfg.ConfigOpts()
parse(conf, sys.argv[1:])
- host_interface_map, hosts_name, network_map, vip, ceph_disk_name = \
+ host_interface_map, hosts_name, network_map, vip, ceph_disk_name, mac_address_map = \
get_conf.config(conf['dha'], conf['network'])
if conf['cluster'] and conf['cluster'] == 'yes':
print("add cluster...")
@@ -90,7 +90,7 @@ def prepare_install():
hosts_info = get_hosts()
cluster_info = get_cluster()
cluster_id = cluster_info.id
- add_hosts_interface(cluster_id, hosts_info, hosts_name,
+ add_hosts_interface(cluster_id, hosts_info, hosts_name, mac_address_map,
host_interface_map, vip, isbare)
if len(hosts_name) == 1:
protocol_type = 'LVM'
@@ -183,7 +183,8 @@ def get_cluster():
return cluster_info
-def add_hosts_interface(cluster_id, hosts_info, hosts_name, host_interface_map,
+def add_hosts_interface(cluster_id, hosts_info, hosts_name, mac_address_map,
+ host_interface_map,
vip, isbare):
for host_name, host in zip(hosts_name, hosts_info):
host = host.to_dict()
@@ -196,6 +197,10 @@ def add_hosts_interface(cluster_id, hosts_info, hosts_name, host_interface_map,
if interface_name in host_interface_map:
interface['assigned_networks'] = \
host_interface_map[interface_name]
+ if mac_address_map:
+ for nodename in mac_address_map:
+ if interface['mac'] in mac_address_map[nodename]:
+ host_name = nodename
pathlist = os.listdir(iso_path)
for filename in pathlist:
if filename.endswith('iso'):