blob: 3b801a54a0f8e22fa3668ab70d583fccef7d61b4 [file] [log] [blame]
Oleh Hryhorovb58460e2020-02-05 15:53:48 +02001resource_registry:
2 "MCP2::NetworkAcc": ../fragments/NetworkAccBM.yaml
3 "MCP2::NetworkPrvFl": ../fragments/NetworkPrvFl.yaml
Vasyl Saienkoad3a3a62020-05-14 16:52:52 +03004 "MCP2::NetworkIronicFlat": ../fragments/NetworkIronicFlat.yaml
Oleh Hryhorovb58460e2020-02-05 15:53:48 +02005 "MCP2::SrvInstances": ../fragments/SrvInstancesBM.yaml
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +02006 "MCP2::NetworkAccStorage": ../fragments/NetworkAccVMStorage.yaml
7 "MCP2::SrvInstancesCeph": ../fragments/SrvInstancesBMCeph.yaml
8 "MCP2::SrvInstancesCephOSD": ../fragments/SrvInstancesBMCephOSD.yaml
Oleh Hryhorovb58460e2020-02-05 15:53:48 +02009
10parameters:
11 image: bionic-server-cloudimg-amd64-20190612
12 ucp_flavor: oscore-bm-lab-01
13 masters_flavor: oscore-bm-lab-01
14 workers_flavor: oscore-bm-lab-01
15 cmps_flavor: oscore-bm-lab-01
16 gtws_flavor: oscore-bm-lab-01
17 lmas_flavor: oscore-bm-lab-01
18 osds_flavor: oscore-bm-lab-01
19 public_net_id: 'physnet1-402'
Vasyl Saienko0fa6f192020-03-06 16:08:51 +020020 control_network_cidr: '172.16.43.0/24'
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020021 masters_size: 0
22 worker_size: 3
23 cmp_size: 2
24 gtw_size: 0
25 lma_size: 0
26 osd_size: 0
Vasyl Saienkof36f39c2020-03-10 00:21:42 +020027 ucp_boot_timeout: 3600
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020028 cluster_public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCp0evjOaK8c8SKYK4r2+0BN7g+8YSvQ2n8nFgOURCyvkJqOHi1qPGZmuN0CclYVdVuZiXbWw3VxRbSW3EH736VzgY1U0JmoTiSamzLHaWsXvEIW8VCi7boli539QJP0ikJiBaNAgZILyCrVPN+A6mfqtacs1KXdZ0zlMq1BPtFciR1JTCRcVs5vP2Wwz5QtY2jMIh3aiwkePjMTQPcfmh1TkOlxYu5IbQyZ3G1ahA0mNKI9a0dtF282av/F6pwB/N1R1nEZ/9VtcN2I1mf1NW/tTHEEcTzXYo1R/8K9vlqAN8QvvGLZtZduGviNVNoNWvoxaXxDt8CPv2B2NCdQFZp
29 private_floating_network_cidr: '172.16.49.128/26'
Oleh Hryhorov2a7b3d72020-02-27 17:04:24 +020030 private_floating_network_ipam_pool_start: '172.16.49.130'
31 private_floating_network_ipam_pool_end: '172.16.49.139'
32 private_floating_network_pool_start: '172.16.49.140'
33 private_floating_network_pool_end: '172.16.49.160'
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020034 private_floating_network_gateway: '172.16.49.129'
Oleh Hryhorov2a7b3d72020-02-27 17:04:24 +020035 metallb_address_pools: [ '172.16.49.161-172.16.49.190' ]
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020036 private_floating_interface: 'enp3s0f1.403'
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020037 storage_frontend_interface: 'enp3s0f1.404'
38 storage_backend_interface: 'enp3s0f1.405'
Vasyl Saienko6d87c922020-03-24 21:18:52 +020039 worker_metadata: {"labels": {"openstack-control-plane":"enabled","openvswitch":"enabled","openstack-gateway":"enabled","role":"ceph-osd-node","local-volume-provisioner": "enabled"}}
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020040 cmp_metadata: {"labels": {"openstack-compute-node":"enabled","openvswitch":"enabled", "role":"ceph-osd-node"}}
41 gtw_metadata: {"labels": {"openvswitch":"enabled"}}
Oleh Hryhorovfcde7c62020-02-13 10:51:34 +020042 tunnel_interface: 'enp3s0f0'
43 live_migration_interface: 'enp3s0f0'
Oleh Hryhorov85d55b12020-03-27 16:22:02 +020044 storage_frontend_network_cidr: '10.12.1.0/24'
Oleh Hryhorov39fbfe52020-03-12 15:26:53 +020045 storage_backend_network_cidr: '10.12.0.0/24'
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020046 functions_override: |
47 function network_config {
48 PUBLIC_NODE_IP_ADDRESS=${PUBLIC_INTERFACE_IP:-$(ip addr show dev ${PUBLIC_INTERFACE} | grep -Po 'inet \K[\d.]+' | egrep -v "127.0.|172.17")}
49 PUBLIC_NODE_IP_NETMASK=${PUBLIC_INTERFACE_NETMASK:-$(ip addr show dev ${PUBLIC_INTERFACE} | grep -Po 'inet \K[\d.]+\/[\d]+' | egrep -v "127.0.|172.17" | cut -d'/' -f2)}
50
51 local cloud_netplan_cfg="/etc/netplan/50-cloud-init.yaml"
52 local match_ip_line
53 local public_if_mac
54
Oleh Hryhorove2db1f82020-02-11 16:14:19 +020055 DEBIAN_FRONTEND=noninteractive apt -y install bridge-utils
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020056
57 cat << EOF > /etc/systemd/network/10-veth-phy-br.netdev
58 [NetDev]
59 Name=veth-phy
60 Kind=veth
61 [Peer]
62 Name=veth-br
63 EOF
64
65 public_if_mac=$(ip link show $(echo ${PUBLIC_INTERFACE} | cut -d'.' -f1) | grep 'link/ether' | awk '{print $2}')
66
67 sed -i 's/.*ethernets:.*/&\n veth-phy: {}/' ${cloud_netplan_cfg}
68 sed -i 's/.*ethernets:.*/&\n veth-br: {}/' ${cloud_netplan_cfg}
Oleh Hryhorov73194332020-04-01 13:14:51 +030069 sed -i "s/.*ethernets:.*/&\n $(echo ${PUBLIC_INTERFACE} | cut -d'.' -f1):\n dhcp4: false\n mtu: 9100\n match:\n macaddress: ${public_if_mac}\n set-name: $(echo ${PUBLIC_INTERFACE} | cut -d'.' -f1)/" ${cloud_netplan_cfg}
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020070
Oleh Hryhorov1832d232020-03-05 11:33:13 +020071 if [ $STORAGE_FRONTEND_INTERFACE ]; then
72 STORAGE_FRONTEND_INTERFACE_DEF="
73 ${STORAGE_FRONTEND_INTERFACE}:
74 id: 404
75 link: $(echo ${STORAGE_FRONTEND_INTERFACE} | cut -d'.' -f1)
76 addresses: [ "${STORAGE_FRONTEND_INTERFACE_IP}/${STORAGE_FRONTEND_NETWORK_NETMASK}" ]
77 "
78 fi
79
Oleh Hryhorov85d55b12020-03-27 16:22:02 +020080 if [ $STORAGE_BACKEND_INTERFACE ]; then
81 STORAGE_BACKEND_INTERFACE_DEF="
82 ${STORAGE_BACKEND_INTERFACE}:
83 id: 405
84 link: $(echo ${STORAGE_BACKEND_INTERFACE} | cut -d'.' -f1)
85 addresses: [ "${STORAGE_BACKEND_INTERFACE_IP}/${STORAGE_BACKEND_NETWORK_NETMASK}" ]
86 "
87 fi
88
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020089 cat << EOF >> ${cloud_netplan_cfg}
90 vlans:
91 ${PUBLIC_INTERFACE}:
92 id: 403
93 link: $(echo ${PUBLIC_INTERFACE} | cut -d'.' -f1)
Oleh Hryhorov1832d232020-03-05 11:33:13 +020094 ${STORAGE_FRONTEND_INTERFACE_DEF}
Oleh Hryhorov85d55b12020-03-27 16:22:02 +020095 ${STORAGE_BACKEND_INTERFACE_DEF}
Oleh Hryhorov1acc9e52020-02-13 18:39:15 +020096 bridges:
97 br-public:
98 dhcp4: false
99 interfaces:
100 - ${PUBLIC_INTERFACE}
101 - veth-br
Oleh Hryhorovb58460e2020-02-05 15:53:48 +0200102 addresses: [ "${PUBLIC_NODE_IP_ADDRESS}/${PUBLIC_NODE_IP_NETMASK}" ]
103 EOF
104
105 netplan --debug apply
Vasyl Saienko9b688992020-02-13 13:50:53 +0200106
107 # NOTE(vsaienko): give some time to apply changes
108 sleep 15
Oleh Hryhorovb58460e2020-02-05 15:53:48 +0200109 }
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200110 hardware_metadata: |
111 '0c:c4:7a:20:19:8a':
112 write_files:
113 - path: /usr/share/metadata/ceph.yaml
114 content: |
115 storageDevices:
116 - name: sdb
117 role: hdd
118 sizeGb: 450
Oleh Hryhorov08476c32020-03-10 18:46:51 +0200119 ramGb: 64
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200120 cores: 12
121 # The roles will be assigned based on node labels.
122 # roles:
123 # - mon
124 # - mgr
125 ips:
126 - 192.168.122.101
127 crushPath: {}
128
129 '0c:c4:7a:20:19:28':
130 write_files:
131 - path: /usr/share/metadata/ceph.yaml
132 content: |
133 storageDevices:
134 - name: sdb
135 role: hdd
136 sizeGb: 450
Oleh Hryhorov08476c32020-03-10 18:46:51 +0200137 ramGb: 64
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200138 cores: 12
139 ips:
140 - 192.168.122.102
141 crushPath: {}
142 '0c:c4:7a:20:19:48':
143 write_files:
144 - path: /usr/share/metadata/ceph.yaml
145 content: |
146 storageDevices:
147 - name: sdb
148 role: hdd
149 sizeGb: 450
Oleh Hryhorov08476c32020-03-10 18:46:51 +0200150 ramGb: 64
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200151 cores: 12
152 ips:
153 - 192.168.122.103
154 crushPath: {}
155 '0c:c4:7a:20:15:28':
156 write_files:
157 - path: /usr/share/metadata/ceph.yaml
158 content: |
159 storageDevices:
160 - name: sdb
161 role: hdd
162 sizeGb: 450
Oleh Hryhorov08476c32020-03-10 18:46:51 +0200163 ramGb: 64
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200164 cores: 12
165 ips:
166 - 192.168.122.104
167 crushPath: {}
168 '0c:c4:7a:20:19:46':
169 write_files:
170 - path: /usr/share/metadata/ceph.yaml
171 content: |
172 storageDevices:
173 - name: sdb
174 role: hdd
175 sizeGb: 450
Oleh Hryhorov08476c32020-03-10 18:46:51 +0200176 ramGb: 64
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200177 cores: 12
178 ips:
179 - 192.168.122.105
180 crushPath: {}
181 '0c:c4:7a:17:90:66':
182 write_files:
183 - path: /usr/share/metadata/ceph.yaml
184 content: |
185 storageDevices:
186 - name: sdb
187 role: hdd
188 sizeGb: 450
Oleh Hryhorov08476c32020-03-10 18:46:51 +0200189 ramGb: 64
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200190 cores: 12
191 ips:
192 - 192.168.122.106
193 crushPath: {}