Commit c8ce5d01 authored by Julien Muchembled's avatar Julien Muchembled

NEO: allow to remove nodes without changing references of next ones

parent 92a55408
Pipeline #15434 passed with stage
...@@ -18,7 +18,7 @@ md5sum = 2bd1779425b7561682c0de5496d808ed ...@@ -18,7 +18,7 @@ md5sum = 2bd1779425b7561682c0de5496d808ed
[root-common] [root-common]
filename = root-common.cfg.in filename = root-common.cfg.in
md5sum = 8e28f599247ad604ec6e32df410412a8 md5sum = c13b4f1a5aa526a8d3f8e02bf6baf785
[instance-neo-admin] [instance-neo-admin]
filename = instance-neo-admin.cfg.in filename = instance-neo-admin.cfg.in
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
"type": "object" "type": "object"
}, },
"sla-dict": { "sla-dict": {
"description": "[NEO SR only] Where to request instances. Each key is a query string for criterions (e.g. \"computer_guid=foo\"), and each value is a list of partition references ('node-0', 'node-1', ...). The prefix 'node-' is mandatory and the number must start from 0. The total number of nodes here must be equal to the length of node-list.", "description": "[NEO SR only] Where to request instances. Each key is a query string for criterions (e.g. \"computer_guid=foo\"), and each value is a list of partition references ('node-0', 'node-1', ...). The prefix 'node-' is mandatory and the number must start from 0. The total number of nodes here must be equal to the length of node-list. A node can be removed by requesting it without any admin, master and storage.",
"additionalProperties": { "additionalProperties": {
"type": "array", "type": "array",
"items": { "items": {
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
"type": "integer" "type": "integer"
}, },
"storage-count": { "storage-count": {
"description": "Number of storage nodes to deploy. One master and one admin node is deployed with each storage.", "description": "Number of storage nodes to deploy. One master and one admin node is deployed with each storage. 0 to disable.",
"default": 1, "default": 1,
"type": "integer" "type": "integer"
}, },
......
...@@ -89,7 +89,7 @@ software-type = {{ software_type }} ...@@ -89,7 +89,7 @@ software-type = {{ software_type }}
config-autostart = {{ dumps(sum(storage_count)) }} config-autostart = {{ dumps(sum(storage_count)) }}
{%- do assert(replicas < len(node_list)) %} {%- do assert(replicas < len(node_list)) %}
{%- set monitor = set() %} {%- set monitor = set() %}
{%- for i, node in enumerate(node_list) %} {%- for node in node_list %}
{%- set port = node.get('monitor') %} {%- set port = node.get('monitor') %}
{%- if port %} {%- if port %}
{%- do monitor.add(node.get('admin') != 0 and port) %} {%- do monitor.add(node.get('admin') != 0 and port) %}
...@@ -101,13 +101,14 @@ config-autostart = {{ dumps(sum(storage_count)) }} ...@@ -101,13 +101,14 @@ config-autostart = {{ dumps(sum(storage_count)) }}
{%- endif %} {%- endif %}
{%- for i, node in enumerate(node_list) %} {%- for i, node in enumerate(node_list) %}
{%- set section_id = prefix ~ i %} {%- set section_id = prefix ~ i %}
{%- do section_id_list.append(section_id) %}
{%- if node.get('master') == 0 and not node.get('monitor') %} {%- if node.get('master') == 0 and not node.get('monitor') %}
{%- do node.setdefault('admin', 0) %} {%- do node.setdefault('admin', 0) %}
{%- endif %} {%- endif %}
{%- if monitor or node.get('admin') == 0 %} {%- if monitor or node.get('admin') == 0 %}
{%- do node.setdefault('monitor', 0) %} {%- do node.setdefault('monitor', 0) %}
{%- endif %} {%- endif %}
{%- for x in 'admin', 'master', 'storage-count' if node.get(x, 1) %}
{%- do section_id_list.append(section_id) %}
[{{section_id}}] [{{section_id}}]
<= {{ prefix }}request-common <= {{ prefix }}request-common
...@@ -136,6 +137,9 @@ config-monitor = {{ dumps(parameter_dict.get('monitor', {})) }} ...@@ -136,6 +137,9 @@ config-monitor = {{ dumps(parameter_dict.get('monitor', {})) }}
config-{{ k }} = {{ dumps(v) }} config-{{ k }} = {{ dumps(v) }}
{%- endfor %} {%- endfor %}
{{ sla(section_id) }} {{ sla(section_id) }}
{%- break %}
{%- endfor %}
{%- endfor %} {%- endfor %}
{%- do assert(len(monitor) == 1, monitor) %} {%- do assert(len(monitor) == 1, monitor) %}
......
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