2 ##############################################################################
3 # Copyright (c) 2015 Tim Rozet (Red Hat), Dan Radez (Red Hat) and others.
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 ##############################################################################
11 ##preping it for deployment and launch the deploy
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
19 ovs_option_heat_arr['dpdk_cores']=HostCpusList
20 ovs_option_heat_arr['pmd_cores']=NeutronDpdkCoreList
21 ovs_option_heat_arr['socket_memory']=NeutronDpdkSocketMemory
22 ovs_option_heat_arr['memory_channels']=NeutronDpdkMemoryChannels
24 # OPNFV Default Environment and Network settings
25 DEPLOY_OPTIONS+=" -e ${ENV_FILE}"
26 DEPLOY_OPTIONS+=" -e network-environment.yaml"
28 # get number of nodes available in inventory
29 num_control_nodes=$(ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "grep -c profile:control /home/stack/instackenv.json")
30 num_compute_nodes=$(ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "grep -c profile:compute /home/stack/instackenv.json")
32 # Custom Deploy Environment Templates
33 if [[ "${#deploy_options_array[@]}" -eq 0 || "${deploy_options_array['sdn_controller']}" == 'opendaylight' ]]; then
34 if [ "${deploy_options_array['sfc']}" == 'True' ]; then
35 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-sfc-opendaylight.yaml"
36 elif [ "${deploy_options_array['vpn']}" == 'True' ]; then
37 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-bgpvpn-opendaylight.yaml"
38 if [ "${deploy_options_array['gluon']}" == 'True' ]; then
39 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/services/gluon.yaml"
41 elif [ "${deploy_options_array['vpp']}" == 'True' ]; then
42 if [ "${deploy_options_array['odl_vpp_netvirt']}" == "True" ]; then
43 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-opendaylight-netvirt-vpp.yaml"
44 elif [ "${deploy_options_array['odl_vpp_routing_node']}" == "dvr" ]; then
45 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-opendaylight-fdio-dvr.yaml"
47 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-opendaylight-honeycomb.yaml"
50 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-opendaylight.yaml"
52 SDN_IMAGE=opendaylight
53 elif [ "${deploy_options_array['sdn_controller']}" == 'opendaylight-external' ]; then
54 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight-external.yaml"
55 SDN_IMAGE=opendaylight
56 elif [ "${deploy_options_array['sdn_controller']}" == 'onos' ]; then
57 if [ "${deploy_options_array['sfc']}" == 'True' ]; then
58 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-onos-sfc.yaml"
60 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-onos.yaml"
63 elif [ "${deploy_options_array['sdn_controller']}" == 'ovn' ]; then
64 if [[ "$ha_enabled" == "True" ]]; then
65 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-ml2-ovn-ha.yaml"
66 echo "${red}OVN HA support is not not supported... exiting.${reset}"
69 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-ml2-ovn.yaml"
71 SDN_IMAGE=opendaylight
72 elif [ "${deploy_options_array['sdn_controller']}" == 'opencontrail' ]; then
73 echo -e "${red}ERROR: OpenContrail is currently unsupported...exiting${reset}"
75 elif [[ -z "${deploy_options_array['sdn_controller']}" || "${deploy_options_array['sdn_controller']}" == 'False' ]]; then
76 echo -e "${blue}INFO: SDN Controller disabled...will deploy nosdn scenario${reset}"
77 if [ "${deploy_options_array['vpp']}" == 'True' ]; then
78 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-ml2-vpp.yaml"
79 elif [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then
80 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-ovs-dpdk.yaml"
82 SDN_IMAGE=opendaylight
84 echo "${red}Invalid sdn_controller: ${deploy_options_array['sdn_controller']}${reset}"
85 echo "${red}Valid choices are opendaylight, opendaylight-external, onos, opencontrail, False, or null${reset}"
90 if [ "${deploy_options_array['tacker']}" == 'True' ]; then
91 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/enable_tacker.yaml"
95 if [ "${deploy_options_array['congress']}" == 'True' ]; then
96 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/enable_congress.yaml"
99 # Enable Real Time Kernel (kvm4nfv)
100 if [ "${deploy_options_array['rt_kvm']}" == 'True' ]; then
101 DEPLOY_OPTIONS+=" -e /home/stack/enable_rt_kvm.yaml"
104 # Enable Barometer service
105 if [ "${deploy_options_array['barometer']}" == 'True' ]; then
106 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/enable_barometer.yaml"
109 # Make sure the correct overcloud image is available
110 if [ ! -f $IMAGES/overcloud-full-${SDN_IMAGE}.qcow2 ]; then
111 echo "${red} $IMAGES/overcloud-full-${SDN_IMAGE}.qcow2 is required to execute your deployment."
112 echo "Please install the opnfv-apex package to provide this overcloud image for deployment.${reset}"
116 echo "Copying overcloud image to Undercloud"
117 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "rm -f overcloud-full.qcow2"
118 scp ${SSH_OPTIONS[@]} $IMAGES/overcloud-full-${SDN_IMAGE}.qcow2 "stack@$UNDERCLOUD":overcloud-full.qcow2
120 # disable neutron openvswitch agent from starting
121 if [[ -n "${deploy_options_array['sdn_controller']}" && "${deploy_options_array['sdn_controller']}" != 'False' ]]; then
122 echo -e "${blue}INFO: Disabling neutron-openvswitch-agent from systemd${reset}"
123 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
124 LIBGUESTFS_BACKEND=direct virt-customize --run-command "rm -f /etc/systemd/system/multi-user.target.wants/neutron-openvswitch-agent.service" \
125 --run-command "rm -f /usr/lib/systemd/system/neutron-openvswitch-agent.service" \
126 -a overcloud-full.qcow2
130 if [ "${deploy_options_array['vpn']}" == 'True' ]; then
131 echo -e "${blue}INFO: Enabling ZRPC and Quagga${reset}"
132 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
133 LIBGUESTFS_BACKEND=direct virt-customize \
134 --run-command "systemctl enable zrpcd" \
135 -a overcloud-full.qcow2
139 # Install ovs-dpdk inside the overcloud image if it is enabled.
140 if [[ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' || "${deploy_options_array['dataplane']}" == 'fdio' ]]; then
141 # install dpdk packages before ovs
142 echo -e "${blue}INFO: Enabling kernel modules for dpdk inside overcloud image${reset}"
144 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
145 cat << EOF > vfio_pci.modules
147 exec /sbin/modprobe vfio_pci >/dev/null 2>&1
150 cat << EOF > uio_pci_generic.modules
152 exec /sbin/modprobe uio_pci_generic >/dev/null 2>&1
155 LIBGUESTFS_BACKEND=direct virt-customize --upload vfio_pci.modules:/etc/sysconfig/modules/ \
156 --upload uio_pci_generic.modules:/etc/sysconfig/modules/ \
157 --run-command "chmod 0755 /etc/sysconfig/modules/vfio_pci.modules" \
158 --run-command "chmod 0755 /etc/sysconfig/modules/uio_pci_generic.modules" \
159 -a overcloud-full.qcow2
161 if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then
162 sed -i "/OS::TripleO::ComputeExtraConfigPre:/c\ OS::TripleO::ComputeExtraConfigPre: ./ovs-dpdk-preconfig.yaml" network-environment.yaml
167 elif [ "${deploy_options_array['dataplane']}" != 'ovs' ]; then
168 echo "${red}${deploy_options_array['dataplane']} not supported${reset}"
172 if [ "$debug" == 'TRUE' ]; then
173 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "LIBGUESTFS_BACKEND=direct virt-customize -a overcloud-full.qcow2 --root-password password:opnfvapex"
176 # upgrade ovs into ovs ovs 2.6.1 with NSH function if SFC is enabled
177 if [[ "${deploy_options_array['sfc']}" == 'True' && "${deploy_options_array['dataplane']}" == 'ovs' ]]; then
178 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
179 LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum install -y /root/ovs/rpm/rpmbuild/RPMS/x86_64/${ovs_kmod_rpm_name}" \
180 --run-command "yum upgrade -y /root/ovs/rpm/rpmbuild/RPMS/x86_64/${ovs_rpm_name}" \
181 -a overcloud-full.qcow2
185 # Patch neutron with using OVS external interface for router and add generic linux NS interface driver
186 if [[ "${deploy_options_array['dataplane']}" == 'fdio' ]]; then
187 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
188 LIBGUESTFS_BACKEND=direct virt-customize --run-command "cd /usr/lib/python2.7/site-packages/ && patch -p1 < neutron-patch-NSDriver.patch" \
189 -a overcloud-full.qcow2
192 # Configure routing node for odl-fdio
193 if [[ "${deploy_options_array['sdn_controller']}" == 'opendaylight' ]]; then
194 if [[ "${deploy_options_array['odl_vpp_routing_node']}" == 'dvr' ]]; then
195 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
196 sed -i "/OS::TripleO::Services::NeutronDhcpAgent/d" ${ENV_FILE}
197 sed -i "/NeutronDhcpAgentsPerNetwork:/ c\ NeutronDhcpAgentsPerNetwork: $num_compute_nodes" ${ENV_FILE}
198 sed -i "$ a\ - OS::TripleO::Services::NeutronDhcpAgent" ${ENV_FILE}
199 # TODO: Update VPP version to 17.10 when specific version is known
200 # LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum remove -y vpp-lib" \
201 # --run-command "yum install -y /root/fdio_dvr/*.rpm" \
202 # --run-command "rm -f /etc/sysctl.d/80-vpp.conf" \
203 # -a overcloud-full.qcow2
206 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
207 sed -i "/opendaylight::vpp_routing_node:/c\ opendaylight::vpp_routing_node: ${deploy_options_array['odl_vpp_routing_node']}.${domain_name}" ${ENV_FILE}
210 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
211 sed -i "/ControllerExtraConfig:/ c\ ControllerExtraConfig:\n tripleo::profile::base::neutron::agents::honeycomb::interface_role_mapping: ['${tenant_nic_mapping_controller_members}:tenant-interface']" ${ENV_FILE}
212 sed -i "/NovaComputeExtraConfig:/ c\ NovaComputeExtraConfig:\n tripleo::profile::base::neutron::agents::honeycomb::interface_role_mapping: ['${tenant_nic_mapping_compute_members}:tenant-interface','${external_nic_mapping_compute_members}:public-interface']" ${ENV_FILE}
218 if [ -n "${deploy_options_array['performance']}" ]; then
219 ovs_dpdk_perf_flag="False"
220 for option in "${performance_options[@]}" ; do
221 if [ "${arr[1]}" == "vpp" ]; then
222 if [ "${arr[0]}" == "Compute" ]; then
227 if [ "${arr[2]}" == "main-core" ]; then
228 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
229 sed -i "/${role}ExtraConfig:/ c\ ${role}ExtraConfig:\n fdio::vpp_cpu_main_core: '${arr[3]}'" ${ENV_FILE}
231 elif [ "${arr[2]}" == "corelist-workers" ]; then
232 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
233 sed -i "/${role}ExtraConfig:/ c\ ${role}ExtraConfig:\n fdio::vpp_cpu_corelist_workers: '${arr[3]}'" ${ENV_FILE}
238 # use compute's kernel settings for all nodes for now.
239 if [ "${arr[0]}" == "Compute" ] && [ "${arr[1]}" == "kernel" ]; then
240 kernel_args+=" ${arr[2]}=${arr[3]}"
242 if [ "${arr[0]}" == "Compute" ] && [ "${arr[1]}" == "ovs" ]; then
243 eval "${arr[2]}=${arr[3]}"
244 ovs_dpdk_perf_flag="True"
248 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
249 sed -i "/ComputeKernelArgs:/c\ ComputeKernelArgs: '$kernel_args'" ${ENV_FILE}
250 sed -i "$ a\resource_registry:\n OS::TripleO::NodeUserData: first-boot.yaml" ${ENV_FILE}
251 sed -i "/NovaSchedulerDefaultFilters:/c\ NovaSchedulerDefaultFilters: 'RamFilter,ComputeFilter,AvailabilityZoneFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,NUMATopologyFilter'" ${ENV_FILE}
254 if [[ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' && "$ovs_dpdk_perf_flag" == "True" ]]; then
255 for ovs_option in ${!ovs_option_heat_arr[@]}; do
256 if [ -n "${!ovs_option}" ]; then
257 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
258 sed -i "/${ovs_option_heat_arr[$ovs_option]}:/c\ ${ovs_option_heat_arr[$ovs_option]}: '${!ovs_option}'" ${ENV_FILE}
265 if [[ -z "${deploy_options_array['sdn_controller']}" || "${deploy_options_array['sdn_controller']}" == 'False' ]]; then
266 if [ "${deploy_options_array['dataplane']}" == "fdio" ]; then
267 if [ "$tenant_nic_mapping_controller_members" == "$tenant_nic_mapping_compute_members" ]; then
268 echo -e "${blue}INFO: nosdn fdio deployment...installing correct vpp packages...${reset}"
269 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
270 sed -i "/NeutronVPPAgentPhysnets:/c\ NeutronVPPAgentPhysnets: 'datacentre:${tenant_nic_mapping_controller_members}'" ${ENV_FILE}
273 echo -e "${red}Compute and Controller must use the same tenant nic name, please modify network setting file.${reset}"
279 # Set ODL version accordingly
280 if [[ "${deploy_options_array['sdn_controller']}" == 'opendaylight' && -n "${deploy_options_array['odl_version']}" ]]; then
281 case "${deploy_options_array['odl_version']}" in
282 carbon) odl_version=''
284 *) echo -e "${red}Invalid ODL version ${deploy_options_array['odl_version']}. Please use 'carbon'.${reset}"
289 if [[ -n "$odl_version" ]]; 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/${odl_version}/*" \
293 -a overcloud-full.qcow2
297 # Overwrite puppet-opendaylight with carbon. By default we install boron branch.
298 if [ "${deploy_options_array['odl_version']}" == 'carbon' ]; then
299 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
300 LIBGUESTFS_BACKEND=direct virt-customize --run-command "rm -rf /etc/puppet/modules/opendaylight" \
301 --run-command "cd /etc/puppet/modules/ && tar xzf /root/puppet-opendaylight-carbon.tar.gz" \
302 -a overcloud-full.qcow2
307 # Override ODL for fdio scenarios
308 if [[ "${deploy_options_array['odl_vpp_netvirt']}" == 'True' && "${deploy_options_array['sdn_controller']}" == 'opendaylight' ]]; then
309 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
310 LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum -y remove opendaylight" \
311 --run-command "yum -y install /root/opendaylight-7.0.0-0.1.20170531snap665.el7.noarch.rpm" \
312 -a overcloud-full.qcow2
314 # elif [[ "${deploy_options_array['sdn_controller']}" == 'opendaylight' && "${deploy_options_array['dataplane']}" == 'fdio' ]]; then
315 # if [[ "${deploy_options_array['odl_vpp_routing_node']}" != 'dvr' ]]; then
316 # ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
317 # LIBGUESTFS_BACKEND=direct virt-customize --run-command "rm -rf /opt/opendaylight/*" \
318 # --run-command "tar zxvf /root/fdio_odl_carbon.tar.gz -C /opt/opendaylight/ --strip-components=1" \
319 # --run-command "chown odl:odl -R /opt/opendaylight" \
320 # -a overcloud-full.qcow2
325 # Override ODL if we enable dvr for fdio
326 # TODO: Update ODL version when specific version is known.
327 # if [[ "${deploy_options_array['odl_vpp_routing_node']}" == 'dvr' ]]; then
328 # ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
329 # LIBGUESTFS_BACKEND=direct virt-customize --run-command "rm -rf /opt/opendaylight/*" \
330 # --run-command "tar zxvf /root/fdio_odl_carbon.tar.gz -C /opt/opendaylight/ --strip-components=1" \
331 # --run-command "chown odl:odl -R /opt/opendaylight" \
332 # -a overcloud-full.qcow2
338 # check if ceph should be enabled
339 if [ "${deploy_options_array['ceph']}" == 'True' ]; then
340 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml"
343 if [ "${deploy_options_array['sdn_controller']}" == 'ovn' ]; then
344 # The epoch in deloran's ovs is 1: and in leif's is 0:
345 # so we have to execute a downgrade instead of an update
346 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
347 LIBGUESTFS_BACKEND=direct virt-customize \
348 --run-command "cd /root/ovs27 && yum update -y *openvswitch*" \
349 --run-command "cd /root/ovs27 && yum downgrade -y *openvswitch*" \
350 -a overcloud-full.qcow2
354 # check if HA is enabled
355 if [[ "$ha_enabled" == "True" ]]; then
356 if [ "$num_control_nodes" -lt 3 ]; then
357 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}"
360 DEPLOY_OPTIONS+=" --control-scale ${num_control_nodes}"
361 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml"
362 echo -e "${blue}INFO: Number of control nodes set for deployment: ${num_control_nodes}${reset}"
365 if [ "$num_control_nodes" -lt 1 ]; then
366 echo -e "${red}ERROR: Number of control nodes in inventory is less than 1: ${num_control_nodes}. Check your inventory file.${reset}"
371 if [ "$num_compute_nodes" -le 0 ]; then
372 echo -e "${red}ERROR: Invalid number of compute nodes: ${num_compute_nodes}. Check your inventory file.${reset}"
375 echo -e "${blue}INFO: Number of compute nodes set for deployment: ${num_compute_nodes}${reset}"
376 DEPLOY_OPTIONS+=" --compute-scale ${num_compute_nodes}"
379 DEPLOY_OPTIONS+=" --ntp-server $ntp_server"
381 DEPLOY_OPTIONS+=" --control-flavor control --compute-flavor compute"
382 if [[ "$virtual" == "TRUE" ]]; then
383 DEPLOY_OPTIONS+=" -e virtual-environment.yaml"
384 echo 'Ensuring Virtual BMC device status'
385 for i in $(vbmc list | grep down | awk '{ print $2}'); do
391 DEPLOY_OPTIONS+=" -e baremetal-environment.yaml"
394 echo -e "${blue}INFO: Deploy options set:\n${DEPLOY_OPTIONS}${reset}"
396 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
397 # Create a key for use by nova for live migration
398 echo "Creating nova SSH key for nova resize support"
399 ssh-keygen -f nova_id_rsa -b 1024 -P ""
400 public_key=\'\$(cat nova_id_rsa.pub | cut -d ' ' -f 2)\'
401 sed -i "s#replace_public_key:#key: \$public_key#g" ${ENV_FILE}
402 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") + "\"")))'
403 mv -f opnfv-environment-new.yaml ${ENV_FILE}
407 # Workaround for APEX-207 where sometimes swift proxy is down
408 if ! sudo systemctl status openstack-swift-proxy > /dev/null; then
409 sudo systemctl restart openstack-swift-proxy
411 echo "Uploading overcloud glance images"
412 openstack overcloud image upload
414 echo "Configuring undercloud and discovering nodes"
417 if [[ -z "$virtual" ]]; then
418 openstack overcloud node import instackenv.json
419 openstack overcloud node introspect --all-manageable --provide
420 #if [[ -n "$root_disk_list" ]]; then
421 # TODO: replace node configure boot with ironic node-update
422 # TODO: configure boot is not used in ocata here anymore
423 #openstack overcloud node configure boot --root-device=${root_disk_list}
424 #https://github.com/openstack/tripleo-quickstart-extras/blob/master/roles/overcloud-prep-images/templates/overcloud-prep-images.sh.j2#L73-L130
425 #ironic node-update $ironic_node add properties/root_device='{"{{ node['key'] }}": "{{ node['value'] }}"}'
428 openstack overcloud node import --provide instackenv.json
431 openstack flavor set --property "cpu_arch"="x86_64" baremetal
432 openstack flavor set --property "cpu_arch"="x86_64" control
433 openstack flavor set --property "cpu_arch"="x86_64" compute
434 echo "Configuring nameserver on ctlplane network"
436 for dns_server in ${dns_servers}; do
437 dns_server_ext="\${dns_server_ext} --dns-nameserver \${dns_server}"
439 openstack subnet set ctlplane-subnet \${dns_server_ext}
440 sed -i '/CloudDomain:/c\ CloudDomain: '${domain_name} ${ENV_FILE}
441 echo "Executing overcloud deployment, this could run for an extended period without output."
442 sleep 60 #wait for Hypervisor stats to check-in to nova
443 # save deploy command so it can be used for debugging
444 cat > deploy_command << EOF
445 openstack overcloud deploy --templates $DEPLOY_OPTIONS --timeout 90
449 if [ "$interactive" == "TRUE" ]; then
450 if ! prompt_user "Overcloud Deployment"; then
451 echo -e "${blue}INFO: User requests exit${reset}"
456 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
458 openstack overcloud deploy --templates $DEPLOY_OPTIONS --timeout 90
459 if ! openstack stack list | grep CREATE_COMPLETE 1>/dev/null; then
460 $(typeset -f debug_stack)
466 # Configure DPDK and restart ovs agent after bringing up br-phy
467 if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then
468 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI || (echo "DPDK config failed, exiting..."; exit 1)
471 for node in \$(nova list | grep novacompute | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+"); do
472 echo "Checking DPDK status and bringing up br-phy on \$node"
473 ssh -T ${SSH_OPTIONS[@]} "heat-admin@\$node" <<EOF
477 if [[ -z "${deploy_options_array['sdn_controller']}" || "${deploy_options_array['sdn_controller']}" == 'False' ]]; then
478 echo "Restarting openvswitch agent to pick up VXLAN tunneling"
479 sudo systemctl restart neutron-openvswitch-agent
484 elif [ "${deploy_options_array['sfc']}" == 'True' ]; then
485 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI || (echo "SFC config failed, exiting..."; exit 1)
488 for node in \$(nova list | grep controller | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+"); do
489 echo "Configuring networking_sfc.conf on \$node"
490 ssh -T ${SSH_OPTIONS[@]} "heat-admin@\$node" <<EOF
492 sudo ln -s /etc/neutron/networking_sfc.conf /etc/neutron/conf.d/neutron-server/networking_sfc.conf
493 sudo systemctl restart neutron-server
499 if [ "$debug" == 'TRUE' ]; then
500 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
502 echo "Keystone Endpoint List:"
503 openstack endpoint list
504 echo "Keystone Service List"
505 openstack service list