blob: e4a6d0c3f2b9916f4673f3d1829bd450559e5aaa [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: 0
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 Saienko716d0372020-03-05 05:53:47 +000038 worker_metadata: {"labels": {"openstack-control-plane":"enabled","openstack-compute-node":"enabled","openvswitch":"enabled","openstack-gateway":"enabled","role":"ceph-osd-node"}}
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 Hryhorov39fbfe52020-03-12 15:26:53 +020043 storage_frontend_network_cidr: '10.12.0.0/24'
44 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}
68 sed -i "s/.*ethernets:.*/&\n $(echo ${PUBLIC_INTERFACE} | cut -d'.' -f1):\n dhcp4: false\n match:\n macaddress: ${public_if_mac}\n set-name: $(echo ${PUBLIC_INTERFACE} | cut -d'.' -f1)/" ${cloud_netplan_cfg}
69
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 Hryhorovb58460e2020-02-05 15:53:48 +020079 cat << EOF >> ${cloud_netplan_cfg}
80 vlans:
81 ${PUBLIC_INTERFACE}:
82 id: 403
83 link: $(echo ${PUBLIC_INTERFACE} | cut -d'.' -f1)
Oleh Hryhorov1832d232020-03-05 11:33:13 +020084 ${STORAGE_FRONTEND_INTERFACE_DEF}
Oleh Hryhorov1acc9e52020-02-13 18:39:15 +020085 bridges:
86 br-public:
87 dhcp4: false
88 interfaces:
89 - ${PUBLIC_INTERFACE}
90 - veth-br
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020091 addresses: [ "${PUBLIC_NODE_IP_ADDRESS}/${PUBLIC_NODE_IP_NETMASK}" ]
92 EOF
93
94 netplan --debug apply
Vasyl Saienko9b688992020-02-13 13:50:53 +020095
96 # NOTE(vsaienko): give some time to apply changes
97 sleep 15
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020098 }
Vasyl Saienkof9ee1582020-03-02 16:53:41 +020099 hardware_metadata: |
100 '0c:c4:7a:20:19:8a':
101 write_files:
102 - path: /usr/share/metadata/ceph.yaml
103 content: |
104 storageDevices:
105 - name: sdb
106 role: hdd
107 sizeGb: 450
Oleh Hryhorov08476c32020-03-10 18:46:51 +0200108 ramGb: 64
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200109 cores: 12
110 # The roles will be assigned based on node labels.
111 # roles:
112 # - mon
113 # - mgr
114 ips:
115 - 192.168.122.101
116 crushPath: {}
117
118 '0c:c4:7a:20:19:28':
119 write_files:
120 - path: /usr/share/metadata/ceph.yaml
121 content: |
122 storageDevices:
123 - name: sdb
124 role: hdd
125 sizeGb: 450
Oleh Hryhorov08476c32020-03-10 18:46:51 +0200126 ramGb: 64
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200127 cores: 12
128 ips:
129 - 192.168.122.102
130 crushPath: {}
131 '0c:c4:7a:20:19:48':
132 write_files:
133 - path: /usr/share/metadata/ceph.yaml
134 content: |
135 storageDevices:
136 - name: sdb
137 role: hdd
138 sizeGb: 450
Oleh Hryhorov08476c32020-03-10 18:46:51 +0200139 ramGb: 64
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200140 cores: 12
141 ips:
142 - 192.168.122.103
143 crushPath: {}
144 '0c:c4:7a:20:15:28':
145 write_files:
146 - path: /usr/share/metadata/ceph.yaml
147 content: |
148 storageDevices:
149 - name: sdb
150 role: hdd
151 sizeGb: 450
Oleh Hryhorov08476c32020-03-10 18:46:51 +0200152 ramGb: 64
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200153 cores: 12
154 ips:
155 - 192.168.122.104
156 crushPath: {}
157 '0c:c4:7a:20:19:46':
158 write_files:
159 - path: /usr/share/metadata/ceph.yaml
160 content: |
161 storageDevices:
162 - name: sdb
163 role: hdd
164 sizeGb: 450
Oleh Hryhorov08476c32020-03-10 18:46:51 +0200165 ramGb: 64
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200166 cores: 12
167 ips:
168 - 192.168.122.105
169 crushPath: {}
170 '0c:c4:7a:17:90:66':
171 write_files:
172 - path: /usr/share/metadata/ceph.yaml
173 content: |
174 storageDevices:
175 - name: sdb
176 role: hdd
177 sizeGb: 450
Oleh Hryhorov08476c32020-03-10 18:46:51 +0200178 ramGb: 64
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200179 cores: 12
180 ips:
181 - 192.168.122.106
182 crushPath: {}