diff options
author | Yibo Cai <yibo.cai@arm.com> | 2018-07-31 13:08:38 +0800 |
---|---|---|
committer | Yibo Cai <yibo.cai@arm.com> | 2018-08-02 10:31:19 +0800 |
commit | 2e2a9c8f10c0b320dd621a86237707acb3441a21 (patch) | |
tree | f41c89561e3cd36034459f485d3f1e4ff7750cc4 /src/arm/cni-deploy/roles/vhost-vpp/files/setvpp.sh | |
parent | 20518dc93167aff1c83bf2995acc3e75e5a02c3d (diff) |
src/arm: add k8s cni deployment tasks
Deploy Multus, SRIOV, Vhostuser(VPP+DPDK) with CRD.
Change-Id: I787d5fd61c75f17d50fbaf8f86c08bdc44c557b8
Signed-off-by: Yibo Cai <yibo.cai@arm.com>
Diffstat (limited to 'src/arm/cni-deploy/roles/vhost-vpp/files/setvpp.sh')
-rwxr-xr-x | src/arm/cni-deploy/roles/vhost-vpp/files/setvpp.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/arm/cni-deploy/roles/vhost-vpp/files/setvpp.sh b/src/arm/cni-deploy/roles/vhost-vpp/files/setvpp.sh new file mode 100755 index 0000000..15b0d27 --- /dev/null +++ b/src/arm/cni-deploy/roles/vhost-vpp/files/setvpp.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -x + +cid=`sed -ne '/hostname/p' /proc/1/task/1/mountinfo | awk -F '/' '{print $6}'` +cid_s=${cid:0:12} +filename=${cid_s}-net1.json +ifstring=`cat /vhost-user-net-plugin/${cid}/${cid_s}-net1.json | awk -F ',' '{print $4}'` +ifmac=`echo ${ifstring} | awk -F '\"' '{print $4}'` + +ipstr=$(cat /vhost-user-net-plugin/${cid}/${cid_s}-net1-ip4.conf |grep "ipAddr") +ipaddr=$(echo $ipstr | awk -F '\"' '{print $4}') +ipaddr1=$(echo $ipaddr | cut -d / -f 1) + +vdev_str="vdev virtio_user0,path=/vhost-user-net-plugin/$cid/$cid_s-net1,mac=$ifmac" + +sed -i.bak '/# dpdk/a\dpdk \{' /etc/vpp/startup.conf +sed -i.bak "/# vdev eth_bond1,mode=1/a\\$vdev_str" /etc/vpp/startup.conf +sed -i.bak '/# socket-mem/a\\}' /etc/vpp/startup.conf + +vpp -c /etc/vpp/startup.conf & + +sleep 40 + +vppctl set int state VirtioUser0/0/0 up +vppctl set int ip address VirtioUser0/0/0 ${ipaddr1}/24 +vppctl show int +vppctl show int address + +echo ${ipaddr1} > /vhost-user-net-plugin/$(hostname) |