from optparse import OptionParser
from jinja2 import Environment, FileSystemLoader
+from distutils.version import LooseVersion, StrictVersion
import os
+import subprocess
import random
import yaml
import sys
#
scenarioconfig_file = 'default_deployment_config.yaml'
-# Capture our current directory
-TPL_DIR = os.path.dirname(os.path.abspath(__file__))+'/config_tpl/bundle_tpl'
+TPL_DIR = os.path.dirname(os.path.abspath(__file__))+'/config_tpl/juju2/bundle_tpl'
#
# Prepare variables
else:
return 2
+def unit_scaleio_qty():
+ """Return size of the scaleio cluster"""
+ return 3
def to_select(qty=False):
"""Return a random list of machines numbers to deploy"""
if not qty:
qty = config['os']['ha']['cluster_size'] if \
config['os']['ha']['mode'] == 'ha' else 1
- return random.sample(range(0, config['opnfv']['units']), qty)
+ if config['os']['hyperconverged']:
+ return random.sample(range(0, config['opnfv']['units']), qty)
+ else:
+ return random.sample(range(0, qty), qty)
def get_password(key, length=16, special=False):
# Set default scenario name
if not scenario:
- scenario = "os-nosdn-nofeature-nonha"
+ scenario = "os-nosdn-nofeature-noha"
# Parse scenario name
try:
# change ha mode
config['os']['network']['controller'] = sdn
+if 'ocl' in sdn:
+ config['os']['hyperconverged'] = False
+
# Change features
if 'lxd' in features:
config['os']['lxd'] = True
config['os']['network']['sfc'] = True
if 'dpdk' in features:
config['os']['network']['dpdk'] = True
+ config['os']['beta']['huge_pages'] = True
+ config['os']['beta']['cpu_pin'] = True
if 'bgpvpn' in features:
config['os']['network']['bgpvpn'] = True
if 'odll3' in features:
config['os']['network']['odll3'] = True
+if 'dishypcon' in features:
+ config['os']['hyperconverged'] = False
+if 'hugepages' in features:
+ config['os']['beta']['huge_pages'] = True
+ config['os']['beta']['cpu_pin'] = True
+if 'openbaton' in features:
+ config['os']['service']['openbaton'] = True
+
# Set beta option from extra
-if 'publicapi' in extra:
- config['os']['beta']['public_api'] = True
if 'radosgwcluster' in extra:
config['os']['beta']['hacluster_ceph_radosgw'] = True
if 'hugepages' in extra:
config['os']['beta']['huge_pages'] = True
+ config['os']['beta']['cpu_pin'] = True
+if 'mitaka' in extra:
+ config['os']['release'] = 'mitaka'
if 'trusty' in extra:
config['ubuntu']['release'] = 'trusty'
if 'liberty' in extra:
config['os']['release'] = 'liberty'
+if 'xenial' in extra:
+ config['ubuntu']['release'] = 'xenial'
+if 'dishypcon' in extra:
+ config['os']['hyperconverged'] = False
+if 'openbaton' in features:
+ config['os']['service']['openbaton'] = True
#
# Transform template to bundle.yaml according to config
env.globals.update(get_password=get_password)
env.globals.update(unit_qty=unit_qty)
env.globals.update(unit_ceph_qty=unit_ceph_qty)
+env.globals.update(unit_scaleio_qty=unit_scaleio_qty)
env.globals.update(to_select=to_select)
# Render the template