From: Narinder Gupta Date: Thu, 21 Jul 2016 18:22:05 +0000 (-0500) Subject: modified to maximize use of resource available at time of X-Git-Tag: colorado.1.0~73 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=1e67ca426ab0f454fc2d4845efd5d9984782a4db;p=joid.git modified to maximize use of resource available at time of deployment. Change-Id: Ia769b4c87bafa62e58aa006468fbb2294da16766 Signed-off-by: Narinder Gupta --- diff --git a/ci/bundle_tpl/bundle.yaml b/ci/bundle_tpl/bundle.yaml index 62047fba..52dfaf79 100644 --- a/ci/bundle_tpl/bundle.yaml +++ b/ci/bundle_tpl/bundle.yaml @@ -11,11 +11,7 @@ openstack-phase1: services: nodes: charm: "cs:{{ ubuntu.release }}/ubuntu" -{% if os.ha.mode == 'ha' %} - num_units: 5 -{% else %} - num_units: 2 -{% endif %} + num_units: {{ opnfv.units }} ntp: charm: "local:{{ ubuntu.release }}/ntp" {% if os.network.controller == 'ocl' %} diff --git a/ci/bundle_tpl/ceph.yaml b/ci/bundle_tpl/ceph.yaml index 8ad6cbd6..a5060371 100644 --- a/ci/bundle_tpl/ceph.yaml +++ b/ci/bundle_tpl/ceph.yaml @@ -10,14 +10,9 @@ #ceph-cluster-network: {{ opnfv.spaces_dict.storage.cidr }} {% endif %} to: -{% if os.ha.mode == 'ha' %} -{% for unit_id in to_select() %} +{% for unit_id in to_select(unit_ceph_qty()) %} - "lxc:nodes={{ unit_id }}" {% endfor %} -{% else %} - - "lxc:nodes=0" - - "lxc:nodes=1" -{% endif %} ceph-osd: charm: "local:{{ ubuntu.release }}/ceph-osd" num_units: {{ unit_ceph_qty() }} @@ -25,14 +20,9 @@ osd-devices: {{ opnfv.storage_dict.ceph.disk }} osd-reformat: 'yes' to: -{% if os.ha.mode == 'ha' %} -{% for unit_id in to_select() %} +{% for unit_id in to_select(unit_ceph_qty()) %} - "nodes={{ unit_id }}" {% endfor %} -{% else %} - - "nodes=0" - - "nodes=1" -{% endif %} ceph-radosgw: charm: "local:{{ ubuntu.release }}/ceph-radosgw" num_units: {{ unit_qty() if os.beta.hacluster_ceph_radosgw else 1 }} diff --git a/ci/bundle_tpl/nova-compute.yaml b/ci/bundle_tpl/nova-compute.yaml index bf73c675..81803807 100644 --- a/ci/bundle_tpl/nova-compute.yaml +++ b/ci/bundle_tpl/nova-compute.yaml @@ -1,10 +1,6 @@ nova-compute: charm: "local:{{ ubuntu.release }}/nova-compute" -{% if os.ha.mode == 'ha' %} num_units: {{ opnfv.units - 1 }} -{% else %} - num_units: 1 -{% endif %} options: enable-live-migration: true enable-resize: true @@ -17,10 +13,6 @@ virt-type: lxd {% endif %} to: -{% if os.ha.mode == 'ha' %} {% for unit_id in range(1, opnfv.units) %} - "nodes={{ unit_id }}" {% endfor %} -{% else %} - - "nodes=1" -{% endif %} diff --git a/ci/bundle_tpl/phase2-overrides.yaml b/ci/bundle_tpl/phase2-overrides.yaml index 03bf9812..33350300 100644 --- a/ci/bundle_tpl/phase2-overrides.yaml +++ b/ci/bundle_tpl/phase2-overrides.yaml @@ -16,7 +16,7 @@ {% endif %} openstack-origin: "cloud:{{ ubuntu.release }}-{{ os.release }}" {% if os.ha.mode == 'nonha' %} - ceph-osd-replication-count: {{ os.storage.ceph_replica }} + ceph-osd-replication-count: {{ unit_ceph_qty() }} {% endif %} admin-role: {{ os.admin.role }} keystone-admin-role: {{ os.admin.role }} diff --git a/ci/genBundle.py b/ci/genBundle.py index ffa1119d..8648ac3a 100644 --- a/ci/genBundle.py +++ b/ci/genBundle.py @@ -76,7 +76,10 @@ def unit_ceph_qty(): if config['os']['ha']['mode'] == 'ha': return config['os']['ha']['cluster_size'] else: - return 2 + if config['opnfv']['units'] >= 3: + return config['os']['ha']['cluster_size'] + else: + return 2 def to_select(qty=False): @@ -85,10 +88,7 @@ def to_select(qty=False): if not qty: qty = config['os']['ha']['cluster_size'] if \ config['os']['ha']['mode'] == 'ha' else 1 - if config['os']['ha']['mode'] == 'ha': - return random.sample(range(0, config['opnfv']['units']), qty) - else: - return random.sample(range(0, 2), qty) + return random.sample(range(0, config['opnfv']['units']), qty) def get_password(key, length=16, special=False):