blob: 7e77caffb04c8899512297e85f1aba0fe32b8a4c [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
5
6parameters:
7 image: bionic-server-cloudimg-amd64-20190612
8 ucp_flavor: oscore-bm-lab-01
9 masters_flavor: oscore-bm-lab-01
10 workers_flavor: oscore-bm-lab-01
11 cmps_flavor: oscore-bm-lab-01
12 gtws_flavor: oscore-bm-lab-01
13 lmas_flavor: oscore-bm-lab-01
14 osds_flavor: oscore-bm-lab-01
15 public_net_id: 'physnet1-402'
16 host_interface: 'enp3s0f0'
17 masters_size: 0
18 worker_size: 3
19 cmp_size: 2
20 gtw_size: 0
21 lma_size: 0
22 osd_size: 0
23 ucp_boot_timeout: 1200
24 cluster_public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCp0evjOaK8c8SKYK4r2+0BN7g+8YSvQ2n8nFgOURCyvkJqOHi1qPGZmuN0CclYVdVuZiXbWw3VxRbSW3EH736VzgY1U0JmoTiSamzLHaWsXvEIW8VCi7boli539QJP0ikJiBaNAgZILyCrVPN+A6mfqtacs1KXdZ0zlMq1BPtFciR1JTCRcVs5vP2Wwz5QtY2jMIh3aiwkePjMTQPcfmh1TkOlxYu5IbQyZ3G1ahA0mNKI9a0dtF282av/F6pwB/N1R1nEZ/9VtcN2I1mf1NW/tTHEEcTzXYo1R/8K9vlqAN8QvvGLZtZduGviNVNoNWvoxaXxDt8CPv2B2NCdQFZp
25 private_floating_network_cidr: '172.16.49.128/26'
Oleh Hryhorov2a7b3d72020-02-27 17:04:24 +020026 private_floating_network_ipam_pool_start: '172.16.49.130'
27 private_floating_network_ipam_pool_end: '172.16.49.139'
28 private_floating_network_pool_start: '172.16.49.140'
29 private_floating_network_pool_end: '172.16.49.160'
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020030 private_floating_network_gateway: '172.16.49.129'
Oleh Hryhorov2a7b3d72020-02-27 17:04:24 +020031 metallb_address_pools: [ '172.16.49.161-172.16.49.190' ]
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020032 private_floating_interface: 'enp3s0f1.403'
Vasyl Saienko2ef16c22020-02-13 09:42:56 +020033 worker_metadata: {"labels": {"openstack-control-plane":"enabled","openvswitch":"enabled","role":"ceph-osd-node"}}
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020034 cmp_metadata: {"labels": {"openstack-compute-node":"enabled","openvswitch":"enabled", "role":"ceph-osd-node"}}
35 gtw_metadata: {"labels": {"openvswitch":"enabled"}}
Oleh Hryhorovfcde7c62020-02-13 10:51:34 +020036 tunnel_interface: 'enp3s0f0'
37 live_migration_interface: 'enp3s0f0'
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020038 functions_override: |
39 function network_config {
40 PUBLIC_NODE_IP_ADDRESS=${PUBLIC_INTERFACE_IP:-$(ip addr show dev ${PUBLIC_INTERFACE} | grep -Po 'inet \K[\d.]+' | egrep -v "127.0.|172.17")}
41 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)}
42
43 local cloud_netplan_cfg="/etc/netplan/50-cloud-init.yaml"
44 local match_ip_line
45 local public_if_mac
46
Oleh Hryhorove2db1f82020-02-11 16:14:19 +020047 DEBIAN_FRONTEND=noninteractive apt -y install bridge-utils
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020048
49 cat << EOF > /etc/systemd/network/10-veth-phy-br.netdev
50 [NetDev]
51 Name=veth-phy
52 Kind=veth
53 [Peer]
54 Name=veth-br
55 EOF
56
57 public_if_mac=$(ip link show $(echo ${PUBLIC_INTERFACE} | cut -d'.' -f1) | grep 'link/ether' | awk '{print $2}')
58
59 sed -i 's/.*ethernets:.*/&\n veth-phy: {}/' ${cloud_netplan_cfg}
60 sed -i 's/.*ethernets:.*/&\n veth-br: {}/' ${cloud_netplan_cfg}
61 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}
62
63 cat << EOF >> ${cloud_netplan_cfg}
64 vlans:
65 ${PUBLIC_INTERFACE}:
66 id: 403
67 link: $(echo ${PUBLIC_INTERFACE} | cut -d'.' -f1)
Oleh Hryhorov1acc9e52020-02-13 18:39:15 +020068 bridges:
69 br-public:
70 dhcp4: false
71 interfaces:
72 - ${PUBLIC_INTERFACE}
73 - veth-br
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020074 addresses: [ "${PUBLIC_NODE_IP_ADDRESS}/${PUBLIC_NODE_IP_NETMASK}" ]
75 EOF
76
77 netplan --debug apply
Vasyl Saienko9b688992020-02-13 13:50:53 +020078
79 # NOTE(vsaienko): give some time to apply changes
80 sleep 15
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020081 }