nosdn fdio scenario fixes
[apex.git] / lib / overcloud-deploy-functions.sh
1 #!/usr/bin/env bash
2 ##############################################################################
3 # Copyright (c) 2015 Tim Rozet (Red Hat), Dan Radez (Red Hat) and others.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 ##preping it for deployment and launch the deploy
12 ##params: none
13 function overcloud_deploy {
14   local num_compute_nodes
15   local num_control_nodes
16   local dpdk_cores pmd_cores socket_mem ovs_dpdk_perf_flag ovs_option_heat_arr
17   declare -A ovs_option_heat_arr
18
19   ovs_option_heat_arr['dpdk_cores']=OvsDpdkCoreList
20   ovs_option_heat_arr['pmd_cores']=PmdCoreList
21   ovs_option_heat_arr['socket_memory']=OvsDpdkSocketMemory
22
23   # OPNFV Default Environment and Network settings
24   DEPLOY_OPTIONS+=" -e ${ENV_FILE}"
25   DEPLOY_OPTIONS+=" -e network-environment.yaml"
26
27   # Custom Deploy Environment Templates
28   if [[ "${#deploy_options_array[@]}" -eq 0 || "${deploy_options_array['sdn_controller']}" == 'opendaylight' ]]; then
29     if [ "${deploy_options_array['sfc']}" == 'True' ]; then
30       DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight_sfc.yaml"
31     elif [ "${deploy_options_array['vpn']}" == 'True' ]; then
32       DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-opendaylight-bgpvpn.yaml"
33       if [ "${deploy_options_array['gluon']}" == 'True' ]; then
34         DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/services/gluon.yaml"
35       fi
36     elif [ "${deploy_options_array['vpp']}" == 'True' ]; then
37       if [ "${deploy_options_array['sdn_l3']}" == "True" ]; then
38         DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-opendaylight-honeycomb.yaml"
39       else
40         DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-opendaylight-honeycomb-l2.yaml"
41       fi
42     else
43       DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-opendaylight-l3.yaml"
44     fi
45     SDN_IMAGE=opendaylight
46   elif [ "${deploy_options_array['sdn_controller']}" == 'opendaylight-external' ]; then
47     DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight-external.yaml"
48     SDN_IMAGE=opendaylight
49   elif [ "${deploy_options_array['sdn_controller']}" == 'onos' ]; then
50     echo -e "${red}ERROR: ONOS is unsupported in Danube...exiting${reset}"
51     exit 1
52     #if [ "${deploy_options_array['sfc']}" == 'True' ]; then
53     #  DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/onos_sfc.yaml"
54     #else
55     #  DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/onos.yaml"
56     #fi
57     #SDN_IMAGE=onos
58   elif [ "${deploy_options_array['sdn_controller']}" == 'ovn' ]; then
59     if [[ "$ha_enabled" == "True" ]]; then
60       DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-ml2-ovn-ha.yaml"
61       echo "${red}OVN HA support is not not supported... exiting.${reset}"
62       exit 1
63     else
64       DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-ml2-ovn.yaml"
65     fi
66     SDN_IMAGE=opendaylight
67   elif [ "${deploy_options_array['sdn_controller']}" == 'opencontrail' ]; then
68     echo -e "${red}ERROR: OpenContrail is currently unsupported...exiting${reset}"
69     exit 1
70   elif [[ -z "${deploy_options_array['sdn_controller']}" || "${deploy_options_array['sdn_controller']}" == 'False' ]]; then
71     echo -e "${blue}INFO: SDN Controller disabled...will deploy nosdn scenario${reset}"
72     if [ "${deploy_options_array['vpp']}" == 'True' ]; then
73       DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-ml2-vpp.yaml"
74     elif [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then
75       DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-ovs-dpdk.yaml"
76     fi
77     SDN_IMAGE=opendaylight
78   else
79     echo "${red}Invalid sdn_controller: ${deploy_options_array['sdn_controller']}${reset}"
80     echo "${red}Valid choices are opendaylight, opendaylight-external, onos, opencontrail, False, or null${reset}"
81     exit 1
82   fi
83
84   # Enable Tacker
85   if [ "${deploy_options_array['tacker']}" == 'True' ]; then
86     DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/enable_tacker.yaml"
87   fi
88
89   # Enable Congress
90   if [ "${deploy_options_array['congress']}" == 'True' ]; then
91     DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/enable_congress.yaml"
92   fi
93
94   # Enable Real Time Kernel (kvm4nfv)
95   if [ "${deploy_options_array['rt_kvm']}" == 'True' ]; then
96     DEPLOY_OPTIONS+=" -e /home/stack/enable_rt_kvm.yaml"
97   fi
98
99   # Make sure the correct overcloud image is available
100   if [ ! -f $IMAGES/overcloud-full-${SDN_IMAGE}.qcow2 ]; then
101       echo "${red} $IMAGES/overcloud-full-${SDN_IMAGE}.qcow2 is required to execute your deployment."
102       echo "Please install the opnfv-apex package to provide this overcloud image for deployment.${reset}"
103       exit 1
104   fi
105
106   echo "Copying overcloud image to Undercloud"
107   ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "rm -f overcloud-full.qcow2"
108   scp ${SSH_OPTIONS[@]} $IMAGES/overcloud-full-${SDN_IMAGE}.qcow2 "stack@$UNDERCLOUD":overcloud-full.qcow2
109
110   # disable neutron openvswitch agent from starting
111   if [[ -n "${deploy_options_array['sdn_controller']}" && "${deploy_options_array['sdn_controller']}" != 'False' ]]; then
112       echo -e "${blue}INFO: Disabling neutron-openvswitch-agent from systemd${reset}"
113       ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
114       LIBGUESTFS_BACKEND=direct virt-customize --run-command "rm -f /etc/systemd/system/multi-user.target.wants/neutron-openvswitch-agent.service" \
115                                                --run-command "rm -f /usr/lib/systemd/system/neutron-openvswitch-agent.service" \
116                                                -a overcloud-full.qcow2
117 EOI
118   fi
119
120   if [ "${deploy_options_array['vpn']}" == 'True' ]; then
121       echo -e "${blue}INFO: Enabling ZRPC and Quagga${reset}"
122       ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
123       LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum -y install /root/quagga/*.rpm" \
124                                                --run-command "sudo usermod -a -G quaggavt quagga" \
125                                                --run-command "sudo mkdir -p /var/run/quagga/" \
126                                                --run-command "sudo chown quagga:quagga -R /var/run/quagga/" \
127                                                --run-command "systemctl enable zrpcd" \
128                                                -a overcloud-full.qcow2
129 EOI
130   fi
131
132   # Install ovs-dpdk inside the overcloud image if it is enabled.
133   if [[ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' || "${deploy_options_array['dataplane']}" == 'fdio' ]]; then
134     # install dpdk packages before ovs
135     echo -e "${blue}INFO: Enabling kernel modules for dpdk inside overcloud image${reset}"
136
137     ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
138       cat << EOF > vfio_pci.modules
139 #!/bin/bash
140 exec /sbin/modprobe vfio_pci >/dev/null 2>&1
141 EOF
142
143       cat << EOF > uio_pci_generic.modules
144 #!/bin/bash
145 exec /sbin/modprobe uio_pci_generic >/dev/null 2>&1
146 EOF
147
148       LIBGUESTFS_BACKEND=direct virt-customize --upload vfio_pci.modules:/etc/sysconfig/modules/ \
149                                                --upload uio_pci_generic.modules:/etc/sysconfig/modules/ \
150                                                --run-command "chmod 0755 /etc/sysconfig/modules/vfio_pci.modules" \
151                                                --run-command "chmod 0755 /etc/sysconfig/modules/uio_pci_generic.modules" \
152                                                -a overcloud-full.qcow2
153
154       if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then
155         sed -i "/OS::TripleO::ComputeExtraConfigPre:/c\  OS::TripleO::ComputeExtraConfigPre: ./ovs-dpdk-preconfig.yaml" network-environment.yaml
156       fi
157
158 EOI
159
160   elif [ "${deploy_options_array['dataplane']}" != 'ovs' ]; then
161     echo "${red}${deploy_options_array['dataplane']} not supported${reset}"
162     exit 1
163   fi
164
165   if [ "$debug" == 'TRUE' ]; then
166     ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "LIBGUESTFS_BACKEND=direct virt-customize -a overcloud-full.qcow2 --root-password password:opnfvapex"
167   fi
168
169   # upgrade ovs into ovs 2.5.90 with NSH function if SFC is enabled
170   if [[ "${deploy_options_array['sfc']}" == 'True' && "${deploy_options_array['dataplane']}" == 'ovs' ]]; then
171     ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
172          LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum install -y /root/ovs/rpm/rpmbuild/RPMS/x86_64/${ovs_kmod_rpm_name}" \
173                                                   --run-command "yum upgrade -y /root/ovs/rpm/rpmbuild/RPMS/x86_64/${ovs_rpm_name}" \
174                                                   -a overcloud-full.qcow2
175 EOI
176   fi
177
178   # Patch neutron with using OVS external interface for router and add generic linux NS interface driver
179   if [[ "${deploy_options_array['dataplane']}" == 'fdio' ]]; then
180     ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
181       LIBGUESTFS_BACKEND=direct virt-customize --run-command "cd /usr/lib/python2.7/site-packages/ && patch -p1 < neutron-patch-NSDriver.patch" \
182                                                -a overcloud-full.qcow2
183 EOI
184
185     # Disable clustering for ODL FDIO HA scenarios
186     if [[ "${deploy_options_array['sdn_controller']}" == 'opendaylight' ]]; then
187       ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
188       LIBGUESTFS_BACKEND=direct virt-customize --run-command "cd /etc/puppet/modules/tripleo/ && patch -p1 < disable_odl_clustering.patch" \
189                                                -a overcloud-full.qcow2
190 EOI
191     fi
192
193     # Configure routing node for odl_l3-fdio
194     if [[ "${deploy_options_array['sdn_l3']}" == 'True' ]]; then
195       ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
196         sed -i "/opendaylight::vpp_routing_node:/c\    opendaylight::vpp_routing_node: ${deploy_options_array['odl_vpp_routing_node']}.${domain_name}" ${ENV_FILE}
197 EOI
198     fi
199   fi
200
201   if [ -n "${deploy_options_array['performance']}" ]; then
202     ovs_dpdk_perf_flag="False"
203     for option in "${performance_options[@]}" ; do
204       if [ "${arr[1]}" == "vpp" ]; then
205         if [ "${arr[0]}" == "Compute" ]; then
206           role='NovaCompute'
207         else
208           role=${arr[0]}
209         fi
210         if [ "${arr[2]}" == "main-core" ]; then
211           ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
212             sed -i "/${role}ExtraConfig:/ c\  ${role}ExtraConfig:\n    fdio::vpp_cpu_main_core: \"'${arr[3]}'\"" ${ENV_FILE}
213 EOI
214         elif [ "${arr[2]}" == "corelist-workers" ]; then
215           ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
216             sed -i "/${role}ExtraConfig:/ c\  ${role}ExtraConfig:\n    fdio::vpp_cpu_corelist_workers: \"'${arr[3]}'\"" ${ENV_FILE}
217 EOI
218         fi
219       fi
220       arr=($option)
221       # use compute's kernel settings for all nodes for now.
222       if [ "${arr[0]}" == "Compute" ] && [ "${arr[1]}" == "kernel" ]; then
223         kernel_args+=" ${arr[2]}=${arr[3]}"
224       fi
225       if [ "${arr[0]}" == "Compute" ] && [ "${arr[1]}" == "ovs" ]; then
226          eval "${arr[2]}=${arr[3]}"
227          ovs_dpdk_perf_flag="True"
228       fi
229     done
230
231     ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
232       sed -i "/ComputeKernelArgs:/c\  ComputeKernelArgs: '$kernel_args'" ${ENV_FILE}
233       sed -i "$ a\resource_registry:\n  OS::TripleO::NodeUserData: first-boot.yaml" ${ENV_FILE}
234       sed -i "/NovaSchedulerDefaultFilters:/c\  NovaSchedulerDefaultFilters: 'RamFilter,ComputeFilter,AvailabilityZoneFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,NUMATopologyFilter'" ${ENV_FILE}
235 EOI
236
237     if [[ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' && "$ovs_dpdk_perf_flag" == "True" ]]; then
238       for ovs_option in ${!ovs_option_heat_arr[@]}; do
239         if [ -n "${!ovs_option}" ]; then
240           ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
241             sed -i "/${ovs_option_heat_arr[$ovs_option]}:/c\  ${ovs_option_heat_arr[$ovs_option]}: ${!ovs_option}" ${ENV_FILE}
242 EOI
243         fi
244       done
245     fi
246   fi
247
248   if [[ -z "${deploy_options_array['sdn_controller']}" || "${deploy_options_array['sdn_controller']}" == 'False' ]]; then
249     if [ "${deploy_options_array['dataplane']}" == "fdio" ]; then
250       if [ "$tenant_nic_mapping_controller_members" == "$tenant_nic_mapping_compute_members" ]; then
251         echo -e "${blue}INFO: nosdn fdio deployment...installing correct vpp packages...${reset}"
252         ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
253           sed -i "/NeutronVPPAgentPhysnets:/c\  NeutronVPPAgentPhysnets: 'datacentre:${tenant_nic_mapping_controller_members}'" ${ENV_FILE}
254           LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum remove -y vpp vpp-api-python vpp-lib vpp-plugins" \
255                                                    --run-command "yum install -y /root/fdio_nosdn/*.rpm" \
256                                                    --run-command "rm -f /etc/sysctl.d/80-vpp.conf" \
257                                                    -a overcloud-full.qcow2
258 EOI
259       else
260         echo -e "${red}Compute and Controller must use the same tenant nic name, please modify network setting file.${reset}"
261         exit 1
262       fi
263     fi
264   fi
265
266   # Set ODL version accordingly
267   if [[ "${deploy_options_array['sdn_controller']}" == 'opendaylight' && -n "${deploy_options_array['odl_version']}" ]]; then
268     case "${deploy_options_array['odl_version']}" in
269       beryllium) odl_version=''
270               ;;
271       boron)  odl_version='boron'
272               ;;
273       carbon) odl_version='master'
274               ;;
275       *) echo -e "${red}Invalid ODL version ${deploy_options_array['odl_version']}.  Please use 'carbon' or 'boron' values.${reset}"
276          exit 1
277          ;;
278     esac
279
280     ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
281       LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum -y remove opendaylight" \
282                                                --run-command "yum -y install /root/${odl_version}/*" \
283                                                -a overcloud-full.qcow2
284 EOI
285   fi
286
287   # Override ODL if FDIO and ODL L2
288   if [[ "${deploy_options_array['vpp']}" == 'True' && "${deploy_options_array['sdn_controller']}" == 'opendaylight' ]]; then
289     if [ "${deploy_options_array['sdn_l3']}" == "False" ]; then
290       ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
291          LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum -y remove opendaylight" \
292                                                   --run-command "yum -y install /root/fdio_l2/opendaylight*.rpm" \
293                                                   -a overcloud-full.qcow2
294 EOI
295     else
296       ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
297          LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum remove -y vpp vpp-api-python vpp-lib vpp-plugins honeycomb" \
298                                                   --run-command "yum -y install /root/fdio_l3/*.rpm" \
299                                                   --run-command "rm -f /etc/sysctl.d/80-vpp.conf" \
300                                                   -a overcloud-full.qcow2
301 EOI
302     fi
303   fi
304
305   # check if ceph should be enabled
306   if [ "${deploy_options_array['ceph']}" == 'True' ]; then
307     DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml"
308   fi
309
310   if [ "${deploy_options_array['sdn_controller']}" == 'ovn' ]; then
311     # The epoch in deloran's ovs is 1: and in leif's is 0:
312     # so we have to execute a downgrade instead of an update
313     ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
314       LIBGUESTFS_BACKEND=direct virt-customize \
315         --run-command "cd /root/ovs27 && yum update -y *openvswitch*" \
316         --run-command "cd /root/ovs27 && yum downgrade -y *openvswitch*" \
317         -a overcloud-full.qcow2
318 EOI
319   fi
320
321   # get number of nodes available in inventory
322   num_control_nodes=$(ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "grep -c profile:control /home/stack/instackenv.json")
323   num_compute_nodes=$(ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "grep -c profile:compute /home/stack/instackenv.json")
324
325   # check if HA is enabled
326   if [[ "$ha_enabled" == "True" ]]; then
327     if [ "$num_control_nodes" -lt 3 ]; then
328       echo -e "${red}ERROR: Number of control nodes in inventory is less than 3 and HA is enabled: ${num_control_nodes}. Check your inventory file.${reset}"
329       exit 1
330     else
331      DEPLOY_OPTIONS+=" --control-scale ${num_control_nodes}"
332      DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml"
333      echo -e "${blue}INFO: Number of control nodes set for deployment: ${num_control_nodes}${reset}"
334     fi
335   else
336     if [ "$num_control_nodes" -lt 1 ]; then
337       echo -e "${red}ERROR: Number of control nodes in inventory is less than 1: ${num_control_nodes}. Check your inventory file.${reset}"
338       exit 1
339     fi
340   fi
341
342   if [ "$num_compute_nodes" -le 0 ]; then
343     echo -e "${red}ERROR: Invalid number of compute nodes: ${num_compute_nodes}. Check your inventory file.${reset}"
344     exit 1
345   else
346     echo -e "${blue}INFO: Number of compute nodes set for deployment: ${num_compute_nodes}${reset}"
347     DEPLOY_OPTIONS+=" --compute-scale ${num_compute_nodes}"
348   fi
349
350   DEPLOY_OPTIONS+=" --ntp-server $ntp_server"
351
352   DEPLOY_OPTIONS+=" --control-flavor control --compute-flavor compute"
353   if [[ "$virtual" == "TRUE" ]]; then
354      DEPLOY_OPTIONS+=" -e virtual-environment.yaml"
355   fi
356
357   echo -e "${blue}INFO: Deploy options set:\n${DEPLOY_OPTIONS}${reset}"
358
359   ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
360 # Create a key for use by nova for live migration
361 echo "Creating nova SSH key for nova resize support"
362 ssh-keygen -f nova_id_rsa -b 1024 -P ""
363 public_key=\'\$(cat nova_id_rsa.pub | cut -d ' ' -f 2)\'
364 sed -i "s#replace_public_key:#key: \$public_key#g" ${ENV_FILE}
365 python -c 'open("opnfv-environment-new.yaml", "w").write((open("${ENV_FILE}").read().replace("replace_private_key:", "key: \"" + "".join(open("nova_id_rsa").readlines()).replace("\\n","\\\n") + "\"")))'
366 mv -f opnfv-environment-new.yaml ${ENV_FILE}
367
368 source stackrc
369 set -o errexit
370 # Workaround for APEX-207 where sometimes swift proxy is down
371 if ! sudo systemctl status openstack-swift-proxy > /dev/null; then
372   sudo systemctl restart openstack-swift-proxy
373 fi
374 echo "Uploading overcloud glance images"
375 openstack overcloud image upload
376
377 echo "Configuring undercloud and discovering nodes"
378 openstack baremetal import --json instackenv.json
379
380 if [[ -z "$virtual" ]]; then
381   openstack baremetal introspection bulk start
382   if [[ -n "$root_disk_list" ]]; then
383     openstack baremetal configure boot --root-device=${root_disk_list}
384   else
385     openstack baremetal configure boot
386   fi
387 else
388   openstack baremetal configure boot
389 fi
390
391 echo "Configuring flavors"
392 for flavor in baremetal control compute; do
393   echo -e "${blue}INFO: Updating flavor: \${flavor}${reset}"
394   if openstack flavor list | grep \${flavor}; then
395     openstack flavor delete \${flavor}
396   fi
397   openstack flavor create --id auto --ram 4096 --disk 39 --vcpus 1 \${flavor}
398   if ! openstack flavor list | grep \${flavor}; then
399     echo -e "${red}ERROR: Unable to create flavor \${flavor}${reset}"
400   fi
401 done
402 openstack flavor set --property "cpu_arch"="x86_64" --property "capabilities:boot_option"="local" baremetal
403 openstack flavor set --property "cpu_arch"="x86_64" --property "capabilities:boot_option"="local" --property "capabilities:profile"="control" control
404 openstack flavor set --property "cpu_arch"="x86_64" --property "capabilities:boot_option"="local" --property "capabilities:profile"="compute" compute
405 echo "Configuring nameserver on ctlplane network"
406 dns_server_ext=''
407 for dns_server in ${dns_servers}; do
408   dns_server_ext="\${dns_server_ext} --dns-nameserver \${dns_server}"
409 done
410 neutron subnet-update \$(neutron subnet-list | grep -Ev "id|tenant|external|storage" | grep -v \\\\-\\\\- | awk {'print \$2'}) \${dns_server_ext}
411 sed -i '/CloudDomain:/c\  CloudDomain: '${domain_name} ${ENV_FILE}
412 echo "Executing overcloud deployment, this should run for an extended period without output."
413 sleep 60 #wait for Hypervisor stats to check-in to nova
414 # save deploy command so it can be used for debugging
415 cat > deploy_command << EOF
416 openstack overcloud deploy --templates $DEPLOY_OPTIONS --timeout 90
417 EOF
418 EOI
419
420   if [ "$interactive" == "TRUE" ]; then
421     if ! prompt_user "Overcloud Deployment"; then
422       echo -e "${blue}INFO: User requests exit${reset}"
423       exit 0
424     fi
425   fi
426
427   ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
428 source stackrc
429 openstack overcloud deploy --templates $DEPLOY_OPTIONS --timeout 90
430 if ! openstack stack list | grep CREATE_COMPLETE 1>/dev/null; then
431   $(typeset -f debug_stack)
432   debug_stack
433   exit 1
434 fi
435 EOI
436
437   # Configure DPDK and restart ovs agent after bringing up br-phy
438   if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then
439     ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI || (echo "DPDK config failed, exiting..."; exit 1)
440 source stackrc
441 set -o errexit
442 for node in \$(nova list | grep novacompute | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+"); do
443 echo "Checking DPDK status and bringing up br-phy on \$node"
444 ssh -T ${SSH_OPTIONS[@]} "heat-admin@\$node" <<EOF
445 set -o errexit
446 sudo dpdk-devbind -s
447 sudo ifup br-phy
448 if [[ -z "${deploy_options_array['sdn_controller']}" || "${deploy_options_array['sdn_controller']}" == 'False' ]]; then
449   echo "Restarting openvswitch agent to pick up VXLAN tunneling"
450   sudo systemctl restart neutron-openvswitch-agent
451 fi
452 EOF
453 done
454 EOI
455   fi
456
457   if [ "$debug" == 'TRUE' ]; then
458       ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
459 source overcloudrc
460 echo "Keystone Endpoint List:"
461 openstack endpoint list
462 echo "Keystone Service List"
463 openstack service list
464 EOI
465   fi
466 }