summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/overcloud-deploy-functions.sh142
-rw-r--r--lib/python/apex/deploy_settings.py2
-rwxr-xr-xlib/python/apex_python_utils.py4
-rwxr-xr-xlib/undercloud-functions.sh5
4 files changed, 128 insertions, 25 deletions
diff --git a/lib/overcloud-deploy-functions.sh b/lib/overcloud-deploy-functions.sh
index de7263f3..0ed98fb7 100755
--- a/lib/overcloud-deploy-functions.sh
+++ b/lib/overcloud-deploy-functions.sh
@@ -13,6 +13,12 @@
function overcloud_deploy {
local num_compute_nodes
local num_control_nodes
+ local dpdk_cores pmd_cores socket_mem ovs_dpdk_perf_flag ovs_option_heat_arr
+ declare -A ovs_option_heat_arr
+
+ ovs_option_heat_arr['dpdk_cores']=OvsDpdkCoreList
+ ovs_option_heat_arr['pmd_cores']=PmdCoreList
+ ovs_option_heat_arr['socket_memory']=OvsDpdkSocketMemory
# OPNFV Default Environment and Network settings
DEPLOY_OPTIONS+=" -e ${ENV_FILE}"
@@ -49,6 +55,15 @@ function overcloud_deploy {
# DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/onos.yaml"
#fi
#SDN_IMAGE=onos
+ elif [ "${deploy_options_array['sdn_controller']}" == 'ovn' ]; then
+ if [[ "$ha_enabled" == "True" ]]; then
+ DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-ml2-ovn-ha.yaml"
+ echo "${red}OVN HA support is not not supported... exiting.${reset}"
+ exit 1
+ else
+ DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-ml2-ovn.yaml"
+ fi
+ SDN_IMAGE=opendaylight
elif [ "${deploy_options_array['sdn_controller']}" == 'opencontrail' ]; then
echo -e "${red}ERROR: OpenContrail is currently unsupported...exiting${reset}"
exit 1
@@ -56,6 +71,8 @@ function overcloud_deploy {
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-vpp.yaml"
+ elif [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then
+ DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/neutron-ovs-dpdk.yaml"
fi
SDN_IMAGE=opendaylight
else
@@ -90,10 +107,23 @@ function overcloud_deploy {
ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "rm -f overcloud-full.qcow2"
scp ${SSH_OPTIONS[@]} $IMAGES/overcloud-full-${SDN_IMAGE}.qcow2 "stack@$UNDERCLOUD":overcloud-full.qcow2
+ # disable neutron openvswitch agent from starting
+ if [[ -n "${deploy_options_array['sdn_controller']}" && "${deploy_options_array['sdn_controller']}" != 'False' ]]; then
+ echo -e "${blue}INFO: Disabling neutron-openvswitch-agent from systemd${reset}"
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
+ LIBGUESTFS_BACKEND=direct virt-customize --run-command "rm -f /etc/systemd/system/multi-user.target.wants/neutron-openvswitch-agent.service" \
+ --run-command "rm -f /usr/lib/systemd/system/neutron-openvswitch-agent.service" \
+ -a overcloud-full.qcow2
+EOI
+ fi
+
if [ "${deploy_options_array['vpn']}" == 'True' ]; then
echo -e "${blue}INFO: Enabling ZRPC and Quagga${reset}"
ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum -y install /root/quagga/*.rpm" \
+ --run-command "sudo usermod -a -G quaggavt quagga" \
+ --run-command "sudo mkdir -p /var/run/quagga/" \
+ --run-command "sudo chown quagga:quagga -R /var/run/quagga/" \
--run-command "systemctl enable zrpcd" \
-a overcloud-full.qcow2
EOI
@@ -122,11 +152,7 @@ EOF
-a overcloud-full.qcow2
if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then
- 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
+ sed -i "/OS::TripleO::ComputeExtraConfigPre:/c\ OS::TripleO::ComputeExtraConfigPre: ./ovs-dpdk-preconfig.yaml" network-environment.yaml
fi
EOI
@@ -150,12 +176,21 @@ EOI
fi
# Patch neutron with using OVS external interface for router and add generic linux NS interface driver
- if [[ "${deploy_options_array['sdn_controller']}" == 'opendaylight' && "${deploy_options_array['dataplane']}" == 'fdio' ]]; then
+ if [[ "${deploy_options_array['dataplane']}" == 'fdio' ]]; then
ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
LIBGUESTFS_BACKEND=direct virt-customize --run-command "cd /usr/lib/python2.7/site-packages/ && patch -p1 < neutron-patch-NSDriver.patch" \
-a overcloud-full.qcow2
EOI
- # Configure routing node for odl_l3-fdio
+
+ # Disable clustering for ODL FDIO HA scenarios
+ if [[ "${deploy_options_array['sdn_controller']}" == 'opendaylight' ]]; then
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
+ LIBGUESTFS_BACKEND=direct virt-customize --run-command "cd /etc/puppet/modules/tripleo/ && patch -p1 < disable_odl_clustering.patch" \
+ -a overcloud-full.qcow2
+EOI
+ fi
+
+ # Configure routing node for odl-fdio
if [[ "${deploy_options_array['sdn_l3']}" == 'True' ]]; then
ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
sed -i "/opendaylight::vpp_routing_node:/c\ opendaylight::vpp_routing_node: ${deploy_options_array['odl_vpp_routing_node']}.${domain_name}" ${ENV_FILE}
@@ -164,26 +199,62 @@ EOI
fi
if [ -n "${deploy_options_array['performance']}" ]; then
+ ovs_dpdk_perf_flag="False"
for option in "${performance_options[@]}" ; do
- arr=($option)
- # use compute's kernel settings for all nodes for now.
- if [ "${arr[0]}" == "Compute" ] && [ "${arr[1]}" == "kernel" ]; then
- kernel_args+=" ${arr[2]}=${arr[3]}"
- fi
+ if [ "${arr[1]}" == "vpp" ]; then
+ if [ "${arr[0]}" == "Compute" ]; then
+ role='NovaCompute'
+ else
+ role=${arr[0]}
+ fi
+ if [ "${arr[2]}" == "main-core" ]; then
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
+ sed -i "/${role}ExtraConfig:/ c\ ${role}ExtraConfig:\n fdio::vpp_cpu_main_core: \"'${arr[3]}'\"" ${ENV_FILE}
+EOI
+ elif [ "${arr[2]}" == "corelist-workers" ]; then
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
+ sed -i "/${role}ExtraConfig:/ c\ ${role}ExtraConfig:\n fdio::vpp_cpu_corelist_workers: \"'${arr[3]}'\"" ${ENV_FILE}
+EOI
+ fi
+ fi
+ arr=($option)
+ # use compute's kernel settings for all nodes for now.
+ if [ "${arr[0]}" == "Compute" ] && [ "${arr[1]}" == "kernel" ]; then
+ kernel_args+=" ${arr[2]}=${arr[3]}"
+ fi
+ if [ "${arr[0]}" == "Compute" ] && [ "${arr[1]}" == "ovs" ]; then
+ eval "${arr[2]}=${arr[3]}"
+ ovs_dpdk_perf_flag="True"
+ fi
done
ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
- sed -i "/ComputeKernelArgs:/c\ ComputeKernelArgs: '$kernel_args'" ${ENV_FILE}
- sed -i "$ a\resource_registry:\n OS::TripleO::NodeUserData: first-boot.yaml" ${ENV_FILE}
- sed -i "/NovaSchedulerDefaultFilters:/c\ NovaSchedulerDefaultFilters: 'RamFilter,ComputeFilter,AvailabilityZoneFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,NUMATopologyFilter'" ${ENV_FILE}
+ sed -i "/ComputeKernelArgs:/c\ ComputeKernelArgs: '$kernel_args'" ${ENV_FILE}
+ sed -i "$ a\resource_registry:\n OS::TripleO::NodeUserData: first-boot.yaml" ${ENV_FILE}
+ sed -i "/NovaSchedulerDefaultFilters:/c\ NovaSchedulerDefaultFilters: 'RamFilter,ComputeFilter,AvailabilityZoneFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,NUMATopologyFilter'" ${ENV_FILE}
+EOI
+
+ if [[ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' && "$ovs_dpdk_perf_flag" == "True" ]]; then
+ for ovs_option in ${!ovs_option_heat_arr[@]}; do
+ if [ -n "${!ovs_option}" ]; then
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
+ sed -i "/${ovs_option_heat_arr[$ovs_option]}:/c\ ${ovs_option_heat_arr[$ovs_option]}: ${!ovs_option}" ${ENV_FILE}
EOI
+ fi
+ done
+ fi
fi
if [[ -z "${deploy_options_array['sdn_controller']}" || "${deploy_options_array['sdn_controller']}" == 'False' ]]; then
if [ "${deploy_options_array['dataplane']}" == "fdio" ]; then
if [ "$tenant_nic_mapping_controller_members" == "$tenant_nic_mapping_compute_members" ]; then
+ echo -e "${blue}INFO: nosdn fdio deployment...installing correct vpp packages...${reset}"
ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
sed -i "/NeutronVPPAgentPhysnets:/c\ NeutronVPPAgentPhysnets: 'datacentre:${tenant_nic_mapping_controller_members}'" ${ENV_FILE}
+ LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum remove -y vpp vpp-api-python vpp-lib vpp-plugins" \
+ --run-command "yum install -y /root/fdio_nosdn/*.rpm" \
+ --run-command "rm -f /etc/sysctl.d/80-vpp.conf" \
+ -a overcloud-full.qcow2
EOI
else
echo -e "${red}Compute and Controller must use the same tenant nic name, please modify network setting file.${reset}"
@@ -213,14 +284,22 @@ EOI
EOI
fi
- # Override any previous packages if FDIO and ODL L2
- if [[ "${deploy_options_array['vpp']}" == 'True' && "${deploy_options_array['sdn_controller']}" == 'opendaylight' && "${deploy_options_array['sdn_l3']}" == "False" ]]; then
- ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
- LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum -y remove opendaylight vpp vpp-api-python vpp-lib vpp-plugins honeycomb" \
- --run-command "yum -y install /root/fdio_l2/*.rpm" \
+ # Override ODL if FDIO and ODL L2
+ if [[ "${deploy_options_array['vpp']}" == 'True' && "${deploy_options_array['sdn_controller']}" == 'opendaylight' ]]; then
+ if [ "${deploy_options_array['sdn_l3']}" == "False" ]; then
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
+ LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum -y remove opendaylight" \
+ --run-command "yum -y install /root/fdio_l2/opendaylight*.rpm" \
+ -a overcloud-full.qcow2
+EOI
+ else
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
+ LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum remove -y vpp vpp-api-python vpp-lib vpp-plugins honeycomb" \
+ --run-command "yum -y install /root/fdio_l3/*.rpm" \
--run-command "rm -f /etc/sysctl.d/80-vpp.conf" \
-a overcloud-full.qcow2
EOI
+ fi
fi
# check if ceph should be enabled
@@ -228,6 +307,17 @@ EOI
DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml"
fi
+ if [ "${deploy_options_array['sdn_controller']}" == 'ovn' ]; then
+ # The epoch in deloran's ovs is 1: and in leif's is 0:
+ # so we have to execute a downgrade instead of an update
+ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
+ LIBGUESTFS_BACKEND=direct virt-customize \
+ --run-command "cd /root/ovs27 && yum update -y *openvswitch*" \
+ --run-command "cd /root/ovs27 && yum downgrade -y *openvswitch*" \
+ -a overcloud-full.qcow2
+EOI
+ fi
+
# 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")
@@ -344,17 +434,21 @@ if ! openstack stack list | grep CREATE_COMPLETE 1>/dev/null; then
fi
EOI
- # Configure DPDK
+ # Configure DPDK and restart ovs agent after bringing up br-phy
if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then
ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI || (echo "DPDK config failed, exiting..."; exit 1)
source stackrc
set -o errexit
for node in \$(nova list | grep novacompute | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+"); do
-echo "Running DPDK test app on \$node"
+echo "Checking DPDK status and bringing up br-phy on \$node"
ssh -T ${SSH_OPTIONS[@]} "heat-admin@\$node" <<EOF
set -o errexit
-sudo dpdk_helloworld --no-pci
-sudo dpdk_nic_bind -s
+sudo dpdk-devbind -s
+sudo ifup br-phy
+if [[ -z "${deploy_options_array['sdn_controller']}" || "${deploy_options_array['sdn_controller']}" == 'False' ]]; then
+ echo "Restarting openvswitch agent to pick up VXLAN tunneling"
+ sudo systemctl restart neutron-openvswitch-agent
+fi
EOF
done
EOI
diff --git a/lib/python/apex/deploy_settings.py b/lib/python/apex/deploy_settings.py
index 9fb4c6f7..dc58d764 100644
--- a/lib/python/apex/deploy_settings.py
+++ b/lib/python/apex/deploy_settings.py
@@ -34,7 +34,7 @@ OPT_DEPLOY_SETTINGS = ['performance',
'odl_vpp_routing_node']
VALID_ROLES = ['Controller', 'Compute', 'ObjectStorage']
-VALID_PERF_OPTS = ['kernel', 'nova', 'vpp']
+VALID_PERF_OPTS = ['kernel', 'nova', 'vpp', 'ovs']
VALID_DATAPLANES = ['ovs', 'ovs_dpdk', 'fdio']
diff --git a/lib/python/apex_python_utils.py b/lib/python/apex_python_utils.py
index 830af360..1f49d474 100755
--- a/lib/python/apex_python_utils.py
+++ b/lib/python/apex_python_utils.py
@@ -123,6 +123,10 @@ def build_nic_template(args):
if ds['sdn_l3']:
nets['external'][0]['nic_mapping'][args.role]['uio-driver'] =\
ds['performance'][args.role.title()]['vpp']['uio-driver']
+ if ds.get('performance', {}).get(args.role.title(), {}).get('vpp', {})\
+ .get('interface-options'):
+ nets['tenant']['nic_mapping'][args.role]['interface-options'] =\
+ ds['performance'][args.role.title()]['vpp']['interface-options']
print(template.render(nets=nets,
role=args.role,
diff --git a/lib/undercloud-functions.sh b/lib/undercloud-functions.sh
index 2a370bff..0b13c8c8 100755
--- a/lib/undercloud-functions.sh
+++ b/lib/undercloud-functions.sh
@@ -55,6 +55,10 @@ function setup_undercloud_vm {
# if the VM is not running update the authkeys and start it
if ! virsh list | grep undercloud > /dev/null; then
+ if [ "$debug" == 'TRUE' ]; then
+ LIBGUESTFS_BACKEND=direct virt-customize -a $undercloud_dst --root-password password:opnfvapex
+ fi
+
echo "Injecting ssh key to Undercloud VM"
LIBGUESTFS_BACKEND=direct virt-customize -a $undercloud_dst --run-command "mkdir -p /root/.ssh/" \
--upload ~/.ssh/id_rsa.pub:/root/.ssh/authorized_keys \
@@ -208,6 +212,7 @@ openstack-config --set undercloud.conf DEFAULT dhcp_end ${admin_dhcp_range##*,}
openstack-config --set undercloud.conf DEFAULT inspection_iprange ${admin_introspection_range}
openstack-config --set undercloud.conf DEFAULT undercloud_debug false
openstack-config --set undercloud.conf DEFAULT undercloud_hostname "undercloud.${domain_name}"
+openstack-config --set undercloud.conf DEFAULT enable_ui false
sudo openstack-config --set /etc/ironic/ironic.conf disk_utils iscsi_verify_attempts 30
sudo openstack-config --set /etc/ironic/ironic.conf disk_partitioner check_device_max_retries 40