Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 1 | resource_registry: |
| 2 | "MCP2::NetworkAcc": ../fragments/NetworkAccBM.yaml |
| 3 | "MCP2::NetworkPrvFl": ../fragments/NetworkPrvFl.yaml |
Vasyl Saienko | ad3a3a6 | 2020-05-14 16:52:52 +0300 | [diff] [blame^] | 4 | "MCP2::NetworkIronicFlat": ../fragments/NetworkIronicFlat.yaml |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 5 | "MCP2::SrvInstances": ../fragments/SrvInstancesBM.yaml |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 6 | "MCP2::NetworkAccStorage": ../fragments/NetworkAccVMStorage.yaml |
| 7 | "MCP2::SrvInstancesCeph": ../fragments/SrvInstancesBMCeph.yaml |
| 8 | "MCP2::SrvInstancesCephOSD": ../fragments/SrvInstancesBMCephOSD.yaml |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 9 | |
| 10 | parameters: |
| 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 Saienko | 0fa6f19 | 2020-03-06 16:08:51 +0200 | [diff] [blame] | 20 | control_network_cidr: '172.16.43.0/24' |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 21 | masters_size: 0 |
| 22 | worker_size: 3 |
| 23 | cmp_size: 2 |
| 24 | gtw_size: 0 |
| 25 | lma_size: 0 |
| 26 | osd_size: 0 |
Vasyl Saienko | f36f39c | 2020-03-10 00:21:42 +0200 | [diff] [blame] | 27 | ucp_boot_timeout: 3600 |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 28 | 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 Hryhorov | 2a7b3d7 | 2020-02-27 17:04:24 +0200 | [diff] [blame] | 30 | 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 Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 34 | private_floating_network_gateway: '172.16.49.129' |
Oleh Hryhorov | 2a7b3d7 | 2020-02-27 17:04:24 +0200 | [diff] [blame] | 35 | metallb_address_pools: [ '172.16.49.161-172.16.49.190' ] |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 36 | private_floating_interface: 'enp3s0f1.403' |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 37 | storage_frontend_interface: 'enp3s0f1.404' |
| 38 | storage_backend_interface: 'enp3s0f1.405' |
Vasyl Saienko | 6d87c92 | 2020-03-24 21:18:52 +0200 | [diff] [blame] | 39 | worker_metadata: {"labels": {"openstack-control-plane":"enabled","openvswitch":"enabled","openstack-gateway":"enabled","role":"ceph-osd-node","local-volume-provisioner": "enabled"}} |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 40 | cmp_metadata: {"labels": {"openstack-compute-node":"enabled","openvswitch":"enabled", "role":"ceph-osd-node"}} |
| 41 | gtw_metadata: {"labels": {"openvswitch":"enabled"}} |
Oleh Hryhorov | fcde7c6 | 2020-02-13 10:51:34 +0200 | [diff] [blame] | 42 | tunnel_interface: 'enp3s0f0' |
| 43 | live_migration_interface: 'enp3s0f0' |
Oleh Hryhorov | 85d55b1 | 2020-03-27 16:22:02 +0200 | [diff] [blame] | 44 | storage_frontend_network_cidr: '10.12.1.0/24' |
Oleh Hryhorov | 39fbfe5 | 2020-03-12 15:26:53 +0200 | [diff] [blame] | 45 | storage_backend_network_cidr: '10.12.0.0/24' |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 46 | 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 Hryhorov | e2db1f8 | 2020-02-11 16:14:19 +0200 | [diff] [blame] | 55 | DEBIAN_FRONTEND=noninteractive apt -y install bridge-utils |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 56 | |
| 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 Hryhorov | 7319433 | 2020-04-01 13:14:51 +0300 | [diff] [blame] | 69 | 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 Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 70 | |
Oleh Hryhorov | 1832d23 | 2020-03-05 11:33:13 +0200 | [diff] [blame] | 71 | 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 Hryhorov | 85d55b1 | 2020-03-27 16:22:02 +0200 | [diff] [blame] | 80 | 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 Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 89 | cat << EOF >> ${cloud_netplan_cfg} |
| 90 | vlans: |
| 91 | ${PUBLIC_INTERFACE}: |
| 92 | id: 403 |
| 93 | link: $(echo ${PUBLIC_INTERFACE} | cut -d'.' -f1) |
Oleh Hryhorov | 1832d23 | 2020-03-05 11:33:13 +0200 | [diff] [blame] | 94 | ${STORAGE_FRONTEND_INTERFACE_DEF} |
Oleh Hryhorov | 85d55b1 | 2020-03-27 16:22:02 +0200 | [diff] [blame] | 95 | ${STORAGE_BACKEND_INTERFACE_DEF} |
Oleh Hryhorov | 1acc9e5 | 2020-02-13 18:39:15 +0200 | [diff] [blame] | 96 | bridges: |
| 97 | br-public: |
| 98 | dhcp4: false |
| 99 | interfaces: |
| 100 | - ${PUBLIC_INTERFACE} |
| 101 | - veth-br |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 102 | addresses: [ "${PUBLIC_NODE_IP_ADDRESS}/${PUBLIC_NODE_IP_NETMASK}" ] |
| 103 | EOF |
| 104 | |
| 105 | netplan --debug apply |
Vasyl Saienko | 9b68899 | 2020-02-13 13:50:53 +0200 | [diff] [blame] | 106 | |
| 107 | # NOTE(vsaienko): give some time to apply changes |
| 108 | sleep 15 |
Oleh Hryhorov | b58460e | 2020-02-05 15:53:48 +0200 | [diff] [blame] | 109 | } |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 110 | 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 Hryhorov | 08476c3 | 2020-03-10 18:46:51 +0200 | [diff] [blame] | 119 | ramGb: 64 |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 120 | 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 Hryhorov | 08476c3 | 2020-03-10 18:46:51 +0200 | [diff] [blame] | 137 | ramGb: 64 |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 138 | 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 Hryhorov | 08476c3 | 2020-03-10 18:46:51 +0200 | [diff] [blame] | 150 | ramGb: 64 |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 151 | 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 Hryhorov | 08476c3 | 2020-03-10 18:46:51 +0200 | [diff] [blame] | 163 | ramGb: 64 |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 164 | 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 Hryhorov | 08476c3 | 2020-03-10 18:46:51 +0200 | [diff] [blame] | 176 | ramGb: 64 |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 177 | 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 Hryhorov | 08476c3 | 2020-03-10 18:46:51 +0200 | [diff] [blame] | 189 | ramGb: 64 |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 190 | cores: 12 |
| 191 | ips: |
| 192 | - 192.168.122.106 |
| 193 | crushPath: {} |