Commit c475889a authored by Saurabh's avatar Saurabh Committed by Julien Muchembled

Start new NEO cluster automatically

parent ade51b79
......@@ -96,6 +96,7 @@ class Master(NeoBaseRecipe):
r = [
'-p', options['partitions'],
'-r', options['replicas'],
'-A', options['autostart'],
]
for x in (('-C', options['upstream-cluster']),
('-M', options['upstream-masters'])):
......
......@@ -15,6 +15,7 @@ partitions = {{ slapparameter_dict['partitions'] }}
replicas = {{ slapparameter_dict['replicas'] }}
upstream-cluster = {{ dumps(slapparameter_dict['upstream-cluster']) }}
upstream-masters = {{ dumps(slapparameter_dict['upstream-masters']) }}
autostart = {{ slapparameter_dict['autostart'] }}
# "masters" parameter is not provided when just requesting a partition.
# No actual installation takes place at that time
# (slapos.cookbook:neoppod.master raises), but cfg expansion must succeed. So
......
......@@ -46,6 +46,11 @@ config-upstream-cluster = {{ dumps(parameter_dict.get('upstream-cluster', '')) }
config-upstream-masters = {{ dumps(parameter_dict.get('upstream-masters', '')) }}
software-type = {{ software_type }}
{% set node_list = parameter_dict.get('node-list', ({},)) -%}
{% set storage_count = [] -%}
{% for node in node_list -%}
{% do storage_count.append(node.get('storage-count', 1)) -%}
{% endfor -%}
config-autostart = {{ dumps(sum(storage_count)) }}
{% do assert(replicas < len(node_list)) -%}
{% for i, node in enumerate(node_list) -%}
{% set section_id = prefix ~ i -%}
......
......@@ -74,7 +74,7 @@ context =
[root-common]
<= download-base-neo
md5sum = f009499b02cacff311a27aff6550e501
md5sum = f3182000925308bc694d1dab46d8142b
[instance-neo-admin]
<= download-base-neo
......@@ -82,7 +82,7 @@ md5sum = 16d11f0fe74de06aebbadcff3527db1c
[instance-neo-master]
<= download-base-neo
md5sum = 9563ce56676bf9ae5e77fe12e9020289
md5sum = 023f08763dbba2319f58e5c597f7761d
[instance-neo-storage-mysql]
<= download-base-neo
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment