diff options
author | Alex Yang <yangyang1@zte.com.cn> | 2017-07-29 20:29:52 +0800 |
---|---|---|
committer | Alex Yang <yangyang1@zte.com.cn> | 2017-07-31 15:35:11 +0800 |
commit | b35baf61e48a1d2aff88e7c3e100aa996422d849 (patch) | |
tree | ded0fe80802a336d1729f607baadac9a90e3b5e5 /deploy/get_conf.py | |
parent | e47fc2d62d07633c1883253d42f8e2cade35e868 (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/get_conf.py')
-rwxr-xr-x | deploy/get_conf.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/deploy/get_conf.py b/deploy/get_conf.py index ca9e2cf6..1f4500a4 100755 --- a/deploy/get_conf.py +++ b/deploy/get_conf.py @@ -81,6 +81,13 @@ def host(host=None): return map +@decorator_mk('hosts') +def mac_address(host=None): + mac_addresses = host.get('mac_addresses', []) + map = {host['name']: mac_addresses} + return map + + def network_config_parse(s, dha_file): network_map = network(s) vip = s.get('internal_vip') @@ -100,9 +107,10 @@ def config(dha_file, network_file): data = init(dha_file) ceph_disk_name = data.get('ceph_disk_name') hosts_name = dha_config_parse(data, dha_file) + mac_address_map = mac_address(data) data = init(network_file) network_map, vip, interface_map = network_config_parse(data, network_file) - return interface_map, hosts_name, network_map, vip, ceph_disk_name + return interface_map, hosts_name, network_map, vip, ceph_disk_name, mac_address_map def parse(conf, args): |