diff options
author | Narinder Gupta <narinder.gupta@canonical.com> | 2016-07-01 13:35:25 -0500 |
---|---|---|
committer | Narinder Gupta <narinder.gupta@canonical.com> | 2016-07-01 14:15:44 -0500 |
commit | 87ff38481a31846f3171976fbb039d5d3e10929a (patch) | |
tree | b1dea2757cc9a9362ef23ac9cf8cadbe0613658d | |
parent | 628346cfd690524f1ec455ca35c3bc7474640079 (diff) |
modified for nonha bundles now.
Change-Id: Ic29910c9e95718603588da9fd2664ed933a88b7a
Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
-rw-r--r-- | ci/bundle_tpl/ceph.yaml | 16 | ||||
-rw-r--r-- | ci/bundle_tpl/haclusters.yaml | 1 | ||||
-rw-r--r-- | ci/bundle_tpl/nova-compute.yaml | 8 | ||||
-rw-r--r-- | ci/bundle_tpl/phase2-overrides.yaml | 2 | ||||
-rw-r--r-- | ci/bundle_tpl/relations.yaml | 84 | ||||
-rw-r--r-- | ci/bundle_tpl/subordinate.yaml | 2 | ||||
-rw-r--r-- | ci/genBundle.py | 13 |
7 files changed, 78 insertions, 48 deletions
diff --git a/ci/bundle_tpl/ceph.yaml b/ci/bundle_tpl/ceph.yaml index f0f6b4fd..e13ca417 100644 --- a/ci/bundle_tpl/ceph.yaml +++ b/ci/bundle_tpl/ceph.yaml @@ -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 %} @@ -11,19 +11,29 @@ {% 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 }} diff --git a/ci/bundle_tpl/haclusters.yaml b/ci/bundle_tpl/haclusters.yaml index a6639950..ef193654 100644 --- a/ci/bundle_tpl/haclusters.yaml +++ b/ci/bundle_tpl/haclusters.yaml @@ -1,3 +1,4 @@ + hacluster-keystone: charm: "local:{{ ubuntu.release }}/hacluster" options: diff --git a/ci/bundle_tpl/nova-compute.yaml b/ci/bundle_tpl/nova-compute.yaml index 81803807..bf73c675 100644 --- a/ci/bundle_tpl/nova-compute.yaml +++ b/ci/bundle_tpl/nova-compute.yaml @@ -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 @@ -13,6 +17,10 @@ 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 80bfffc6..218df213 100644 --- a/ci/bundle_tpl/phase2-overrides.yaml +++ b/ci/bundle_tpl/phase2-overrides.yaml @@ -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 }}" diff --git a/ci/bundle_tpl/relations.yaml b/ci/bundle_tpl/relations.yaml index fed519f8..690cdb01 100644 --- a/ci/bundle_tpl/relations.yaml +++ b/ci/bundle_tpl/relations.yaml @@ -89,51 +89,51 @@ - - 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 %} diff --git a/ci/bundle_tpl/subordinate.yaml b/ci/bundle_tpl/subordinate.yaml index ce31ec81..cc61920b 100644 --- a/ci/bundle_tpl/subordinate.yaml +++ b/ci/bundle_tpl/subordinate.yaml @@ -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 diff --git a/ci/genBundle.py b/ci/genBundle.py index cb61f5aa..89f41ce6 100644 --- a/ci/genBundle.py +++ b/ci/genBundle.py @@ -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 |