modified for nonha bundles now. 89/16289/6
authorNarinder Gupta <narinder.gupta@canonical.com>
Fri, 1 Jul 2016 18:35:25 +0000 (13:35 -0500)
committerNarinder Gupta <narinder.gupta@canonical.com>
Fri, 1 Jul 2016 19:15:44 +0000 (14:15 -0500)
Change-Id: Ic29910c9e95718603588da9fd2664ed933a88b7a
Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
ci/bundle_tpl/ceph.yaml
ci/bundle_tpl/haclusters.yaml
ci/bundle_tpl/nova-compute.yaml
ci/bundle_tpl/phase2-overrides.yaml
ci/bundle_tpl/relations.yaml
ci/bundle_tpl/subordinate.yaml
ci/genBundle.py

index f0f6b4f..e13ca41 100644 (file)
@@ -1,9 +1,9 @@
 {% if opnfv.storage_dict.ceph is defined %}
     ceph:
       charm: "local:{{ ubuntu.release }}/ceph"
-      num_units: {{ unit_qty() }}
+      num_units: {{ unit_ceph_qty() }}
       options:
-        monitor-count: {{ unit_qty() }}
+        monitor-count: {{ unit_ceph_qty() }}
         fsid: 5a791d94-980b-11e4-b6f6-3c970e8b1cf7
         monitor-secret: AQAi5a9UeJXUExAA+By9u+GPhl8/XiUQ4nwI3A==
 {% if opnfv.spaces_dict.storage is defined %}
 {% endif %}
 #        ceph-public-network: 192.168.0.0/24
       to:
+{% if os.ha.mode == 'ha' %}
 {% for unit_id in to_select() %}
         - "lxc:nodes={{ unit_id }}"
 {% endfor %}
+{% else %}
+        - "lxc:nodes=0"
+        - "lxc:nodes=1"
+{% endif %}
     ceph-osd:
       charm: "local:{{ ubuntu.release }}/ceph-osd"
-      num_units: {{ unit_qty() }}
+      num_units: {{ unit_ceph_qty() }}
       options:
         osd-devices: {{ opnfv.storage_dict.ceph.disk }}
         osd-reformat: 'yes'
       to:
+{% if os.ha.mode == 'ha' %}
 {% for unit_id in to_select() %}
         - "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 a663995..ef19365 100644 (file)
@@ -1,3 +1,4 @@
+
     hacluster-keystone:
       charm: "local:{{ ubuntu.release }}/hacluster"
       options:
index 8180380..bf73c67 100644 (file)
@@ -1,6 +1,10 @@
     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 80bfffc..218df21 100644 (file)
@@ -14,7 +14,7 @@
     l2-population: true
 {% endif %}
     region: {{ os.region }}
-{% if os.release == 'trusty' %}
+{% if ubuntu.release == 'trusty' %}
     source: "cloud:{{ ubuntu.release }}-{{ os.release }}"
 {% endif %}
     openstack-origin: "cloud:{{ ubuntu.release }}-{{ os.release }}"
index fed519f..690cdb0 100644 (file)
     - - congress:amqp
       - rabbitmq-server:amqp
 {% if os.lxd %}
-    - [ nova-compute:lxd, lxd:lxd ]
+    - [ 'nova-compute:lxd', 'lxd:lxd' ]
 {% endif %}
 {% if os.network.controller == 'nosdn' %}
-    - [ neutron-openvswitch:amqp, rabbitmq-server:amqp ]
-    - [ nova-compute:neutron-plugin, neutron-openvswitch:neutron-plugin ]
-    - [ neutron-openvswitch:neutron-plugin-api, neutron-api:neutron-plugin-api ]
+    - [ 'neutron-openvswitch:amqp', 'rabbitmq-server:amqp' ]
+    - [ 'nova-compute:neutron-plugin', 'neutron-openvswitch:neutron-plugin' ]
+    - [ 'neutron-openvswitch:neutron-plugin-api', 'neutron-api:neutron-plugin-api' ]
 {% elif os.network.controller == 'odl' %}
-    - [ neutron-api:neutron-plugin-api-subordinate, neutron-api-odl:neutron-plugin-api-subordinate ]
-    - [ nova-compute:neutron-plugin, openvswitch-odl:neutron-plugin ]
-    - [ neutron-gateway, openvswitch-odl ]
-    - [ openvswitch-odl:ovsdb-manager, odl-controller:ovsdb-manager ]
-    - [ neutron-api-odl:odl-controller, odl-controller:controller-api ]
+    - [ 'neutron-api:neutron-plugin-api-subordinate', 'neutron-api-odl:neutron-plugin-api-subordinate' ]
+    - [ 'nova-compute:neutron-plugin', 'openvswitch-odl:neutron-plugin' ]
+    - [ 'neutron-gateway', 'openvswitch-odl' ]
+    - [ 'openvswitch-odl:ovsdb-manager', 'odl-controller:ovsdb-manager' ]
+    - [ 'neutron-api-odl:odl-controller', 'odl-controller:controller-api' ]
 {% elif os.network.controller == 'onos' %}
-    - [ neutron-api:neutron-plugin-api-subordinate, neutron-api-onos:neutron-plugin-api-subordinate ]
-    - [ nova-compute:neutron-plugin, openvswitch-onos:neutron-plugin ]
-    - [ neutron-gateway, openvswitch-onos ]
-    - [ openvswitch-onos:ovsdb-manager, onos-controller:ovsdb-manager ]
-    - [ neutron-api-onos:onos-controller, onos-controller:controller-api ]
+    - [ 'neutron-api:neutron-plugin-api-subordinate', 'neutron-api-onos:neutron-plugin-api-subordinate' ]
+    - [ 'nova-compute:neutron-plugin', 'openvswitch-onos:neutron-plugin' ]
+    - [ 'neutron-gateway', 'openvswitch-onos' ]
+    - [ 'openvswitch-onos:ovsdb-manager', 'onos-controller:ovsdb-manager' ]
+    - [ 'neutron-api-onos:onos-controller', 'onos-controller:controller-api' ]
 {% elif os.network.controller == 'ocl' %}
