summaryrefslogtreecommitdiffstats
path: root/deploy/tempest.py
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/tempest.py')
-rw-r--r--deploy/tempest.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/deploy/tempest.py b/deploy/tempest.py
index 9117a187..1cc00c19 100644
--- a/deploy/tempest.py
+++ b/deploy/tempest.py
@@ -15,10 +15,13 @@ import get_conf
import traceback
import time
import os
+import ConfigParser
daisy_version = 1.0
daisyrc_path = "/root/daisyrc_admin"
+daisy_conf_path = "/home/daisy_install/daisy.conf"
iso_path = "/var/lib/daisy/kolla/"
+deployment_interface = "ens3"
cluster_name = "clustertest"
_CLI_OPTS = [
@@ -51,6 +54,13 @@ def print_bar(msg):
print ("--------------------------------------------")
+def get_configure_from_daisyconf(section, key):
+ config = ConfigParser.ConfigParser()
+ config.read(daisy_conf_path)
+ option_value = config.get(section, key)
+ return option_value
+
+
def get_endpoint(file_path):
for line in open(file_path):
if 'OS_ENDPOINT' in line:
@@ -64,6 +74,7 @@ client = daisy_client.Client(version=daisy_version, endpoint=daisy_endpoint)
def prepare_install():
+ global deployment_interface
try:
print("get config...")
conf = cfg.ConfigOpts()
@@ -79,6 +90,9 @@ def prepare_install():
print("cluster_id=%s." % cluster_id)
print("update network...")
update_network(cluster_id, network_map)
+ print("build pxe server to install os...")
+ deployment_interface = get_configure_from_daisyconf("PXE", "eth_name")
+ build_pxe_for_discover(cluster_id)
elif conf['host'] and conf['host'] == 'yes':
isbare = False if 'isbare' in conf and conf['isbare'] == 0 else True
print("discover host...")
@@ -125,6 +139,12 @@ def prepare_install():
print_bar("Everything is done!")
+def build_pxe_for_discover(cluster_id):
+ cluster_meta = {'cluster_id': cluster_id,
+ 'deployment_interface': deployment_interface}
+ client.install.install(**cluster_meta)
+
+
def install_os_for_vm_step1(cluster_id):
cluster_meta = {'cluster_id': cluster_id,
'pxe_only': "true"}