blob: d333f287cba6cf94418b9ec1671540677551ecd2 [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'
19 host_interface: 'enp3s0f0'
20 masters_size: 0
21 worker_size: 3
22 cmp_size: 2
23 gtw_size: 0
24 lma_size: 0
25 osd_size: 0
26 ucp_boot_timeout: 1200
27 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","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 Hryhorovb58460e2020-02-05 15:53:48 +020043 functions_override: |
44 function network_config {
45 PUBLIC_NODE_IP_ADDRESS=${PUBLIC_INTERFACE_IP:-$(ip addr show dev ${PUBLIC_INTERFACE} | grep -Po 'inet \K[\d.]+' | egrep -v "127.0.|172.17")}
46 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)}
47
48 local cloud_netplan_cfg="/etc/netplan/50-cloud-init.yaml"
49 local match_ip_line
50 local public_if_mac
51
Oleh Hryhorove2db1f82020-02-11 16:14:19 +020052 DEBIAN_FRONTEND=noninteractive apt -y install bridge-utils
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020053
54 cat << EOF > /etc/systemd/network/10-veth-phy-br.netdev
55 [NetDev]
56 Name=veth-phy
57 Kind=veth
58 [Peer]
59 Name=veth-br
60 EOF
61
62 public_if_mac=$(ip link show $(echo ${PUBLIC_INTERFACE} | cut -d'.' -f1) | grep 'link/ether' | awk '{print $2}')
63
64 sed -i 's/.*ethernets:.*/&\n veth-phy: {}/' ${cloud_netplan_cfg}
65 sed -i 's/.*ethernets:.*/&\n veth-br: {}/' ${cloud_netplan_cfg}
66 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}
67
Oleh Hryhorov1832d232020-03-05 11:33:13 +020068 if [ $STORAGE_FRONTEND_INTERFACE ]; then
69 STORAGE_FRONTEND_INTERFACE_DEF="
70 ${STORAGE_FRONTEND_INTERFACE}:
71 id: 404
72 link: $(echo ${STORAGE_FRONTEND_INTERFACE} | cut -d'.' -f1)
73 addresses: [ "${STORAGE_FRONTEND_INTERFACE_IP}/${STORAGE_FRONTEND_NETWORK_NETMASK}" ]
74 "
75 fi
76
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020077 cat << EOF >> ${cloud_netplan_cfg}
78 vlans:
79 ${PUBLIC_INTERFACE}:
80 id: 403
81 link: $(echo ${PUBLIC_INTERFACE} | cut -d'.' -f1)
Oleh Hryhorov1832d232020-03-05 11:33:13 +020082 ${STORAGE_FRONTEND_INTERFACE_DEF}
Oleh Hryhorov1acc9e52020-02-13 18:39:15 +020083 bridges:
84 br-public:
85 dhcp4: false
86 interfaces:
87 - ${PUBLIC_INTERFACE}
88 - veth-br
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020089 addresses: [ "${PUBLIC_NODE_IP_ADDRESS}/${PUBLIC_NODE_IP_NETMASK}" ]
90 EOF
91
92 netplan --debug apply
Vasyl Saienko9b688992020-02-13 13:50:53 +020093
94 # NOTE(vsaienko): give some time to apply changes
95 sleep 15
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020096 }