summaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
Diffstat (limited to 'deploy')
-rw-r--r--deploy/config/vm_environment/zte-virtual2/network.yml8
-rw-r--r--deploy/daisy.conf2
-rw-r--r--deploy/deploy.py78
-rw-r--r--deploy/tempest.py20
4 files changed, 58 insertions, 50 deletions
diff --git a/deploy/config/vm_environment/zte-virtual2/network.yml b/deploy/config/vm_environment/zte-virtual2/network.yml
index 7b4a501c..0bbbae80 100644
--- a/deploy/config/vm_environment/zte-virtual2/network.yml
+++ b/deploy/config/vm_environment/zte-virtual2/network.yml
@@ -46,12 +46,6 @@ networks:
- start: '10.20.11.3'
end: '10.20.11.10'
name: 'TENANT'
- - cidr: '100.20.11.0/24'
- gateway: '100.20.11.1'
- ip_ranges:
- - start: '100.20.11.3'
- end: '100.20.11.10'
- name: 'HEARTBEAT'
interfaces:
- name: 'EXTERNAL'
interface: 'ens8'
@@ -63,7 +57,5 @@ interfaces:
interface: 'ens3'
- name: 'TENANT'
interface: 'ens3'
- - name: 'HEARTBEAT'
- interface: 'ens9'
internal_vip: '10.20.11.11'
public_vip: '10.20.11.11'
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/deploy.py b/deploy/deploy.py
index e8c9434b..71c39742 100644
--- a/deploy/deploy.py
+++ b/deploy/deploy.py
@@ -52,34 +52,31 @@ from environment import (
class DaisyDeployment(object):
- def __init__(self, lab_name, pod_name, deploy_file, net_file, bin_file,
- daisy_only, cleanup_only, remote_dir, work_dir, storage_dir,
- pxe_bridge, deploy_log, scenario):
- self.lab_name = lab_name
- self.pod_name = pod_name
-
- self.src_deploy_file = deploy_file
- self.scenario = scenario
- self.deploy_struct = self._construct_final_deploy_conf(scenario)
- self.deploy_file, self.deploy_file_name = self._construct_final_deploy_file(self.deploy_struct, work_dir)
-
- if not cleanup_only:
- self.net_file = net_file
- self.net_file_name = os.path.basename(net_file)
- with open(net_file) as yaml_file:
+ def __init__(self, **kwargs):
+ self.lab_name = kwargs['lab_name']
+ self.pod_name = kwargs['pod_name']
+ self.src_deploy_file = kwargs['deploy_file']
+ self.net_file = kwargs['net_file']
+ self.bin_file = kwargs['bin_file']
+ self.daisy_only = kwargs['daisy_only']
+ self.cleanup_only = kwargs['cleanup_only']
+ self.remote_dir = kwargs['remote_dir']
+ self.work_dir = kwargs['work_dir']
+ self.storage_dir = kwargs['storage_dir']
+ self.pxe_bridge = kwargs['pxe_bridge']
+ self.deploy_log = kwargs['deploy_log']
+ self.scenario = kwargs['scenario']
+
+ self.deploy_struct = self._construct_final_deploy_conf(self.scenario)
+ self.deploy_file, self.deploy_file_name = self._construct_final_deploy_file(self.deploy_struct, self.work_dir)
+
+ if not self.cleanup_only:
+ self.net_file_name = os.path.basename(self.net_file)
+ with open(self.net_file) as yaml_file:
self.net_struct = yaml.safe_load(yaml_file)
else:
self.net_struct = None
- self.bin_file = bin_file
- self.daisy_only = daisy_only
- self.cleanup_only = cleanup_only
- self.remote_dir = remote_dir
- self.work_dir = work_dir
- self.storage_dir = storage_dir
- self.pxe_bridge = pxe_bridge
- self.deploy_log = deploy_log
-
result = deploy_schema_validate(self.deploy_struct)
if result:
LE(result)
@@ -209,16 +206,17 @@ class DaisyDeployment(object):
def config_arg_parser():
- parser = argparse.ArgumentParser()
+ parser = argparse.ArgumentParser(prog='python %s' % __file__,
+ description='NOTE: You need ROOT privilege to run this script.')
- parser.add_argument('-lab', dest='lab_name', action='store', nargs='?',
- default=None,
+ parser.add_argument('-lab', dest='lab_name', action='store',
+ default=None, required=True,
help='Lab Name')
- parser.add_argument('-pod', dest='pod_name', action='store', nargs='?',
- default=None,
+ parser.add_argument('-pod', dest='pod_name', action='store',
+ default=None, required=True,
help='Pod Name')
- parser.add_argument('-bin', dest='bin_file', action='store', nargs='?',
+ parser.add_argument('-bin', dest='bin_file', action='store',
default=path_join(WORKSPACE, 'opnfv.bin'),
help='OPNFV Daisy BIN File')
@@ -228,28 +226,25 @@ def config_arg_parser():
parser.add_argument('-co', dest='cleanup_only', action='store_true',
default=False,
help='Cleanup VMs and Virtual Networks')
- # parser.add_argument('-nd', dest='no_daisy', action='store_true',
- # default=False,
- # help='Do not install Daisy Server when it exists')
- parser.add_argument('-rdir', dest='remote_dir', action='store', nargs='?',
+ parser.add_argument('-rdir', dest='remote_dir', action='store',
default='/home/daisy',
help='Code directory on Daisy Server')
- parser.add_argument('-wdir', dest='work_dir', action='store', nargs='?',
+ parser.add_argument('-wdir', dest='work_dir', action='store',
default='/tmp/workdir',
help='Temporary working directory')
- parser.add_argument('-sdir', dest='storage_dir', action='store', nargs='?',
+ parser.add_argument('-sdir', dest='storage_dir', action='store',
default='/home/qemu/vms',
help='Storage directory for VM images')
- parser.add_argument('-B', dest='pxe_bridge', action='store', nargs='?',
+ parser.add_argument('-B', dest='pxe_bridge', action='store',
default='pxebr',
help='Linux Bridge for booting up the Daisy Server VM '
'[default: pxebr]')
- parser.add_argument('-log', dest='deploy_log', action='store', nargs='?',
+ parser.add_argument('-log', dest='deploy_log', action='store',
default=path_join(WORKSPACE, 'deploy.log'),
- help='Path and name of the deployment log file')
- parser.add_argument('-s', dest='scenario', action='store', nargs='?',
+ help='Deployment log file')
+ parser.add_argument('-s', dest='scenario', action='store',
default='os-nosdn-nofeature-noha',
help='Deployment scenario')
return parser
@@ -259,6 +254,8 @@ def parse_arguments():
parser = config_arg_parser()
args = parser.parse_args()
+ check_sudo_privilege()
+
save_log_to_file(args.deploy_log)
LI(args)
@@ -294,7 +291,6 @@ def parse_arguments():
def main():
- check_sudo_privilege()
kwargs = parse_arguments()
deploy = DaisyDeployment(**kwargs)
deploy.run()
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"}