[akraino] Add IEC K8-calico scenarios
[fuel.git] / mcp / reclass / classes / cluster / mcp-iec-noha / infra / kvm.yml.j2
1 ##############################################################################
2 # Copyright (c) 2019 Mirantis Inc., Enea AB and others.
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 ##############################################################################
8 {#- NOTE: br-{mgmt,ctl} are cross-referenced, careful when changing names #}
9 {%- import 'net_map.j2' as nm with context %}
10 {%- import 'net_macros.j2' as ma with context %}
11 {#- Filter-out NIC duplicates by constructing a dict (used NICs only) #}
12 {%- set nics = { nm.ctl01.nic_admin: True, nm.ctl01.nic_mgmt: True, nm.ctl01.nic_public: True } %}
13 {%- set vlans = { nm.vlan_admin: nm.ctl01.nic_admin, nm.vlan_mgmt: nm.ctl01.nic_mgmt, nm.vlan_public: nm.ctl01.nic_public } %}
14 ---
15 classes:
16   - system.salt.control.virt
17   - cluster.all-mcp-arch-common.opnfv.maas_proxy
18   - cluster.all-mcp-arch-common.opnfv.lab_proxy_pdf
19   - cluster.mcp-iec-noha.infra
20 parameters:
21   _param:
22     linux_system_codename: xenial
23   linux:
24     network:
25       interface:
26
27 {{ ma.linux_network_interfaces_nic(nics) }}
28
29 {{ ma.linux_network_interfaces_vlan(vlans) }}
30
31         br-mgmt:
32           enabled: true
33           proto: static
34           address: ${_param:pxe_admin_address}
35           netmask: ${_param:opnfv_net_admin_mask}
36           gateway: {{ nm.net_admin_gw }}
37           name_servers:
38             - {{ nm.net_admin_gw }}
39           type: bridge
40           use_interfaces:
41             - {{ ma.interface_str(nm.ctl01.nic_admin, nm.vlan_admin) }}
42           noifupdown: true
43         br-ctl:
44           enabled: true
45           type: bridge
46           proto: static
47           address: ${_param:single_address}
48           netmask: ${_param:opnfv_net_mgmt_mask}
49           use_interfaces:
50             - {{ ma.interface_str(nm.ctl01.nic_mgmt, nm.vlan_mgmt) }}
51           noifupdown: true
52         br-ex:
53           enabled: true
54           proto: manual
55           netmask: ${_param:opnfv_net_public_mask}
56           type: bridge
57           use_interfaces:
58             - {{ ma.interface_str(nm.ctl01.nic_public, nm.vlan_public) }}
59           noifupdown: true
60     system:
61       kernel:
62         boot_options:
63           - spectre_v2=off
64           - nopti
65         sysctl:
66           net.ipv4.ip_forward: 0
67   libvirt:
68     server:
69       service: libvirtd
70       config_sys: /etc/default/libvirtd
71       unix_sock_group: libvirt
72   salt:
73     control:
74       size:
75         akraino.iec:
76           cpu: 8
77           ram: 12288
78           disk_profile: small
79           net_profile: default
80       cluster:
81         internal:
82           domain: ${_param:cluster_domain}
83           engine: virt
84           node:
85 {%- for i in range(1, 4) %}
86             iec0{{ i }}:
87               name: ${_param:akraino_iec_node0{{ i }}_hostname}
88               provider: ${_param:infra_kvm_node0{{ i }}_hostname}.${_param:cluster_domain}
89               size: akraino.iec
90               image: ${_param:salt_control_xenial_image}
91 {%- if conf.nodes[nm.ctl01.idx].node.arch == 'aarch64' %}
92               machine: virt
93               cpu_mode: host-passthrough
94               loader:
95                 readonly: 'yes'
96                 type: pflash
97                 path: /usr/share/AAVMF/AAVMF_CODE.fd
98 {%- endif %}
99 {%- endfor %}
100   virt:
101     nic:
102       default:
103         eth2:
104           bridge: br-mgmt
105           model: virtio
106         eth1:
107           bridge: br-ex
108           model: virtio
109         eth0:
110           bridge: br-ctl
111           model: virtio