deployment.
Change-Id: Ia769b4c87bafa62e58aa006468fbb2294da16766
Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
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' %}
#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 }}
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 %}
{% 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 }}
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):
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):