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 # Deploy script to install provisioning server for OPNFV Apex
12 # author: Dan Radez (dradez@redhat.com)
13 # author: Tim Rozet (trozet@redhat.com)
15 # Based on RDO Manager http://www.rdoproject.org
20 reset=$(tput sgr0 || echo "")
21 blue=$(tput setaf 4 || echo "")
22 red=$(tput setaf 1 || echo "")
23 green=$(tput setaf 2 || echo "")
27 ntp_server="pool.ntp.org"
28 net_isolation_enabled="TRUE"
34 declare -A deploy_options_array
35 declare -a performance_options
38 SSH_OPTIONS=(-o StrictHostKeyChecking=no -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null -o LogLevel=error)
40 CONFIG=${CONFIG:-'/var/opt/opnfv'}
41 RESOURCES=${RESOURCES:-"$CONFIG/images"}
42 LIB=${LIB:-"$CONFIG/lib"}
43 OPNFV_NETWORK_TYPES="admin_network private_network public_network storage_network api_network"
49 # Netmap used to map networks to OVS bridge names
50 NET_MAP['admin_network']="br-admin"
51 NET_MAP['private_network']="br-private"
52 NET_MAP['public_network']="br-public"
53 NET_MAP['storage_network']="br-storage"
54 NET_MAP['api_network']="br-api"
55 ext_net_type="interface"
60 $LIB/common-functions.sh
61 $LIB/configure-deps-functions.sh
62 $LIB/parse-functions.sh
63 $LIB/virtual-setup-functions.sh
64 $LIB/undercloud-functions.sh
65 $LIB/utility-functions.sh
66 $LIB/installer/onos/onos_gw_mac_update.sh
68 for lib_file in ${lib_files[@]}; do
69 if ! source $lib_file; then
70 echo -e "${red}ERROR: Failed to source $lib_file${reset}"
76 ##checks if prefix exists in string
77 ##params: string, prefix
78 ##usage: contains_prefix "deploy_setting_launcher=1" "deploy_setting"
82 if echo $mystr | grep -E "^$prefix.*$" > /dev/null; then
89 ##verify internet connectivity
91 function verify_internet {
92 if ping -c 2 $ping_site > /dev/null; then
93 if ping -c 2 www.google.com > /dev/null; then
94 echo "${blue}Internet connectivity detected${reset}"
97 echo "${red}Internet connectivity detected, but DNS lookup failed${reset}"
101 echo "${red}No internet connectivity detected${reset}"
106 ##preping it for deployment and launch the deploy
108 function undercloud_prep_overcloud_deploy {
109 if [[ "${#deploy_options_array[@]}" -eq 0 || "${deploy_options_array['sdn_controller']}" == 'opendaylight' ]]; then
110 if [ "${deploy_options_array['sdn_l3']}" == 'True' ]; then
111 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight_l3.yaml"
112 elif [ "${deploy_options_array['sfc']}" == 'True' ]; then
113 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight_sfc.yaml"
114 elif [ "${deploy_options_array['vpn']}" == 'True' ]; then
115 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight_sdnvpn.yaml"
116 elif [ "${deploy_options_array['vpp']}" == 'True' ]; then
117 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight_fdio.yaml"
119 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight.yaml"
121 SDN_IMAGE=opendaylight
122 if [ "${deploy_options_array['sfc']}" == 'True' ]; then
124 if [ ! -f $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 ]; then
125 echo "${red} $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 is required to execute an SFC deployment."
126 echo "Please install the opnfv-apex-opendaylight-sfc package to provide this overcloud image for deployment.${reset}"
130 elif [ "${deploy_options_array['sdn_controller']}" == 'opendaylight-external' ]; then
131 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight-external.yaml"
132 SDN_IMAGE=opendaylight
133 elif [ "${deploy_options_array['sdn_controller']}" == 'onos' ]; then
134 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/onos.yaml"
136 elif [ "${deploy_options_array['sdn_controller']}" == 'opencontrail' ]; then
137 echo -e "${red}ERROR: OpenContrail is currently unsupported...exiting${reset}"
139 elif [[ -z "${deploy_options_array['sdn_controller']}" || "${deploy_options_array['sdn_controller']}" == 'False' ]]; then
140 echo -e "${blue}INFO: SDN Controller disabled...will deploy nosdn scenario${reset}"
141 SDN_IMAGE=opendaylight
143 echo "${red}Invalid sdn_controller: ${deploy_options_array['sdn_controller']}${reset}"
144 echo "${red}Valid choices are opendaylight, opendaylight-external, onos, opencontrail, False, or null${reset}"
150 # Make sure the correct overcloud image is available
151 if [ ! -f $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 ]; then
152 echo "${red} $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 is required to execute your deployment."
153 echo "Both ONOS and OpenDaylight are currently deployed from this image."
154 echo "Please install the opnfv-apex package to provide this overcloud image for deployment.${reset}"
158 echo "Copying overcloud image to Undercloud"
159 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "rm -f overcloud-full.qcow2"
160 scp ${SSH_OPTIONS[@]} $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 "stack@$UNDERCLOUD":overcloud-full.qcow2
162 # Install ovs-dpdk inside the overcloud image if it is enabled.
163 if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then
164 # install dpdk packages before ovs
165 echo -e "${blue}INFO: Enabling kernel modules for dpdk inside overcloud image${reset}"
167 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
168 cat << EOF > vfio_pci.modules
170 exec /sbin/modprobe vfio_pci >/dev/null 2>&1
173 cat << EOF > uio_pci_generic.modules
175 exec /sbin/modprobe uio_pci_generic >/dev/null 2>&1
178 LIBGUESTFS_BACKEND=direct virt-customize --upload vfio_pci.modules:/etc/sysconfig/modules/ \
179 --upload uio_pci_generic.modules:/etc/sysconfig/modules/ \
180 --run-command "chmod 0755 /etc/sysconfig/modules/vfio_pci.modules" \
181 --run-command "chmod 0755 /etc/sysconfig/modules/uio_pci_generic.modules" \
182 --run-command "yum install -y /root/dpdk_rpms/*" \
183 -a overcloud-full.qcow2
185 elif [ "${deploy_options_array['dataplane']}" != 'ovs' ]; then
186 echo "${red}${deploy_options_array['dataplane']} not supported${reset}"
190 # Set ODL version accordingly
191 if [[ "${deploy_options_array['sdn_controller']}" == 'opendaylight' && "${deploy_options_array['odl_version']}" == 'boron' ]]; then
192 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
193 LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum -y remove opendaylight" \
194 --run-command "yum -y install /root/boron/*" \
195 -a overcloud-full.qcow2
199 # Add performance deploy options if they have been set
200 if [ ! -z "${deploy_options_array['performance']}" ]; then
202 # Remove previous kernel args files per role
203 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "rm -f Compute-kernel_params.txt"
204 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "rm -f Controller-kernel_params.txt"
206 # Push performance options to subscript to modify per-role images as needed
207 for option in "${performance_options[@]}" ; do
208 echo -e "${blue}Setting performance option $option${reset}"
209 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "bash build_perf_image.sh $option"
212 # Build IPA kernel option ramdisks
213 ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" <<EOI
214 /bin/cp -f /home/stack/ironic-python-agent.initramfs /root/
217 gunzip -c ../ironic-python-agent.initramfs | cpio -i
218 if [ ! -f /home/stack/Compute-kernel_params.txt ]; then
219 touch /home/stack/Compute-kernel_params.txt
220 chown stack /home/stack/Compute-kernel_params.txt
222 /bin/cp -f /home/stack/Compute-kernel_params.txt tmp/kernel_params.txt
223 echo "Compute params set: "
224 cat tmp/kernel_params.txt
225 /bin/cp -f /root/image.py usr/lib/python2.7/site-packages/ironic_python_agent/extensions/image.py
226 /bin/cp -f /root/image.pyc usr/lib/python2.7/site-packages/ironic_python_agent/extensions/image.pyc
227 find . | cpio -o -H newc | gzip > /home/stack/Compute-ironic-python-agent.initramfs
228 chown stack /home/stack/Compute-ironic-python-agent.initramfs
229 if [ ! -f /home/stack/Controller-kernel_params.txt ]; then
230 touch /home/stack/Controller-kernel_params.txt
231 chown stack /home/stack/Controller-kernel_params.txt
233 /bin/cp -f /home/stack/Controller-kernel_params.txt tmp/kernel_params.txt
234 echo "Controller params set: "
235 cat tmp/kernel_params.txt
236 find . | cpio -o -H newc | gzip > /home/stack/Controller-ironic-python-agent.initramfs
237 chown stack /home/stack/Controller-ironic-python-agent.initramfs
242 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml"
245 # make sure ceph is installed
246 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml"
248 # scale compute nodes according to inventory
249 total_nodes=$(ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "cat /home/stack/instackenv.json | grep -c memory")
251 # check if HA is enabled
252 if [[ "$ha_enabled" == "True" ]]; then
253 DEPLOY_OPTIONS+=" --control-scale 3"
254 compute_nodes=$((total_nodes - 3))
255 DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml"
257 compute_nodes=$((total_nodes - 1))
260 if [ "$compute_nodes" -le 0 ]; then
261 echo -e "${red}ERROR: Invalid number of compute nodes: ${compute_nodes}. Check your inventory file.${reset}"
264 echo -e "${blue}INFO: Number of compute nodes set for deployment: ${compute_nodes}${reset}"
265 DEPLOY_OPTIONS+=" --compute-scale ${compute_nodes}"
268 if [[ "$net_isolation_enabled" == "TRUE" ]]; then
269 #DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml"
270 DEPLOY_OPTIONS+=" -e network-environment.yaml"
273 if [[ "$ha_enabled" == "True" ]] || [[ "$net_isolation_enabled" == "TRUE" ]]; then
274 DEPLOY_OPTIONS+=" --ntp-server $ntp_server"
277 if [[ ! "$virtual" == "TRUE" ]]; then
278 DEPLOY_OPTIONS+=" --control-flavor control --compute-flavor compute"
280 DEPLOY_OPTIONS+=" -e virtual-environment.yaml"
283 DEPLOY_OPTIONS+=" -e opnfv-environment.yaml"
285 echo -e "${blue}INFO: Deploy options set:\n${DEPLOY_OPTIONS}${reset}"
287 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
288 if [ "$debug" == 'TRUE' ]; then
289 LIBGUESTFS_BACKEND=direct virt-customize -a overcloud-full.qcow2 --root-password password:opnfvapex
294 echo "Uploading overcloud glance images"
295 openstack overcloud image upload
297 echo "Configuring undercloud and discovering nodes"
298 openstack baremetal import --json instackenv.json
299 openstack baremetal configure boot
300 bash -x set_perf_images.sh ${performance_roles[@]}
301 #if [[ -z "$virtual" ]]; then
302 # openstack baremetal introspection bulk start
304 echo "Configuring flavors"
305 for flavor in baremetal control compute; do
306 echo -e "${blue}INFO: Updating flavor: \${flavor}${reset}"
307 if openstack flavor list | grep \${flavor}; then
308 openstack flavor delete \${flavor}
310 openstack flavor create --id auto --ram 4096 --disk 39 --vcpus 1 \${flavor}
311 if ! openstack flavor list | grep \${flavor}; then
312 echo -e "${red}ERROR: Unable to create flavor \${flavor}${reset}"
315 openstack flavor set --property "cpu_arch"="x86_64" --property "capabilities:boot_option"="local" baremetal
316 openstack flavor set --property "cpu_arch"="x86_64" --property "capabilities:boot_option"="local" --property "capabilities:profile"="control" control
317 openstack flavor set --property "cpu_arch"="x86_64" --property "capabilities:boot_option"="local" --property "capabilities:profile"="compute" compute
318 echo "Configuring nameserver on ctlplane network"
320 for dns_server in ${dns_servers}; do
321 dns_server_ext="\${dns_server_ext} --dns-nameserver \${dns_server}"
323 neutron subnet-update \$(neutron subnet-list | grep -Ev "id|tenant|external|storage" | grep -v \\\\-\\\\- | awk {'print \$2'}) \${dns_server_ext}
324 echo "Executing overcloud deployment, this should run for an extended period without output."
325 sleep 60 #wait for Hypervisor stats to check-in to nova
326 # save deploy command so it can be used for debugging
327 cat > deploy_command << EOF
328 openstack overcloud deploy --templates $DEPLOY_OPTIONS --timeout 90
332 if [ "$interactive" == "TRUE" ]; then
333 if ! prompt_user "Overcloud Deployment"; then
334 echo -e "${blue}INFO: User requests exit${reset}"
339 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
341 openstack overcloud deploy --templates $DEPLOY_OPTIONS --timeout 90
342 if ! heat stack-list | grep CREATE_COMPLETE 1>/dev/null; then
343 $(typeset -f debug_stack)
350 if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then
351 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI || (echo "DPDK config failed, exiting..."; exit 1)
354 for node in \$(nova list | grep novacompute | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+"); do
355 echo "Running DPDK test app on \$node"
356 ssh -T ${SSH_OPTIONS[@]} "heat-admin@\$node" <<EOF
358 sudo dpdk_helloworld --no-pci
359 sudo dpdk_nic_bind -s
365 if [ "$debug" == 'TRUE' ]; then
366 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
368 echo "Keystone Endpoint List:"
369 openstack endpoint list
370 echo "Keystone Service List"
371 openstack service list
372 cinder quota-show \$(openstack project list | grep admin | awk {'print \$2'})
377 ##Post configuration after install
379 function configure_post_install {
380 local opnfv_attach_networks ovs_ip ip_range net_cidr tmp_ip
381 opnfv_attach_networks="admin_network public_network"
383 echo -e "${blue}INFO: Post Install Configuration Running...${reset}"
385 echo -e "${blue}INFO: Configuring ssh for root to overcloud nodes...${reset}"
386 # copy host key to instack
387 scp ${SSH_OPTIONS[@]} /root/.ssh/id_rsa.pub "stack@$UNDERCLOUD":jumphost_id_rsa.pub
389 # add host key to overcloud nodes authorized keys
390 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" << EOI
392 nodes=\$(nova list | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+")
393 for node in \$nodes; do
394 cat ~/jumphost_id_rsa.pub | ssh -T ${SSH_OPTIONS[@]} "heat-admin@\$node" 'cat >> ~/.ssh/authorized_keys'
398 if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then
399 echo -e "${blue}INFO: Bringing up br-phy and ovs-agent for dpdk compute nodes...${reset}"
400 compute_nodes=$(undercloud_connect stack "source stackrc; nova list | grep compute | wc -l")
402 while [ "$i" -lt "$compute_nodes" ]; do
403 overcloud_connect compute${i} "sudo ifup br-phy; sudo systemctl restart neutron-openvswitch-agent"
408 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
411 echo "Configuring Neutron external network"
412 neutron net-create external --router:external=True --tenant-id \$(openstack project show service | grep id | awk '{ print \$4 }')
413 neutron subnet-create --name external-net --tenant-id \$(openstack project show service | grep id | awk '{ print \$4 }') --disable-dhcp external --gateway ${public_network_gateway} --allocation-pool start=${public_network_floating_ip_range%%,*},end=${public_network_floating_ip_range##*,} ${public_network_cidr}
415 echo "Removing sahara endpoint and service"
416 sahara_service_id=\$(openstack service list | grep sahara | cut -d ' ' -f 2)
417 sahara_endpoint_id=\$(openstack endpoint list | grep sahara | cut -d ' ' -f 2)
418 openstack endpoint delete \$sahara_endpoint_id
419 openstack service delete \$sahara_service_id
421 echo "Removing swift endpoint and service"
422 swift_service_id=\$(openstack service list | grep swift | cut -d ' ' -f 2)
423 swift_endpoint_id=\$(openstack endpoint list | grep swift | cut -d ' ' -f 2)
424 openstack endpoint delete \$swift_endpoint_id
425 openstack service delete \$swift_service_id
427 if [ "${deploy_options_array['congress']}" == 'True' ]; then
428 for s in nova neutronv2 ceilometer cinder glancev2 keystone; do
429 openstack congress datasource create \$s "\$s" \\
430 --config username=\$OS_USERNAME \\
431 --config tenant_name=\$OS_TENANT_NAME \\
432 --config password=\$OS_PASSWORD \\
433 --config auth_url=\$OS_AUTH_URL
438 echo -e "${blue}INFO: Checking if OVS bridges have IP addresses...${reset}"
439 for network in ${opnfv_attach_networks}; do
440 ovs_ip=$(find_ip ${NET_MAP[$network]})
442 if [ -n "$ovs_ip" ]; then
443 echo -e "${blue}INFO: OVS Bridge ${NET_MAP[$network]} has IP address ${ovs_ip}${reset}"
445 echo -e "${blue}INFO: OVS Bridge ${NET_MAP[$network]} missing IP, will configure${reset}"
446 # use last IP of allocation pool
447 eval "ip_range=\${${network}_usable_ip_range}"
448 ovs_ip=${ip_range##*,}
449 eval "net_cidr=\${${network}_cidr}"
450 sudo ip addr add ${ovs_ip}/${net_cidr##*/} dev ${NET_MAP[$network]}
451 sudo ip link set up ${NET_MAP[$network]}
452 tmp_ip=$(find_ip ${NET_MAP[$network]})
453 if [ -n "$tmp_ip" ]; then
454 echo -e "${blue}INFO: OVS Bridge ${NET_MAP[$network]} IP set: ${tmp_ip}${reset}"
457 echo -e "${red}ERROR: Unable to set OVS Bridge ${NET_MAP[$network]} with IP: ${ovs_ip}${reset}"
463 # for virtual, we NAT public network through Undercloud
464 if [ "$virtual" == "TRUE" ]; then
465 if ! configure_undercloud_nat ${public_network_cidr}; then
466 echo -e "${red}ERROR: Unable to NAT undercloud with external net: ${public_network_cidr}${reset}"
469 echo -e "${blue}INFO: Undercloud VM has been setup to NAT Overcloud public network${reset}"
473 # for sfc deployments we need the vxlan workaround
474 if [ "${deploy_options_array['sfc']}" == 'True' ]; then
475 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
478 for node in \$(nova list | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+"); do
479 ssh -T ${SSH_OPTIONS[@]} "heat-admin@\$node" <<EOF
480 sudo ifconfig br-int up
481 sudo ip route add 123.123.123.0/24 dev br-int
487 # Collect deployment logs
488 ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
489 mkdir -p ~/deploy_logs
493 for node in \$(nova list | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+"); do
494 ssh -T ${SSH_OPTIONS[@]} "heat-admin@\$node" <<EOF
495 sudo cp /var/log/messages /home/heat-admin/messages.log
496 sudo chown heat-admin /home/heat-admin/messages.log
498 scp ${SSH_OPTIONS[@]} heat-admin@\$node:/home/heat-admin/messages.log ~/deploy_logs/\$node.messages.log
499 if [ "$debug" == "TRUE" ]; then
500 nova list --ip \$node
501 echo "---------------------------"
502 echo "-----/var/log/messages-----"
503 echo "---------------------------"
504 cat ~/deploy_logs/\$node.messages.log
505 echo "---------------------------"
506 echo "----------END LOG----------"
507 echo "---------------------------"
509 ssh -T ${SSH_OPTIONS[@]} "heat-admin@\$node" <<EOF
510 sudo rm -f /home/heat-admin/messages.log
514 # Print out the undercloud IP and dashboard URL
516 echo "Undercloud IP: $UNDERCLOUD, please connect by doing 'opnfv-util undercloud'"
517 echo "Overcloud dashboard available at http://\$(heat output-show overcloud PublicVip | sed 's/"//g')/dashboard"
523 echo -e "Usage:\n$0 [arguments] \n"
524 echo -e " -d|--deploy-settings : Full path to deploy settings yaml file. Optional. Defaults to null"
525 echo -e " -i|--inventory : Full path to inventory yaml file. Required only for baremetal"
526 echo -e " -n|--net-settings : Full path to network settings file. Optional."
527 echo -e " -p|--ping-site : site to use to verify IP connectivity. Optional. Defaults to 8.8.8.8"
528 echo -e " -v|--virtual : Virtualize overcloud nodes instead of using baremetal."
529 echo -e " --flat : disable Network Isolation and use a single flat network for the underlay network."
530 echo -e " --no-post-config : disable Post Install configuration."
531 echo -e " --debug : enable debug output."
532 echo -e " --interactive : enable interactive deployment mode which requires user to confirm steps of deployment."
533 echo -e " --virtual-cpus : Number of CPUs to use per Overcloud VM in a virtual deployment (defaults to 4)."
534 echo -e " --virtual-ram : Amount of RAM to use per Overcloud VM in GB (defaults to 8)."
537 ##translates the command line parameters into variables
538 ##params: $@ the entire command line is passed
539 ##usage: parse_cmd_line() "$@"
541 echo -e "\n\n${blue}This script is used to deploy the Apex Installer and Provision OPNFV Target System${reset}\n\n"
542 echo "Use -h to display help"
545 while [ "${1:0:1}" = "-" ]
552 -d|--deploy-settings)
553 DEPLOY_SETTINGS_FILE=$2
554 echo "Deployment Configuration file: $2"
563 echo "Network Settings Configuration file: $2"
568 echo "Using $2 as the ping site"
573 echo "Executing a Virtual Deployment"
577 net_isolation_enabled="FALSE"
578 echo "Underlay Network Isolation Disabled: using flat configuration"
583 echo "Post install configuration disabled"
588 echo "Enable debug output"
593 echo "Interactive mode enabled"
598 echo "Number of CPUs per VM set to $VM_CPUS"
603 echo "Amount of RAM per VM set to $VM_RAM"
608 echo "Virtual Compute nodes set to $VM_COMPUTES"
618 if [[ ! -z "$NETSETS" && "$net_isolation_enabled" == "FALSE" ]]; then
619 echo -e "${red}INFO: Single flat network requested. Only admin_network settings will be used!${reset}"
620 elif [[ -z "$NETSETS" ]]; then
621 echo -e "${red}ERROR: You must provide a network_settings file with -n.${reset}"
625 if [[ -n "$virtual" && -n "$INVENTORY_FILE" ]]; then
626 echo -e "${red}ERROR: You should not specify an inventory with virtual deployments${reset}"
630 if [[ -z "$DEPLOY_SETTINGS_FILE" || ! -f "$DEPLOY_SETTINGS_FILE" ]]; then
631 echo -e "${red}ERROR: Deploy Settings: ${DEPLOY_SETTINGS_FILE} does not exist! Exiting...${reset}"
635 if [[ ! -z "$NETSETS" && ! -f "$NETSETS" ]]; then
636 echo -e "${red}ERROR: Network Settings: ${NETSETS} does not exist! Exiting...${reset}"
640 if [[ ! -z "$INVENTORY_FILE" && ! -f "$INVENTORY_FILE" ]]; then
641 echo -e "{$red}ERROR: Inventory File: ${INVENTORY_FILE} does not exist! Exiting...${reset}"
645 if [[ -z "$virtual" && -z "$INVENTORY_FILE" ]]; then
646 echo -e "${red}ERROR: You must specify an inventory file for baremetal deployments! Exiting...${reset}"
650 if [[ "$net_isolation_enabled" == "FALSE" && "$post_config" == "TRUE" ]]; then
651 echo -e "${blue}INFO: Post Install Configuration will be skipped. It is not supported with --flat${reset}"
661 echo -e "${blue}INFO: Parsing network settings file...${reset}"
662 parse_network_settings
663 if ! configure_deps; then
664 echo -e "${red}Dependency Validation Failed, Exiting.${reset}"
667 if [ -n "$DEPLOY_SETTINGS_FILE" ]; then
668 echo -e "${blue}INFO: Parsing deploy settings file...${reset}"
669 parse_deploy_settings
672 if [ "$virtual" == "TRUE" ]; then
673 setup_virtual_baremetal $VM_CPUS $VM_RAM
674 elif [ -n "$INVENTORY_FILE" ]; then
678 undercloud_prep_overcloud_deploy
679 if [ "$post_config" == "TRUE" ]; then
680 if ! configure_post_install; then
681 echo -e "${red}ERROR:Post Install Configuration Failed, Exiting.${reset}"
684 echo -e "${blue}INFO: Post Install Configuration Complete${reset}"
687 if [[ "${deploy_options_array['sdn_controller']}" == 'onos' ]]; then
688 if ! onos_update_gw_mac ${public_network_cidr} ${public_network_gateway}; then
689 echo -e "${red}ERROR:ONOS Post Install Configuration Failed, Exiting.${reset}"
692 echo -e "${blue}INFO: ONOS Post Install Configuration Complete${reset}"