diff options
Diffstat (limited to 'deploy/tempest.py')
-rw-r--r-- | deploy/tempest.py | 29 |
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: |