############################################################################## # Copyright (c) 2017 Mirantis Inc., Enea AB and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## {%- import 'net_map.j2' as nm with context %} --- cluster: domain: mcp-ovs-noha.local states: - openstack_noha - neutron_gateway - networks virtual: nodes: control: - ctl01 - gtw01 compute: - cmp001 - cmp002 ctl01: disks: {{ conf.nodes[nm.ctl01.idx].disks | map(attribute='disk_capacity') | join(';') }} vcpus: 4 ram: 14336 gtw01: ram: 2048 {%- if nm.cmp001.idx < conf.nodes | length %} {%- set cmp_node = conf.nodes[nm.cmp001.idx].node %} {%- set cmp_ram = ([16384, ('%.0f' | format((cmp_node.memory | storage_size_num | float) * 1024 / 1000000000) | int)] | sort)[-1] %} {%- set cmp_sockets = ([2, cmp_node.cpus | int] | sort)[-1] %} {%- set cmp_threads = 2 %} {%- set cmp_cores = ([2, ('%.0f' | format((cmp_node.cores | float) / cmp_threads)) | int] | sort)[-1] %} {%- for cmpi in range(1, 3) %} cmp00{{ cmpi }}: disks: {{ conf.nodes[nm.cmp001.idx].disks | map(attribute='disk_capacity') | join(';') }} vcpus: {{ cmp_sockets * cmp_cores * cmp_threads }} ram: {{ cmp_ram }} cpu_topology: sockets: {{ cmp_sockets }} cores: {{ cmp_cores }} threads: {{ cmp_threads }} numa: {%- for ci in range(0, cmp_sockets) %} cell{{ ci }}: memory: {{ '%.0f' | format((cmp_ram | float) * 1024 / cmp_sockets) }} cpus: {{ cmp_cores * cmp_threads * (ci | int) }}-{{ cmp_cores * cmp_threads * (ci | int + 1) - 1 }} {%- endfor %} {%- endfor %} {%- endif %}