From 680ed635b31f1a605ab2b92236cb73834325e92f Mon Sep 17 00:00:00 2001 From: Pawel Piatek Date: Tue, 28 Mar 2023 02:48:31 +0200 Subject: [PATCH] scripts/vagrant: revert to use sshfs by default This partially revert commit edc93a246. Vagrant nfs support is broken in a way it changes /etc/exports file, but leaves there broken entries. Most probably there is some kind of race condition. Keep support for NFSv4 to use it by default if vagrant sshfs plugin is not installed or if user force to use it. Signed-off-by: Pawel Piatek Change-Id: I871fbfa0f33c35d7a2ed3c91d56b39112a5d21ca Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17352 Reviewed-by: Konrad Sztyber Reviewed-by: Karol Latecki Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins --- scripts/vagrant/Vagrantfile | 7 ++++++- scripts/vagrant/create_vbox.sh | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/vagrant/Vagrantfile b/scripts/vagrant/Vagrantfile index 02c8403df..aa4809853 100644 --- a/scripts/vagrant/Vagrantfile +++ b/scripts/vagrant/Vagrantfile @@ -323,7 +323,12 @@ distro_to_use = get_box_type(distro, force_distro) # local VM we don't need to worry about saturating the local link so skip # the compression to speed up the whole transfer. files_sync_backend = {type: "rsync", rsync__auto: false, rsync__args: ["--archive", "--verbose", "--delete"]} -plugins_sync_backend = {type: :nfs, nfs_udp: false, nfs_version: 4} + +if ENV['NFS4_BACKEND'] or not Vagrant.has_plugin?("vagrant-sshfs") + plugins_sync_backend = {type: :nfs, nfs_udp: false, nfs_version: 4} +else + plugins_sync_backend = {type: :sshfs} +end Vagrant.configure(2) do |config| config.vm.box = distro_to_use diff --git a/scripts/vagrant/create_vbox.sh b/scripts/vagrant/create_vbox.sh index 9626e3628..eebb53835 100755 --- a/scripts/vagrant/create_vbox.sh +++ b/scripts/vagrant/create_vbox.sh @@ -48,6 +48,7 @@ display_help() { echo " -a Copy spdk/autorun.sh artifacts from VM to host system." echo " -d Deploy a test vm by provisioning all prerequisites for spdk autotest" echo " -o Add network interface for openstack tests" + echo " -N Use NFSv4 backend" echo " --qemu-emulator= Path to custom QEMU binary. Only works with libvirt provider" echo " --vagrantfiles-dir= Destination directory to put Vagrantfile into." echo " --package-box Install all dependencies for SPDK and create a local vagrant box version." @@ -97,10 +98,11 @@ VAGRANT_PACKAGE_BOX=0 VAGRANT_HUGE_MEM=0 VAGRANTFILE=$DIR/Vagrantfile FORCE_DISTRO=false +NFS4_BACKEND=0 VAGRANT_BOX_VERSION="" EXTRA_VAGRANTFILES="" -while getopts ":b:n:s:x:p:uvcraldoHhf-:" opt; do +while getopts ":b:n:s:x:p:uvcraldoHNhf-:" opt; do case "${opt}" in -) case "${OPTARG}" in @@ -164,6 +166,9 @@ while getopts ":b:n:s:x:p:uvcraldoHhf-:" opt; do f) FORCE_DISTRO=true ;; + N) + NFS4_BACKEND=1 + ;; *) echo " Invalid argument: -$OPTARG" >&2 echo " Try: \"$0 -h\"" >&2