summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhouya <zhou.ya@zte.com.cn>2017-08-26 14:50:59 +0800
committerzhouya <zhou.ya@zte.com.cn>2017-08-26 19:32:24 +0800
commitf3ad3936a5d395ecb31849835e6517bdc5de8d59 (patch)
treefc503e5ee16ba2c41e683952a3bfb08203b87d7d
parent6073849ebbb7f390bc43e620ea1be7a0aa8db251 (diff)
revert build_pxe_for_discover function to build pxe server
In case of deploy failed with deploy.sh file without reinstall daisy node, we need to resetup DHCP in tempest.py script Change-Id: Ia7b4de7933bf4957226a2bf0965858a555f0ed54 Signed-off-by: zhouya <zhou.ya@zte.com.cn>
-rw-r--r--deploy/daisy.conf2
-rw-r--r--deploy/tempest.py20
-rw-r--r--docs/release/configguide/installerconfig.rst4
3 files changed, 22 insertions, 4 deletions
diff --git a/deploy/daisy.conf b/deploy/daisy.conf
index fe48925f..1a41c516 100644
--- a/deploy/daisy.conf
+++ b/deploy/daisy.conf
@@ -16,7 +16,7 @@ os_install_type=pxe
[PXE]
#Set to 'yes' if you want to build a PXE server, otherwise to 'no'.
-build_pxe=yes
+build_pxe=no
#the nic name, to build a PXE server on this nic.
eth_name=ens3
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"}
diff --git a/docs/release/configguide/installerconfig.rst b/docs/release/configguide/installerconfig.rst
index f6a01b71..10fa9ad8 100644
--- a/docs/release/configguide/installerconfig.rst
+++ b/docs/release/configguide/installerconfig.rst
@@ -28,9 +28,7 @@ daisy.conf file.Then put the right configured daisy.conf file in the
3. "os_install_type" field just support "pxe" for now.
-4. Daisy now use pxe server to install the os, so "build_pxe" must set to "yes".
- If the value in daisy.conf in your env of /home/daisy_install/ dir is "no",
- you must change this field to "yes" manually before installing Daisy.
+4. Daisy now use pxe server to install the os, the "build_pxe" item must set to "no".
5. "eth_name" field is the pxe server interface, and this field is required when
the "build_pxe" field set to "yes".This should be set to the interface