##preping it for deployment and launch the deploy
##params: none
function overcloud_deploy {
+ local num_compute_nodes
+ local num_control_nodes
+
if [[ "${#deploy_options_array[@]}" -eq 0 || "${deploy_options_array['sdn_controller']}" == 'opendaylight' ]]; then
if [ "${deploy_options_array['sdn_l3']}" == 'True' ]; then
DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight_l3.yaml"
DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight_sdnvpn.yaml"
elif [ "${deploy_options_array['vpp']}" == 'True' ]; then
DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight_fdio.yaml"
+ elif [ "${deploy_options_array['vpn']}" == 'true' ]; then
+ DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight_sdnvpn.yaml"
else
DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight.yaml"
fi
exit 1
elif [[ -z "${deploy_options_array['sdn_controller']}" || "${deploy_options_array['sdn_controller']}" == 'False' ]]; then
echo -e "${blue}INFO: SDN Controller disabled...will deploy nosdn scenario${reset}"
+ if [ "${deploy_options_array['vpp']}" == 'True' ]; then
+ DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-ml2-networking-vpp.yaml"
+ fi
SDN_IMAGE=opendaylight
else
echo "${red}Invalid sdn_controller: ${deploy_options_array['sdn_controller']}${reset}"
scp ${SSH_OPTIONS[@]} $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 "stack@$UNDERCLOUD":overcloud-full.qcow2
# Install ovs-dpdk inside the overcloud image if it is enabled.
- if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then
+ if [[ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' || "${deploy_options_array['dataplane']}" == 'fdio' ]]; then
# install dpdk packages before ovs
echo -e "${blue}INFO: Enabling kernel modules for dpdk inside overcloud image${reset}"
--upload uio_pci_generic.modules:/etc/sysconfig/modules/ \
--run-command "chmod 0755 /etc/sysconfig/modules/vfio_pci.modules" \
--run-command "chmod 0755 /etc/sysconfig/modules/uio_pci_generic.modules" \
- --run-command "yum install -y /root/dpdk_rpms/*" \
-a overcloud-full.qcow2
+
+ if [ "${deploy_options_array['dataplane']}" == 'fdio' ]; then
+ sudo sed -i '/FdioEnabled:/c\ FdioEnabled: true' /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml
+ LIBGUESTFS_BACKEND=direct virt-customize --run-command "cp -f /root/fdio_neutron_l3/namespaces.py /usr/lib/python2.7/site-packages/neutron/agent/l3/" \
+ --run-command "cp -f /root/fdio_neutron_l3/router_info.py /usr/lib/python2.7/site-packages/neutron/agent/l3/" \
+ -a overcloud-full.qcow2
+ if [ "${deploy_options_array['sdn_controller']}" == 'opendaylight' ]; then
+ LIBGUESTFS_BACKEND=direct virt-customize --run-command "cd /root/ && tar zxvf networking-odl.tar.gz" \
+ --run-command "cd /root/networking-odl && git init && pip install -r requirements.txt" \
+ --run-command "cd /root/networking-odl && python setup.py build && python setup.py install" \
+ -a overcloud-full.qcow2
+ fi
+ else
+ sudo sed -i '/NeutronOVSDataPathType:/c\ NeutronOVSDataPathType: netdev' /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml
+ LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum install -y /root/dpdk_rpms/*" \
+ --run-command "sed -i '/RuntimeDirectoryMode=.*/d' /usr/lib/systemd/system/openvswitch-nonetwork.service" \
+ --run-command "printf \"%s\\n\" RuntimeDirectoryMode=0775 Group=qemu UMask=0002 >> /usr/lib/systemd/system/openvswitch-nonetwork.service" \
+ --run-command "sed -i 's/\\(^\\s\\+\\)\\(start_daemon "$OVS_VSWITCHD_PRIORITY"\\)/\\1umask 0002 \\&\\& \\2/' /usr/share/openvswitch/scripts/ovs-ctl" \
+ -a overcloud-full.qcow2
+ fi
EOI
+
elif [ "${deploy_options_array['dataplane']}" != 'ovs' ]; then
echo "${red}${deploy_options_array['dataplane']} not supported${reset}"
exit 1
fi
+ if [ "$debug" == 'TRUE' ]; then
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "LIBGUESTFS_BACKEND=direct virt-customize -a overcloud-full.qcow2 --root-password password:opnfvapex"
+ fi
+
# Set ODL version accordingly
if [[ "${deploy_options_array['sdn_controller']}" == 'opendaylight' && "${deploy_options_array['odl_version']}" == 'boron' ]]; then
ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
# Push performance options to subscript to modify per-role images as needed
for option in "${performance_options[@]}" ; do
echo -e "${blue}Setting performance option $option${reset}"
- ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "bash build_perf_image.sh $option"
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "dataplane=${deploy_options_array['dataplane']} bash build_perf_image.sh $option"
done
# Build IPA kernel option ramdisks
chown stack /home/stack/Controller-ironic-python-agent.initramfs
popd
/bin/rm -rf ipa/
+EOI
+
+ # set NIC heat params and resource registry
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
+if [ -n "${private_network_compute_interface}" ]; then
+ sudo sed -i '/ComputeTenantNIC:/c\ ComputeTenantNIC: '${private_network_compute_interface} /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml
+fi
+if [ -n "${private_network_controller_interface}" ]; then
+ sudo sed -i '/ControllerTenantNIC:/c\ ControllerTenantNIC: '${private_network_controller_interface} /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml
+fi
+# TODO: PublicNIC is not used today, however, in the future, we'll bind public nic to DPDK as well for certain scenarios. At that time,
+# we'll need to make sure public network is enabled.
+if [ -n "${public_network_compute_interface}" ]; then
+ sudo sed -i '/ComputePublicNIC:/c\ ComputePublicNIC: '${public_network_compute_interface} /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml
+fi
+if [ -n "${public_network_controller_interface}" ]; then
+ sudo sed -i '/ControllerPublicNIC:/c\ ControllerPublicNIC: '${public_network_controller_interface} /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml
+fi
EOI
DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/numa.yaml"
# make sure ceph is installed
DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml"
- # scale compute nodes according to inventory
- total_nodes=$(ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "cat /home/stack/instackenv.json | grep -c memory")
+ # get number of nodes available in inventory
+ num_control_nodes=$(ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "grep -c profile:control /home/stack/instackenv.json")
+ num_compute_nodes=$(ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "grep -c profile:compute /home/stack/instackenv.json")
# check if HA is enabled
if [[ "$ha_enabled" == "True" ]]; then
- DEPLOY_OPTIONS+=" --control-scale 3"
- compute_nodes=$((total_nodes - 3))
+ if [ "$num_control_nodes" -lt 3 ]; then
+ 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}"
+ exit 1
+ else
+ DEPLOY_OPTIONS+=" --control-scale ${num_control_nodes}"
DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml"
+ echo -e "${blue}INFO: Number of control nodes set for deployment: ${num_control_nodes}${reset}"
+ fi
else
- compute_nodes=$((total_nodes - 1))
+ if [ "$num_control_nodes" -lt 1 ]; then
+ echo -e "${red}ERROR: Number of control nodes in inventory is less than 1: ${num_control_nodes}. Check your inventory file.${reset}"
+ exit 1
+ fi
fi
- if [ "$compute_nodes" -le 0 ]; then
- echo -e "${red}ERROR: Invalid number of compute nodes: ${compute_nodes}. Check your inventory file.${reset}"
+ if [ "$num_compute_nodes" -le 0 ]; then
+ echo -e "${red}ERROR: Invalid number of compute nodes: ${num_compute_nodes}. Check your inventory file.${reset}"
exit 1
else
- echo -e "${blue}INFO: Number of compute nodes set for deployment: ${compute_nodes}${reset}"
- DEPLOY_OPTIONS+=" --compute-scale ${compute_nodes}"
+ echo -e "${blue}INFO: Number of compute nodes set for deployment: ${num_compute_nodes}${reset}"
+ DEPLOY_OPTIONS+=" --compute-scale ${num_compute_nodes}"
fi
if [[ "$net_isolation_enabled" == "TRUE" ]]; then
echo -e "${blue}INFO: Deploy options set:\n${DEPLOY_OPTIONS}${reset}"
ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
-if [ "$debug" == 'TRUE' ]; then
- LIBGUESTFS_BACKEND=direct virt-customize -a overcloud-full.qcow2 --root-password password:opnfvapex
+if [ "${deploy_options_array['tacker']}" == 'False' ]; then
+ sed -i '/EnableTacker:/c\ EnableTacker: false' opnfv-environment.yaml
fi
-if [ "${deploy_options_array['tacker']}" == 'True' ]; then
- sed -i '/EnableTacker/\\c EnableTacker: true' opnfv-environment.yaml
-fi
+# Create a key for use by nova for live migration
+echo "Creating nova SSH key for nova resize support"
+ssh-keygen -f nova_id_rsa -b 1024 -P ""
+public_key=\'\$(cat nova_id_rsa.pub | cut -d ' ' -f 2)\'
+sed -i "s#replace_public_key:#key: \$public_key#g" opnfv-environment.yaml
+python -c 'open("opnfv-environment-new.yaml", "w").write((open("opnfv-environment.yaml").read().replace("replace_private_key:", "key: \"" + "".join(open("nova_id_rsa").readlines()).replace("\\n","\\\n") + "\"")))'
+mv -f opnfv-environment-new.yaml opnfv-environment.yaml
source stackrc
set -o errexit
+# Workaround for APEX-207 where sometimes swift proxy is down
+if ! sudo systemctl status openstack-swift-proxy > /dev/null; then
+ sudo systemctl restart openstack-swift-proxy
+fi
echo "Uploading overcloud glance images"
openstack overcloud image upload