summaryrefslogtreecommitdiff
path: root/deployment_scripts/install.sh
blob: 0b8332afff15be42ac9a32e8d2c0e0a7b3e4456d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
set -eux

INSTALL_HOME=/tmp/ovs-nshdpdk
rm -rf $INSTALL_HOME; mkdir -p $INSTALL_HOME
cd $INSTALL_HOME

host=$1
nsh=$2
dpdk=$3
dpdk_socket_mem=$4


if [ $nsh = 'true' ]
then
    curl  http://$host:8080/plugins/fuel-plugin-ovs-0.9/repositories/ubuntu/ovs-nsh-dpdk.tar.gz | tar -xzv
    dpkg -i openvswitch-datapath-dkms_2.5.90-1.nsh_all.deb
    dpkg -i openvswitch-common_2.5.90-1.nsh_amd64.deb
    dpkg -i openvswitch-switch_2.5.90-1.nsh_amd64.deb
    dpkg -i python-openvswitch_2.5.90-1.nsh_all.deb
    if [ $dpdk = 'true' ]
    then
        dpkg -i libxenstore3.0*.deb
        dpkg -i libdpdk0_2.2.0-1_amd64.deb
        dpkg -i dpdk_2.2.0-1_amd64.deb
        dpkg -i openvswitch-switch-dpdk_2.5.90-1.nsh_amd64.deb
    fi
else
    curl  http://$host:8080/plugins/fuel-plugin-ovs-0.9/repositories/ubuntu/ovs-dpdk.tar.gz | tar -xzv
    dpkg -i openvswitch-datapath-dkms_2.5.90-1_all.deb
    dpkg -i openvswitch-common_2.5.90-1_amd64.deb
    dpkg -i openvswitch-switch_2.5.90-1_amd64.deb
    dpkg -i python-openvswitch_2.5.90-1_all.deb
    if [ $dpdk = 'true' ]
    then
        dpkg -i libxenstore3.0*.deb
        dpkg -i libdpdk0_16.07-1_amd64.deb
        dpkg -i dpdk_16.07-1_amd64.deb
        dpkg -i openvswitch-switch-dpdk_2.5.90-1_amd64.deb

        dpdk_pages=$(($dpdk_socket_mem / 2))
        sed "s/#*\(NR_2M_PAGES=\).*/\1${dpdk_pages}/" /etc/dpdk/dpdk.conf
        service dpdk start

        ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true
        [ -n $dpdk_socket_mem ] && vs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-socket-mem="$dpdk_socket_mem"

        service openvswitch-switch restart
    fi
fi