Disabled gNMI support in p4vm until it becomes more stable
Change-Id: If2085d5824a2b9d06b249bf8d82d92fd384de5af
diff --git a/tools/dev/mininet/bmv2.py b/tools/dev/mininet/bmv2.py
index 87ed1ba..ad3d248 100644
--- a/tools/dev/mininet/bmv2.py
+++ b/tools/dev/mininet/bmv2.py
@@ -83,7 +83,8 @@
def __init__(self, name, json=None, debugger=False, loglevel="warn",
elogger=False, grpcPort=None, cpuPort=255,
thriftPort=None, netcfg=True, dryrun=False, pipeconfId="",
- pktdump=False, valgrind=False, injectPorts=False, **kwargs):
+ pktdump=False, valgrind=False, withGnmi=False,
+ injectPorts=True, **kwargs):
Switch.__init__(self, name, **kwargs)
self.grpcPort = pickUnusedPort() if not grpcPort else grpcPort
self.thriftPort = pickUnusedPort() if not thriftPort else thriftPort
@@ -108,6 +109,7 @@
self.netcfgfile = '/tmp/bmv2-%d-netcfg.json' % self.deviceId
self.pipeconfId = pipeconfId
self.injectPorts = parseBoolean(injectPorts)
+ self.withGnmi = parseBoolean(withGnmi)
self.longitude = kwargs['longitude'] if 'longitude' in kwargs else None
self.latitude = kwargs['latitude'] if 'latitude' in kwargs else None
self.onosDeviceId = "device:bmv2:%d" % self.deviceId
@@ -147,10 +149,6 @@
"port": self.grpcPort,
"deviceId": self.deviceId,
"deviceKeyId": "p4runtime:%s" % self.onosDeviceId
- },
- "gnmi": {
- "ip": srcIP,
- "port": self.grpcPort
}
},
"piPipeconf": {
@@ -159,7 +157,13 @@
"basic": basicCfg
}
- if(self.injectPorts):
+ if self.withGnmi:
+ cfgData["generalprovider"]["gnmi"] = {
+ "ip": srcIP,
+ "port": self.grpcPort
+ }
+
+ if self.injectPorts:
portData = {}
portId = 1
for intfName in self.intfNames():
diff --git a/tools/dev/p4vm/README.md b/tools/dev/p4vm/README.md
index de9edb7..11cccd3 100644
--- a/tools/dev/p4vm/README.md
+++ b/tools/dev/p4vm/README.md
@@ -88,7 +88,7 @@
```bash
cd $ONOS_ROOT/tools/dev/p4vm
-./build-ova.sh
+./export-ova.sh
```
This script will:
diff --git a/tools/dev/p4vm/export-ova.sh b/tools/dev/p4vm/export-ova.sh
index 7b94f23..757f94b 100755
--- a/tools/dev/p4vm/export-ova.sh
+++ b/tools/dev/p4vm/export-ova.sh
@@ -15,13 +15,11 @@
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \
-p ${SSH_PORT} sdn@127.0.0.1 "bash /vagrant/pre-ova-cleanup.sh"
-# Wait for VM to power off
-sleep 10
-
-# Make sure VM is not running
-vagrant halt
-
sleep 5
+vboxmanage controlvm ${VB_UUID} acpipowerbutton
+
+# Wait for VM to power off
+sleep 30
# Remove vagrant shared folder
vboxmanage sharedfolder remove ${VB_UUID} -name "vagrant"
diff --git a/tools/dev/p4vm/install-p4-tools.sh b/tools/dev/p4vm/install-p4-tools.sh
index f3df6a4..8797707 100755
--- a/tools/dev/p4vm/install-p4-tools.sh
+++ b/tools/dev/p4vm/install-p4-tools.sh
@@ -259,12 +259,15 @@
git submodule update --init --recursive
./autogen.sh
- ./configure --with-proto --with-sysrepo 'CXXFLAGS=-O0 -g'
+ # FIXME: re-enable --with-sysrepo when gNMI support becomes more stable
+ # ./configure --with-proto --with-sysrepo 'CXXFLAGS=-O0 -g'
+ ./configure --with-proto 'CXXFLAGS=-O0 -g'
make -j${NUM_CORES}
sudo make install
sudo ldconfig
- sudo proto/sysrepo/install_yangs.sh
+ # FIXME: re-enable when gNMI support becomes more stable
+ # sudo proto/sysrepo/install_yangs.sh
}
function do_bmv2 {
@@ -279,7 +282,10 @@
# Simple_switch_grpc target
cd targets/simple_switch_grpc
./autogen.sh
- ./configure --with-sysrepo --with-thrift 'CXXFLAGS=-O0 -g'
+
+ # FIXME: re-enable --with-sysrepo when gNMI support becomes more stable
+ # ./configure --with-sysrepo --with-thrift 'CXXFLAGS=-O0 -g'
+ ./configure --with-thrift 'CXXFLAGS=-O0 -g'
make -j${NUM_CORES}
sudo make install
sudo ldconfig
@@ -381,8 +387,9 @@
# In dependency order.
check_and_do ${PROTOBUF_COMMIT} protobuf do_protobuf protobuf
check_and_do ${GRPC_COMMIT} grpc do_grpc grpc
-check_and_do ${LIBYANG_COMMIT} libyang do_libyang libyang
-check_and_do ${SYSREPO_COMMIT} sysrepo do_sysrepo sysrepo
+# FIXME: re-enable when gNMI support becomes more stable
+# check_and_do ${LIBYANG_COMMIT} libyang do_libyang libyang
+# check_and_do ${SYSREPO_COMMIT} sysrepo do_sysrepo sysrepo
check_and_do ${BMV2_COMMIT} bmv2 do_pi_bmv2_deps bmv2-deps
check_and_do ${PI_COMMIT} p4runtime do_p4runtime p4runtime
check_and_do ${BMV2_COMMIT} bmv2 do_bmv2 bmv2
diff --git a/tools/dev/p4vm/pre-ova-cleanup.sh b/tools/dev/p4vm/pre-ova-cleanup.sh
index dcfecc9..1f52148 100755
--- a/tools/dev/p4vm/pre-ova-cleanup.sh
+++ b/tools/dev/p4vm/pre-ova-cleanup.sh
@@ -16,5 +16,3 @@
rm -rf ~/p4tools/sysrepo/build
cat /dev/null > ~/.bash_history
-
-sudo poweroff