X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=lib%2Fovercloud-deploy-functions.sh;h=4b592b46039cee0df62725975104d96841e400ad;hb=28861bb2ac641b282ec2fc7648fd52a076f821b8;hp=067a64170a33543c9d96d6bced99363302c8cf7f;hpb=1895dcd2fa7d6888b5e451b229b213954f923de5;p=apex.git diff --git a/lib/overcloud-deploy-functions.sh b/lib/overcloud-deploy-functions.sh index 067a6417..4b592b46 100755 --- a/lib/overcloud-deploy-functions.sh +++ b/lib/overcloud-deploy-functions.sh @@ -11,38 +11,40 @@ ##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" - elif [ "${deploy_options_array['sfc']}" == 'True' ]; then + if [ "${deploy_options_array['sfc']}" == 'True' ]; then DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight_sfc.yaml" elif [ "${deploy_options_array['vpn']}" == 'True' ]; then 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" + DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-opendaylight-l3.yaml" fi SDN_IMAGE=opendaylight - if [ "${deploy_options_array['sfc']}" == 'True' ]; then - SDN_IMAGE+=-sfc - if [ ! -f $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 ]; then - echo "${red} $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 is required to execute an SFC deployment." - echo "Please install the opnfv-apex-opendaylight-sfc package to provide this overcloud image for deployment.${reset}" - exit 1 - fi - fi elif [ "${deploy_options_array['sdn_controller']}" == 'opendaylight-external' ]; then DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight-external.yaml" SDN_IMAGE=opendaylight elif [ "${deploy_options_array['sdn_controller']}" == 'onos' ]; then - DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/onos.yaml" + if [ "${deploy_options_array['sfc']}" == 'True' ]; then + DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/onos_sfc.yaml" + else + DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/onos.yaml" + fi SDN_IMAGE=onos elif [ "${deploy_options_array['sdn_controller']}" == 'opencontrail' ]; then echo -e "${red}ERROR: OpenContrail is currently unsupported...exiting${reset}" 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}" @@ -55,7 +57,6 @@ function overcloud_deploy { # Make sure the correct overcloud image is available if [ ! -f $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 ]; then echo "${red} $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 is required to execute your deployment." - echo "Both ONOS and OpenDaylight are currently deployed from this image." echo "Please install the opnfv-apex package to provide this overcloud image for deployment.${reset}" exit 1 fi @@ -65,7 +66,7 @@ function overcloud_deploy { 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}" @@ -84,14 +85,48 @@ EOF --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 + + # upgrade ovs into ovs 2.5.90 with NSH function if SFC is enabled + if [[ "${deploy_options_array['sfc']}" == 'True' && "${deploy_options_array['dataplane']}" == 'ovs' ]]; then + ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" < /dev/null; then + sudo systemctl restart openstack-swift-proxy +fi echo "Uploading overcloud glance images" openstack overcloud image upload @@ -226,6 +300,7 @@ for dns_server in ${dns_servers}; do dns_server_ext="\${dns_server_ext} --dns-nameserver \${dns_server}" done neutron subnet-update \$(neutron subnet-list | grep -Ev "id|tenant|external|storage" | grep -v \\\\-\\\\- | awk {'print \$2'}) \${dns_server_ext} +sed -i '/CloudDomain:/c\ CloudDomain: '${domain_name} opnfv-environment.yaml echo "Executing overcloud deployment, this should run for an extended period without output." sleep 60 #wait for Hypervisor stats to check-in to nova # save deploy command so it can be used for debugging @@ -244,7 +319,7 @@ EOI ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" </dev/null; then +if ! openstack stack list | grep CREATE_COMPLETE 1>/dev/null; then $(typeset -f debug_stack) debug_stack exit 1