-    - [ contrail-configuration:cassandra, cassandra:database ]
-    - [ contrail-configuration, zookeeper ]
-    - [ contrail-configuration, rabbitmq-server ]
-    - [ contrail-configuration, keystone ]
-    - [ neutron-api-contrail, contrail-configuration ]
-    - [ neutron-api-contrail, keystone ]
-    - [ contrail-control:contrail-api, contrail-configuration:contrail-api ]
-    - [ contrail-control:contrail-discovery, contrail-configuration:contrail-discovery ]
-    - [ contrail-control:contrail-ifmap, contrail-configuration:contrail-ifmap ]
-    - [ contrail-control, keystone ]
-    - [ contrail-analytics:cassandra, cassandra:database ]
-    - [ contrail-analytics:contrail-analytics-api, contrail-configuration:contrail-analytics-api ]
-    - [ contrail-configuration:contrail-discovery, contrail-analytics:contrail-discovery ]
-    - [ contrail-webui, keystone ]
-    - [ contrail-webui:contrail_api, contrail-configuration:contrail-api ]
-    - [ contrail-webui:contrail_discovery, contrail-configuration:contrail-discovery ]
-    - [ contrail-webui:cassandra, cassandra:database ]
-    - [ nova-compute, neutron-contrail ]
-    - [ neutron-contrail:contrail-discovery, contrail-configuration:contrail-discovery ]
-    - [ neutron-contrail:contrail-api, contrail-configuration:contrail-api ]
-    - [ neutron-contrail, keystone ]
-    - [ contrail-configuration, ntp ]
-    - [ contrail-control, ntp ]
-    - [ contrail-analytics, ntp ]
-    - [ contrail-configuration, haproxy ]
-    - [ contrail-analytics, haproxy ]
-    - [ contrail-webui, haproxy ]
-    - [ haproxy, keepalived ]
+    - [ 'contrail-configuration:cassandra', 'cassandra:database' ]
+    - [ 'contrail-configuration', 'zookeeper' ]
+    - [ 'contrail-configuration', 'rabbitmq-server' ]
+    - [ 'contrail-configuration', 'keystone' ]
+    - [ 'neutron-api-contrail', 'contrail-configuration' ]
+    - [ 'neutron-api-contrail', 'keystone' ]
+    - [ 'contrail-control:contrail-api', 'contrail-configuration:contrail-api' ]
+    - [ 'contrail-control:contrail-discovery', 'contrail-configuration:contrail-discovery' ]
+    - [ 'contrail-control:contrail-ifmap', 'contrail-configuration:contrail-ifmap' ]
+    - [ 'contrail-control', 'keystone' ]
+    - [ 'contrail-analytics:cassandra', 'cassandra:database' ]
+    - [ 'contrail-analytics:contrail-analytics-api', 'contrail-configuration:contrail-analytics-api' ]
+    - [ 'contrail-configuration:contrail-discovery', 'contrail-analytics:contrail-discovery' ]
+    - [ 'contrail-webui', 'keystone' ]
+    - [ 'contrail-webui:contrail_api', 'contrail-configuration:contrail-api' ]
+    - [ 'contrail-webui:contrail_discovery', 'contrail-configuration:contrail-discovery' ]
+    - [ 'contrail-webui:cassandra', 'cassandra:database' ]
+    - [ 'nova-compute', 'neutron-contrail' ]
+    - [ 'neutron-contrail:contrail-discovery', 'contrail-configuration:contrail-discovery' ]
+    - [ 'neutron-contrail:contrail-api', 'contrail-configuration:contrail-api' ]
+    - [ 'neutron-contrail', 'keystone' ]
+    - [ 'contrail-configuration', 'ntp' ]
+    - [ 'contrail-control', 'ntp' ]
+    - [ 'contrail-analytics', 'ntp' ]
+    - [ 'contrail-configuration', 'haproxy' ]
+    - [ 'contrail-analytics', 'haproxy' ]
+    - [ 'contrail-webui', 'haproxy' ]
+    - [ 'haproxy', 'keepalived' ]
 {% endif %}
index ce31ec8..cc61920 100644 (file)
@@ -5,7 +5,7 @@
       charm: local:{{ ubuntu.release }}/cinder-ceph
 {% endif %}
 {% if os.network.controller == 'nosdn' %}
-    {% include 'neutron-ovs.yaml' %}
+{% include 'neutron-ovs.yaml' %}
 {% elif os.network.controller == 'odl' %}
     neutron-api-odl:
       charm: local:{{ ubuntu.release }}/neutron-api-odl
index cb61f5a..89f41ce 100644 (file)
@@ -57,11 +57,21 @@ def unit_qty():
     else:
         return 1
 
+def unit_ceph_qty():
+    global config
+    if config['os']['ha']['mode'] == 'ha':
+        return config['os']['ha']['cluster_size']
+    else:
+        return 2
+
 def to_select( qty = False ):
     global config
     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']['ha']['mode'] == 'ha':
+        return random.sample(range(0,config['opnfv']['units']), qty )
+    else:
+        return random.sample(range(0,2),qty )
 
 def get_password(key, length=16, special=False):
     global passwords_store
@@ -159,6 +169,7 @@ template = env.get_template('bundle.yaml')
 # Add functions
 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(to_select=to_select)
 
 # Render the template