summaryrefslogtreecommitdiffstats
path: root/deploy/tempest.py
diff options
context:
space:
mode:
authorzhouya <zhou.ya@zte.com.cn>2017-03-16 09:36:20 +0800
committerzhouya <zhou.ya@zte.com.cn>2017-03-17 17:39:54 +0800
commit468567824ebdc6a64fb62be4962fd7d75e9c9a20 (patch)
treebd15a0232bb2d4736c099ba70b76326f6439f1ac /deploy/tempest.py
parente4485f2bb507a77012e4d21bd63357ef04b1d204 (diff)
distinguish virtual and bm deploy
Change-Id: I9fcc4f08283c832d32c22c2195401dd86ecf9dc5 Signed-off-by: zhouya <zhou.ya@zte.com.cn>
Diffstat (limited to 'deploy/tempest.py')
-rw-r--r--deploy/tempest.py29
1 files changed, 22 insertions, 7 deletions
diff --git a/deploy/tempest.py b/deploy/tempest.py
index f01aa77b..6e626c71 100644
--- a/deploy/tempest.py
+++ b/deploy/tempest.py
@@ -31,7 +31,9 @@ _CLI_OPTS = [
help='Config cluster'),
cfg.StrOpt('host',
help='Config host'),
- cfg.IntOpt('env',
+ cfg.StrOpt('install',
+ help='install daisy'),
+ cfg.IntOpt('isbare',
help='deploy environment'),
]
@@ -86,10 +88,14 @@ def prepare_install():
cluster_id = cluster_info.id
add_hosts_interface(cluster_id, hosts_info, hosts_name,
host_interface_map, vip)
- if 'env' in conf and conf['env'] == 0:
- build_pxe_without_ipmi(cluster_id)
+ if 'isbare' in conf and conf['isbare'] == 0:
+ install_os_for_vm_step1(cluster_id)
else:
- build_pxe_with_ipmi(cluster_id)
+ print("daisy baremetal deploy start")
+ install_os_for_bm_oneshot(cluster_id)
+ elif conf['install'] and conf['install'] == 'yes':
+ install_os_for_vm_step2(cluster_id)
+
except Exception:
print("Deploy failed!!!.%s." % traceback.format_exc())
else:
@@ -102,15 +108,22 @@ def build_pxe_for_discover(cluster_id):
client.install.install(**cluster_meta)
-def build_pxe_without_ipmi(cluster_id):
+def install_os_for_vm_step1(cluster_id):
cluster_meta = {'cluster_id': cluster_id,
'pxe_only': "true"}
client.install.install(**cluster_meta)
-def build_pxe_with_ipmi(cluster_id):
+def install_os_for_bm_oneshot(cluster_id):
+ cluster_meta = {'cluster_id': cluster_id,
+ 'pxe_only': "false",
+ 'skip_pxe_ipmi': "false"}
+ client.install.install(**cluster_meta)
+
+
+def install_os_for_vm_step2(cluster_id):
cluster_meta = {'cluster_id': cluster_id,
- 'pxe_only': "false"}
+ 'skip_pxe_ipmi': "true"}
client.install.install(**cluster_meta)
@@ -159,6 +172,8 @@ def add_hosts_interface(cluster_id, hosts_info, hosts_name, host_interface_map,
for host_name, host in zip(hosts_name, hosts_info):
host = host.to_dict()
host['cluster'] = cluster_id
+ host['ipmi_user'] = 'zteroot'
+ host['ipmi_passwd'] = 'superuser'
for interface in host['interfaces']:
interface_name = interface['name']
if interface_name in host_interface_map: