Dan Timoney | 470fa2b | 2017-10-12 09:18:24 -0400 | [diff] [blame] | 1 | .. This work is licensed under a Creative Commons Attribution 4.0 International License. |
| 2 | .. http://creativecommons.org/licenses/by/4.0 |
| 3 | |
Abdelmuhaimen Seaudi | 50ebffd | 2017-11-20 19:00:17 +0000 | [diff] [blame] | 4 | Introduction |
Dan Timoney | 470fa2b | 2017-10-12 09:18:24 -0400 | [diff] [blame] | 5 | ============ |
Abdelmuhaimen Seaudi | 50ebffd | 2017-11-20 19:00:17 +0000 | [diff] [blame] | 6 | The purpose of this document is to explain how to build an ONAP SDNC Instance on vanilla Openstack deployment. |
| 7 | The document begins with creation of a network, and a VM. |
| 8 | Then, the document explains how to run the installation scripts on the VM. |
| 9 | Finally, the document shows how to check that the SDNC installation was completed successfully. |
Mohamed Waly | 5fa33d1 | 2018-11-22 08:27:05 +0000 | [diff] [blame] | 10 | This document and logs were created on 22 November, 2018. |
Dan Timoney | 470fa2b | 2017-10-12 09:18:24 -0400 | [diff] [blame] | 11 | |
Abdelmuhaimen Seaudi | 50ebffd | 2017-11-20 19:00:17 +0000 | [diff] [blame] | 12 | Infrastructure setup on OpenStack |
| 13 | --------------------------------- |
| 14 | Create the network, we call it “ONAP-net”: |
Dan Timoney | 470fa2b | 2017-10-12 09:18:24 -0400 | [diff] [blame] | 15 | |
Abdelmuhaimen Seaudi | 50ebffd | 2017-11-20 19:00:17 +0000 | [diff] [blame] | 16 | :: |
Dan Timoney | 470fa2b | 2017-10-12 09:18:24 -0400 | [diff] [blame] | 17 | |
Abdelmuhaimen Seaudi | 50ebffd | 2017-11-20 19:00:17 +0000 | [diff] [blame] | 18 | cloud@olc-ubuntu2:~$ neutron net-create onap-net |
| 19 | neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead. |
| 20 | Created a new network: |
| 21 | +-----------------+--------------------------------------+ |
| 22 | | Field | Value | |
| 23 | +-----------------+--------------------------------------+ |
| 24 | | admin_state_up | True | |
| 25 | | id | 662650f0-d178-4745-b4fe-dd2cb735160c | |
| 26 | | name | onap-net | |
| 27 | | router:external | False | |
| 28 | | shared | False | |
| 29 | | status | ACTIVE | |
| 30 | | subnets | | |
| 31 | | tenant_id | 324b90de6e9a4ad88e93a100c2cedd5d | |
| 32 | +-----------------+--------------------------------------+ |
| 33 | cloud@olc-ubuntu2:~$ |
Dan Timoney | 470fa2b | 2017-10-12 09:18:24 -0400 | [diff] [blame] | 34 | |
Abdelmuhaimen Seaudi | 50ebffd | 2017-11-20 19:00:17 +0000 | [diff] [blame] | 35 | Create the subnet, “ONAP-subnet”: |
| 36 | |
| 37 | :: |
| 38 | |
| 39 | cloud@olc-ubuntu2:~$ neutron subnet-create --name onap-subnet onap-net 10.0.0.0/16 |
| 40 | neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead. |
| 41 | Created a new subnet: |
| 42 | +-------------------+----------------------------------------------+ |
| 43 | | Field | Value | |
| 44 | +-------------------+----------------------------------------------+ |
| 45 | | allocation_pools | {"start": "10.0.0.2", "end": "10.0.255.254"} | |
| 46 | | cidr | 10.0.0.0/16 | |
| 47 | | dns_nameservers | | |
| 48 | | enable_dhcp | True | |
| 49 | | gateway_ip | 10.0.0.1 | |
| 50 | | host_routes | | |
| 51 | | id | 574df42f-15e9-4761-a4c5-e48d64f04b99 | |
| 52 | | ip_version | 4 | |
| 53 | | ipv6_address_mode | | |
| 54 | | ipv6_ra_mode | | |
| 55 | | name | onap-subnet | |
| 56 | | network_id | 662650f0-d178-4745-b4fe-dd2cb735160c | |
| 57 | | tenant_id | 324b90de6e9a4ad88e93a100c2cedd5d | |
| 58 | +-------------------+----------------------------------------------+ |
| 59 | cloud@olc-ubuntu2:~$ |
| 60 | |
| 61 | Boot an Ubuntu 14.04 instance, using the correct flavor name according to your Openstack : |
| 62 | |
| 63 | :: |
| 64 | |
| 65 | cloud@olc-ubuntu2:~$ nova boot --flavor n2.cw.standard-4 --image "Ubuntu 14.04" --key-name olc- |
| 66 | key2 --nic net-name=onap-net,v4-fixed-ip=10.0.7.1 vm1-sdnc |
| 67 | +--------------------------------------+-----------------------------------------------------+ |
| 68 | | Property | Value | |
| 69 | +--------------------------------------+-----------------------------------------------------+ |
| 70 | | OS-DCF:diskConfig | MANUAL | |
| 71 | | OS-EXT-AZ:availability_zone | | |
| 72 | | OS-EXT-STS:power_state | 0 | |
| 73 | | OS-EXT-STS:task_state | scheduling | |
| 74 | | OS-EXT-STS:vm_state | building | |
| 75 | | OS-SRV-USG:launched_at | - | |
| 76 | | OS-SRV-USG:terminated_at | - | |
| 77 | | accessIPv4 | | |
| 78 | | accessIPv6 | | |
| 79 | | config_drive | | |
| 80 | | created | 2017-11-14T15:48:37Z | |
| 81 | | flavor | n2.cw.standard-4 (44) | |
| 82 | | hostId | | |
| 83 | | id | 596e2b1f-ff09-4c8e-b3e8-fc06566306cf | |
| 84 | | image | Ubuntu 14.04 (ac9d6735-7c2b-4ff1-90e9-b45225fd80a9) | |
| 85 | | key_name | olc-key2 | |
| 86 | | metadata | {} | |
| 87 | | name | vm1-sdnc | |
| 88 | | os-extended-volumes:volumes_attached | [] | |
| 89 | | progress | 0 | |
| 90 | | security_groups | default | |
| 91 | | status | BUILD | |
| 92 | | tenant_id | 324b90de6e9a4ad88e93a100c2cedd5d | |
| 93 | | updated | 2017-11-14T15:48:38Z | |
| 94 | | user_id | 24c673ecc97f4b42887a195654d6a0b9 | |
| 95 | +--------------------------------------+-----------------------------------------------------+ |
| 96 | cloud@olc-ubuntu2:~$ |
| 97 | |
| 98 | Create a floating IP and associate to the SDNC VM so that it can access internet to download needed files: |
| 99 | |
| 100 | :: |
| 101 | |
| 102 | cloud@olc-ubuntu2:~$ neutron floatingip-create public |
| 103 | neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead. |
| 104 | Created a new floatingip: |
| 105 | +---------------------+--------------------------------------+ |
| 106 | | Field | Value | |
| 107 | +---------------------+--------------------------------------+ |
| 108 | | fixed_ip_address | | |
| 109 | | floating_ip_address | 84.39.47.153 | |
| 110 | | floating_network_id | b5dd7532-1533-4b9c-8bf9-e66631a9be1d | |
| 111 | | id | eac0124f-9c92-47e5-a694-53355c06c6b2 | |
| 112 | | port_id | | |
| 113 | | router_id | | |
| 114 | | status | ACTIVE | |
| 115 | | tenant_id | 324b90de6e9a4ad88e93a100c2cedd5d | |
| 116 | +---------------------+--------------------------------------+ |
| 117 | cloud@olc-ubuntu2:~$ |
| 118 | cloud@olc-ubuntu2:~$ neutron port-list |
| 119 | neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead. |
| 120 | +--------------------------------------+--------------------------------------+-------------------+-------------------------------------------------------------------------------------+ |
| 121 | | id | name | mac_address | fixed_ips | |
| 122 | +--------------------------------------+--------------------------------------+-------------------+-------------------------------------------------------------------------------------+ |
| 123 | | 5d8e8f30-a13a-417d-b5b4-f4038224364b | 5d8e8f30-a13a-417d-b5b4-f4038224364b | 02:5d:8e:8f:30:a1 | {"subnet_id": "574df42f-15e9-4761-a4c5-e48d64f04b99", "ip_address": "10.0.7.1"} | |
| 124 | +--------------------------------------+--------------------------------------+-------------------+-------------------------------------------------------------------------------------+ |
| 125 | cloud@olc-ubuntu2:~$ |
| 126 | cloud@olc-ubuntu2:~$ neutron floatingip-associate eac0124f-9c92-47e5-a694-53355c06c6b25d8e8f30-a13a-417d-b5b4-f4038224364b |
| 127 | neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead. |
| 128 | Associated floating IP eac0124f-9c92-47e5-a694-53355c06c6b2 |
| 129 | cloud@olc-ubuntu2:~$ |
| 130 | |
| 131 | Add the security group to the VM in order to open needed ports for SDNC like port 22, 3000, 8282 etc ...: |
| 132 | |
| 133 | :: |
| 134 | |
| 135 | cloud@olc-ubuntu2:~$ nova add-secgroup vm1-sdnc olc-onap |
| 136 | cloud@olc-ubuntu2:~$ |
| 137 | |
| 138 | Installing SDNC |
| 139 | --------------- |
| 140 | |
Mohamed Waly | 5fa33d1 | 2018-11-22 08:27:05 +0000 | [diff] [blame] | 141 | Connect to the new VM and change to user "root", and run the following commands to start the installation: |
Abdelmuhaimen Seaudi | 50ebffd | 2017-11-20 19:00:17 +0000 | [diff] [blame] | 142 | |
| 143 | :: |
| 144 | |
Mohamed Waly | 5fa33d1 | 2018-11-22 08:27:05 +0000 | [diff] [blame] | 145 | # Login as root |
| 146 | sudo -i |
| 147 | # Clone Casablanca branch for demo Repo |
| 148 | root@sdnc-test:~# git clone https://gerrit.onap.org/r/demo -b casablanca |
| 149 | Cloning into 'demo'... |
| 150 | remote: Counting objects: 10, done |
| 151 | remote: Finding sources: 100% (10/10) |
| 152 | remote: Total 9562 (delta 0), reused 9562 (delta 0) |
| 153 | Receiving objects: 100% (9562/9562), 43.00 MiB | 13.84 MiB/s, done. |
| 154 | Resolving deltas: 100% (5922/5922), done. |
| 155 | Checking connectivity... done. |
| 156 | root@sdnc-test:~# |
| 157 | |
| 158 | Use below commands to update installation environment |
| 159 | |
| 160 | :: |
| 161 | |
| 162 | # Create Configuration directory |
| 163 | mkdir -p /opt/config |
| 164 | # Update configuration folder with variables used during the installation |
| 165 | awk '$1 == "artifacts_version:" {print $2}' /root/demo/heat/ONAP/onap_openstack.env > /opt/config/artifacts_version.txt |
| 166 | awk '$1 == "sdnc_repo:" {print $2}' /root/demo/heat/ONAP/onap_openstack.env > /opt/config/remote_repo.txt |
| 167 | awk '$1 == "sdnc_branch:" {print $2}' /root/demo/heat/ONAP/onap_openstack.env > /opt/config/gerrit_branch.txt |
| 168 | echo "no_proxy" > /opt/config/http_proxy.txt |
| 169 | echo "no_proxy" > /opt/config/https_proxy.txt |
| 170 | echo "https://nexus.onap.org" > /opt/config/nexus_artifact_repo.txt |
| 171 | echo "8.8.8.8" > /opt/config/external_dns.txt |
| 172 | awk '$1 == "dns_ip_addr:" {print $2}' /root/demo/heat/ONAP/onap_openstack.env > /opt/config/dns_ip_addr.txt |
| 173 | awk '$1 == "nexus_username:" {print $2}' /root/demo/heat/ONAP/onap_openstack.env > /opt/config/nexus_username.txt |
| 174 | awk '$1 == "nexus_password:" {print $2}' /root/demo/heat/ONAP/onap_openstack.env > /opt/config/nexus_password.txt |
| 175 | awk '$1 == "nexus_docker_repo:" {print $2}' /root/demo/heat/ONAP/onap_openstack.env > /opt/config/nexus_docker_repo.txt |
| 176 | awk '$1 == "sdnc_docker:" {gsub("\"","",$2);print $2}' /root/demo/heat/ONAP/onap_openstack.env > /opt/config/docker_version.txt |
| 177 | awk '$1 == "dgbuilder_docker:" {gsub("\"","",$2);print $2}' /root/demo/heat/ONAP/onap_openstack.env > /opt/config/dgbuilder_version.txt |
| 178 | # Add host name to /etc/host to avoid warnings in openstack images |
| 179 | echo 127.0.0.1 $(hostname) >> /etc/hosts |
| 180 | # Install additional components |
| 181 | apt update |
| 182 | apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual apt-transport-https ca-certificates wget git ntp ntpdate make jq unzip |
| 183 | # Enable autorestart when VM reboots |
| 184 | chmod +x /root/demo/heat/ONAP/cloud-config/serv.sh |
| 185 | cp /root/demo/heat/ONAP/cloud-config/serv.sh /etc/init.d |
| 186 | update-rc.d serv.sh defaults |
| 187 | |
| 188 | Install docker engine |
| 189 | |
| 190 | :: |
| 191 | |
| 192 | echo "deb https://apt.dockerproject.org/repo ubuntu-$(lsb_release -cs) main" | tee /etc/apt/sources.list.d/docker.list |
| 193 | apt-get update |
| 194 | apt-get install -y --allow-unauthenticated docker-engine |
| 195 | |
| 196 | Install docker-compose & complete docker configuration |
| 197 | |
| 198 | :: |
| 199 | |
| 200 | root@sdnc-test:~# mkdir -p /opt/docker |
| 201 | root@sdnc-test:~# curl -L "https://github.com/docker/compose/releases/download/1.16.1/docker-compose-$(uname -s)-$(uname -m)" > /opt/docker/docker-compose |
| 202 | % Total % Received % Xferd Average Speed Time Time Time Current |
Abdelmuhaimen Seaudi | 50ebffd | 2017-11-20 19:00:17 +0000 | [diff] [blame] | 203 | Dload Upload Total Spent Left Speed |
Mohamed Waly | 5fa33d1 | 2018-11-22 08:27:05 +0000 | [diff] [blame] | 204 | 100 8648k 100 8648k 0 0 3925k 0 0:00:02 0:00:02 --:--:-- 10.3M |
| 205 | root@sdnc-test:~# chmod +x /opt/docker/docker-compose |
| 206 | # Set the MTU size of docker containers to the minimum MTU size supported by vNICs |
| 207 | root@sdnc-test:~# MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) |
| 208 | root@sdnc-test:~# echo "DOCKER_OPTS=\"$DNS_FLAG--mtu=$MTU\"" >> /etc/default/docker |
| 209 | root@sdnc-test:~# cp /lib/systemd/system/docker.service /etc/systemd/system |
| 210 | root@sdnc-test:~# sed -i "/ExecStart/s/$/ --mtu=$MTU/g" /etc/systemd/system/docker.service |
| 211 | root@sdnc-test:~# systemctl daemon-reload |
| 212 | root@sdnc-test:~# service docker restart |
| 213 | # DNS IP address configuration |
| 214 | root@sdnc-test:~# echo "nameserver $(cat /opt/config/external_dns.txt)" >> /etc/resolvconf/resolv.conf.d/head |
| 215 | root@sdnc-test:~# resolvconf -u |
| 216 | |
| 217 | Copy & run installation scripts |
| 218 | |
| 219 | :: |
| 220 | |
| 221 | # Copy installation scripts to opt directory |
| 222 | root@sdnc-test:~# cp /root/demo/heat/ONAP/cloud-config/sdnc_install.sh /opt/sdnc_install.sh |
| 223 | root@sdnc-test:~# cp /root/demo/heat/ONAP/cloud-config/sdnc_vm_init.sh /opt/sdnc_vm_init.sh |
| 224 | # Run installation script |
| 225 | root@sdnc-test:~# cd /opt |
| 226 | root@sdnc-test:~# chmod +x sdnc_install.sh |
| 227 | root@sdnc-test:~# chmod +x sdnc_vm_init.sh |
| 228 | root@sdnc-test:~# ./sdnc_install.sh |
| 229 | Cloning into 'sdnc'... |
| 230 | remote: Finding sources: 100% (8962/8962) |
| 231 | remote: Total 8962 (delta 3999), reused 8956 (delta 3999) |
| 232 | Receiving objects: 100% (8962/8962), 702.76 MiB | 19.20 MiB/s, done. |
| 233 | Resolving deltas: 100% (3999/3999), done. |
| 234 | Checking connectivity... done. |
| 235 | Already up-to-date. |
| 236 | Login Succeeded |
| 237 | 1.4-STAGING-latest: Pulling from onap/sdnc-image |
| 238 | 18d680d61657: Pull complete |
Abdelmuhaimen Seaudi | 50ebffd | 2017-11-20 19:00:17 +0000 | [diff] [blame] | 239 | … output truncated … |
| 240 | |
| 241 | The following install logs shows the containers are coming up, meaning a successful deployment of the SDNC: |
| 242 | |
| 243 | :: |
| 244 | |
| 245 | ... truncated output ... |
Mohamed Waly | 5fa33d1 | 2018-11-22 08:27:05 +0000 | [diff] [blame] | 246 | d3565df0a804: Pull complete |
| 247 | Digest: sha256:0ba03586c705ca8f79030586a579001c4fab3d6fa8c388b6c1c37c695645b78e |
Abdelmuhaimen Seaudi | 50ebffd | 2017-11-20 19:00:17 +0000 | [diff] [blame] | 248 | Status: Downloaded newer image for mysql/mysql-server:5.6 |
Mohamed Waly | 5fa33d1 | 2018-11-22 08:27:05 +0000 | [diff] [blame] | 249 | Creating sdnc_db_container ... |
| 250 | Creating sdnc_db_container ... done |
| 251 | Creating sdnc_ansible_container ... |
| 252 | Creating sdnc_ansible_container ... done |
| 253 | Creating sdnc_controller_container ... |
| 254 | Creating sdnc_controller_container ... done |
| 255 | Creating sdnc_ueblistener_container ... |
| 256 | Creating sdnc_portal_container ... |
| 257 | Creating sdnc_dgbuilder_container ... |
| 258 | Creating sdnc_dmaaplistener_container ... |
Abdelmuhaimen Seaudi | 50ebffd | 2017-11-20 19:00:17 +0000 | [diff] [blame] | 259 | Creating sdnc_ueblistener_container |
Mohamed Waly | 5fa33d1 | 2018-11-22 08:27:05 +0000 | [diff] [blame] | 260 | Creating sdnc_portal_container |
| 261 | Creating sdnc_dmaaplistener_container |
| 262 | Creating sdnc_dgbuilder_container ... done |
Abdelmuhaimen Seaudi | 50ebffd | 2017-11-20 19:00:17 +0000 | [diff] [blame] | 263 | |
| 264 | Check that the containers are up and running: |
| 265 | |
| 266 | :: |
| 267 | |
Mohamed Waly | 5fa33d1 | 2018-11-22 08:27:05 +0000 | [diff] [blame] | 268 | root@sdnc-test:/opt# docker container list |
| 269 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
| 270 | 9de71aea163a onap/ccsdk-dgbuilder-image:latest "/bin/bash -c 'cd ..." 11 minutes ago Up 11 minutes 0.0.0.0:3000->3100/tcp sdnc_dgbuilder_container |
| 271 | adffc0e70758 onap/sdnc-dmaap-listener-image:latest "/opt/onap/sdnc/dm..." 11 minutes ago Up 11 minutes sdnc_dmaaplistener_container |
| 272 | 53bfa2e31c44 onap/admportal-sdnc-image:latest "/bin/bash -c 'cd ..." 11 minutes ago Up 11 minutes 0.0.0.0:8843->8843/tcp sdnc_portal_container |
| 273 | 2fd18ceb09de onap/sdnc-image:latest "/opt/onap/sdnc/bi..." 11 minutes ago Up 11 minutes 0.0.0.0:8282->8181/tcp sdnc_controller_container |
| 274 | 3ddb85174acb onap/sdnc-ansible-server-image:latest "/opt/onap/ccsdk/s..." 11 minutes ago Up 11 minutes 0.0.0.0:32769->8000/tcp sdnc_ansible_container |
| 275 | 4a11c393ffa3 mysql/mysql-server:5.6 "/entrypoint.sh my..." 11 minutes ago Up 11 minutes (healthy) 0.0.0.0:32768->3306/tcp sdnc_db_container |
| 276 | root@sdnc-test:/opt# |
Abdelmuhaimen Seaudi | 50ebffd | 2017-11-20 19:00:17 +0000 | [diff] [blame] | 277 | |
| 278 | Login into APIDOC Explorer and check that you can see Swagger UI interface with all the APIs: |
| 279 | |
| 280 | :: |
| 281 | |
| 282 | APIDOC Explorer URL: http://{SDNC-IP}:8282/apidoc/explorer/index.html |
| 283 | Username: admin |
| 284 | Password: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U |
| 285 | |
| 286 | Login into DG Builder and check that you can see the GUI: |
| 287 | |
| 288 | :: |
| 289 | |
| 290 | DG Builder URL: http://dguser:test123@{SDNC-IP}:3000 |