modified to maximize use of resource available at time of 69/17369/1
authorNarinder Gupta <narinder.gupta@canonical.com>
Thu, 21 Jul 2016 18:22:05 +0000 (13:22 -0500)
committerNarinder Gupta <narinder.gupta@canonical.com>
Thu, 21 Jul 2016 18:22:51 +0000 (13:22 -0500)
deployment.

Change-Id: Ia769b4c87bafa62e58aa006468fbb2294da16766
Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
ci/bundle_tpl/bundle.yaml
ci/bundle_tpl/ceph.yaml
ci/bundle_tpl/nova-compute.yaml
ci/bundle_tpl/phase2-overrides.yaml
ci/genBundle.py

index 62047fb..52dfaf7 100644 (file)
@@ -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' %}
index 8ad6cbd..a506037 100644 (file)
         #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() }}
         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 }}
index bf73c67..8180380 100644 (file)
@@ -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
         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 %}
index 03bf981..3335030 100644 (file)
@@ -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 }}
index ffa1119..8648ac3 100644 (file)
@@ -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):