Fuel plugin to deploy OVS with NSH and DPDK
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

install.sh 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. set -eux
  3. INSTALL_HOME=/tmp/ovs-nshdpdk
  4. rm -rf $INSTALL_HOME; mkdir -p $INSTALL_HOME
  5. cd $INSTALL_HOME
  6. host=$1
  7. nsh=$2
  8. dpdk=$3
  9. dpdk_socket_mem=${4:-''}
  10. pmd_cpu_mask=${5:-'2'}
  11. deb_arch=$(dpkg --print-architecture)
  12. ovs="ovs-dpdk_${deb_arch}.tar.gz"
  13. if [ $nsh = 'true' ]; then
  14. ovs="ovs-nsh-dpdk_${deb_arch}.tar.gz"
  15. fi
  16. apt-get install -y --allow-unauthenticated dkms
  17. curl http://$host:8080/plugins/fuel-plugin-ovs-1.0/repositories/ubuntu/${ovs} | tar -xzv
  18. dpkg -i openvswitch-datapath-dkms_*.deb
  19. dpkg -i openvswitch-common_*.deb
  20. dpkg -i openvswitch-switch_*.deb
  21. dpkg -i python-openvswitch_*.deb
  22. if [ $dpdk = 'true' ]
  23. then
  24. apt-get install -y --allow-unauthenticated dpdk dpdk-dev dpdk-dkms
  25. dpkg -i openvswitch-switch-dpdk_*.deb
  26. fi
  27. if [[ $dpdk = 'true' && -n $dpdk_socket_mem ]]
  28. then
  29. #Set to 0, dpdk init script mount hugepages but don't change current allocation
  30. sed -i "s/[# ]*\(NR_2M_PAGES=\).*/\10/" /etc/dpdk/dpdk.conf
  31. service dpdk start
  32. ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true
  33. ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-socket-mem="$dpdk_socket_mem"
  34. ovs-vsctl --no-wait set Open_vSwitch . other_config:pmd-cpu-mask="$pmd_cpu_mask"
  35. service openvswitch-switch restart
  36. fi
  37. rm -rf $INSTALL_HOME