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