2018-08-10 12:36:38 +00:00
|
|
|
#!/usr/bin/env bash
|
2018-06-19 03:58:46 +00:00
|
|
|
|
|
|
|
# create_vbox.sh
|
|
|
|
#
|
|
|
|
# Creates a virtual box with vagrant in the $PWD.
|
|
|
|
#
|
|
|
|
# This script creates a subdirectory called $PWD/<distro> and copies the Vagrantfile
|
|
|
|
# into that directory before running 'vagrant up'
|
|
|
|
|
2019-12-10 13:41:57 +00:00
|
|
|
set -e
|
|
|
|
|
2018-06-19 03:58:46 +00:00
|
|
|
VAGRANT_TARGET="$PWD"
|
|
|
|
|
2020-05-07 11:27:06 +00:00
|
|
|
DIR="$(cd "$(dirname $0)" && pwd)"
|
|
|
|
SPDK_DIR="$(cd "${DIR}/../../" && pwd)"
|
2018-06-19 03:58:46 +00:00
|
|
|
|
|
|
|
# The command line help
|
|
|
|
display_help() {
|
|
|
|
echo
|
2021-11-05 09:52:24 +00:00
|
|
|
echo " Usage: ${0##*/} [-b nvme-backing-file] [-n <num-cpus>] [-s <ram-size>] [-x <http-proxy>] [-hvrldcuf] <distro>"
|
2018-06-19 03:58:46 +00:00
|
|
|
echo
|
2021-12-09 15:46:18 +00:00
|
|
|
echo " distro = <centos7 | centos8| ubuntu1604 | ubuntu1804 | ubuntu2004 | fedora33 |"
|
2022-03-29 17:29:36 +00:00
|
|
|
echo " fedora34 | fedora35 | freebsd11 | freebsd12 | arch | clearlinux | rocky8>"
|
2018-06-19 03:58:46 +00:00
|
|
|
echo
|
2020-09-16 15:26:09 +00:00
|
|
|
echo " -s <ram-size> in MB Default: ${SPDK_VAGRANT_VMRAM}"
|
2020-03-05 08:41:38 +00:00
|
|
|
echo " -n <num-cpus> 1 to 4 Default: ${SPDK_VAGRANT_VMCPU}"
|
|
|
|
echo " -x <http-proxy> Default: \"${SPDK_VAGRANT_HTTP_PROXY}\""
|
|
|
|
echo " -p <provider> \"libvirt\" or \"virtualbox\". Default: ${SPDK_VAGRANT_PROVIDER}"
|
|
|
|
echo " -b <nvme-backing-file> Emulated NVMe options."
|
2019-08-28 14:08:21 +00:00
|
|
|
echo " If no -b option is specified then this option defaults to emulating single"
|
|
|
|
echo " NVMe with 1 namespace and assumes path: /var/lib/libvirt/images/nvme_disk.img"
|
2020-03-05 08:41:38 +00:00
|
|
|
echo " -b option can be used multiple times for attaching multiple files to the VM"
|
scripts/vagrant: Drop OCSSD awareness from functional tests
This also translates into switching fully to upstream QEMU for the
vagrant setup.
This is done in order to move away from OCSSD and SPDK's qemu fork
and align with what upstream QEMU supports. Main changes touch the
way how nvme namespaces are configured. With >= 5.2.0 it's possible
now to configure multiple namespace under single nvme device. Each
namespace requires a separate disk image to work with. This:
-b foo.img,nvme,1...
-b foo.img
-b foo.img,,..
Will still configure nvme controller with a single namespace attached
to foo.img.
This:
-b foo.img,,foo-ns1.img:foo-ns2.img
Will configure nvme controller with three namespaces.
Configuring nvme controller with no namespaces is possible via:
-b none ...
Note that this still allows to define other options specific to nvme
controller, like CMB and PMR. E.g:
-b none,nvme,,true
This will create nvme controller with no namespaces but with CMB
enabled.
It's possible now to also request for given controller to be zoned.
Currently if requsted, all namespaces under the target controller
will be zoned with no limit set as to max open|active zones.
All nvme devices have block size fixed to 4KB to imititate behavior
of the SPDK's qemu fork.
Compatibility with spdk-5.0.0 fork is preserved in context of setting
up namespaces so this:
-b foo.img,nvme,2
is valid as long as the emulator is set to that of spdk-5.0.0's.
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ib5d53cb5c330c1f84b57e0bf877ea0e2d0312ddd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8421
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-17 16:44:43 +00:00
|
|
|
echo " Parameters for -b option: <path>,<type>,<ns_path1[:ns_path1:...]>,<cmb>,<pmr_file[:pmr_size]>"
|
2021-09-24 10:44:25 +00:00
|
|
|
echo " Available types: nvme"
|
2021-03-23 19:09:50 +00:00
|
|
|
echo " Default pmr size: 16M"
|
|
|
|
echo " Default cmb: false"
|
scripts/vagrant: Drop OCSSD awareness from functional tests
This also translates into switching fully to upstream QEMU for the
vagrant setup.
This is done in order to move away from OCSSD and SPDK's qemu fork
and align with what upstream QEMU supports. Main changes touch the
way how nvme namespaces are configured. With >= 5.2.0 it's possible
now to configure multiple namespace under single nvme device. Each
namespace requires a separate disk image to work with. This:
-b foo.img,nvme,1...
-b foo.img
-b foo.img,,..
Will still configure nvme controller with a single namespace attached
to foo.img.
This:
-b foo.img,,foo-ns1.img:foo-ns2.img
Will configure nvme controller with three namespaces.
Configuring nvme controller with no namespaces is possible via:
-b none ...
Note that this still allows to define other options specific to nvme
controller, like CMB and PMR. E.g:
-b none,nvme,,true
This will create nvme controller with no namespaces but with CMB
enabled.
It's possible now to also request for given controller to be zoned.
Currently if requsted, all namespaces under the target controller
will be zoned with no limit set as to max open|active zones.
All nvme devices have block size fixed to 4KB to imititate behavior
of the SPDK's qemu fork.
Compatibility with spdk-5.0.0 fork is preserved in context of setting
up namespaces so this:
-b foo.img,nvme,2
is valid as long as the emulator is set to that of spdk-5.0.0's.
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ib5d53cb5c330c1f84b57e0bf877ea0e2d0312ddd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8421
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-17 16:44:43 +00:00
|
|
|
echo " type, ns_path, cmb and pmr can be empty"
|
2020-03-05 08:41:38 +00:00
|
|
|
echo " -c Create all above disk, default 0"
|
2020-04-06 08:19:31 +00:00
|
|
|
echo " -H Use hugepages for allocating VM memory. Only for libvirt provider. Default: false."
|
2020-03-05 08:41:38 +00:00
|
|
|
echo " -u Use password authentication to the VM instead of SSH keys."
|
|
|
|
echo " -l Use a local copy of spdk, don't try to rsync from the host."
|
2020-02-27 14:43:13 +00:00
|
|
|
echo " -a Copy spdk/autorun.sh artifacts from VM to host system."
|
2020-03-05 08:41:38 +00:00
|
|
|
echo " -d Deploy a test vm by provisioning all prerequisites for spdk autotest"
|
2020-09-09 09:40:45 +00:00
|
|
|
echo " -o Add network interface for openstack tests"
|
2020-03-05 08:41:38 +00:00
|
|
|
echo " --qemu-emulator=<path> Path to custom QEMU binary. Only works with libvirt provider"
|
|
|
|
echo " --vagrantfiles-dir=<path> Destination directory to put Vagrantfile into."
|
|
|
|
echo " --package-box Install all dependencies for SPDK and create a local vagrant box version."
|
2020-09-29 10:53:00 +00:00
|
|
|
echo " --vagrantfile=<path> Path to a custom Vagrantfile"
|
2018-06-19 03:58:46 +00:00
|
|
|
echo " -r dry-run"
|
|
|
|
echo " -h help"
|
|
|
|
echo " -v verbose"
|
2021-11-05 09:52:24 +00:00
|
|
|
echo " -f Force use of given distro, regardless if it's supported by the script or not."
|
2021-11-05 10:15:17 +00:00
|
|
|
echo " --box-version Version of the vagrant box to select for given distro."
|
2018-06-19 03:58:46 +00:00
|
|
|
echo " Examples:"
|
|
|
|
echo
|
2020-11-16 13:06:35 +00:00
|
|
|
echo " $0 -x http://user:password@host:port fedora33"
|
2018-06-19 03:58:46 +00:00
|
|
|
echo " $0 -s 2048 -n 2 ubuntu16"
|
|
|
|
echo " $0 -rv freebsd"
|
2020-11-16 13:06:35 +00:00
|
|
|
echo " $0 fedora33"
|
scripts/vagrant: Drop OCSSD awareness from functional tests
This also translates into switching fully to upstream QEMU for the
vagrant setup.
This is done in order to move away from OCSSD and SPDK's qemu fork
and align with what upstream QEMU supports. Main changes touch the
way how nvme namespaces are configured. With >= 5.2.0 it's possible
now to configure multiple namespace under single nvme device. Each
namespace requires a separate disk image to work with. This:
-b foo.img,nvme,1...
-b foo.img
-b foo.img,,..
Will still configure nvme controller with a single namespace attached
to foo.img.
This:
-b foo.img,,foo-ns1.img:foo-ns2.img
Will configure nvme controller with three namespaces.
Configuring nvme controller with no namespaces is possible via:
-b none ...
Note that this still allows to define other options specific to nvme
controller, like CMB and PMR. E.g:
-b none,nvme,,true
This will create nvme controller with no namespaces but with CMB
enabled.
It's possible now to also request for given controller to be zoned.
Currently if requsted, all namespaces under the target controller
will be zoned with no limit set as to max open|active zones.
All nvme devices have block size fixed to 4KB to imititate behavior
of the SPDK's qemu fork.
Compatibility with spdk-5.0.0 fork is preserved in context of setting
up namespaces so this:
-b foo.img,nvme,2
is valid as long as the emulator is set to that of spdk-5.0.0's.
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ib5d53cb5c330c1f84b57e0bf877ea0e2d0312ddd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8421
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-17 16:44:43 +00:00
|
|
|
echo " $0 -b /var/lib/libvirt/images/nvme1.img,nvme,/var/lib/libvirt/images/nvme1n1.img fedora33"
|
|
|
|
echo " $0 -b none fedora33"
|
2018-06-19 03:58:46 +00:00
|
|
|
echo
|
|
|
|
}
|
|
|
|
|
|
|
|
# Set up vagrant proxy. Assumes git-bash on Windows
|
|
|
|
# https://stackoverflow.com/questions/19872591/how-to-use-vagrant-in-a-proxy-environment
|
|
|
|
SPDK_VAGRANT_HTTP_PROXY=""
|
|
|
|
|
|
|
|
VERBOSE=0
|
|
|
|
HELP=0
|
2018-09-26 16:00:24 +00:00
|
|
|
COPY_SPDK_DIR=1
|
2020-02-27 14:43:13 +00:00
|
|
|
COPY_SPDK_ARTIFACTS=0
|
2018-06-19 03:58:46 +00:00
|
|
|
DRY_RUN=0
|
2018-09-26 17:11:36 +00:00
|
|
|
DEPLOY_TEST_VM=0
|
2018-06-19 03:58:46 +00:00
|
|
|
SPDK_VAGRANT_DISTRO="distro"
|
|
|
|
SPDK_VAGRANT_VMCPU=4
|
|
|
|
SPDK_VAGRANT_VMRAM=4096
|
2018-11-24 13:42:34 +00:00
|
|
|
SPDK_VAGRANT_PROVIDER="virtualbox"
|
2019-08-21 12:50:29 +00:00
|
|
|
SPDK_QEMU_EMULATOR=""
|
2020-09-09 09:40:45 +00:00
|
|
|
SPDK_OPENSTACK_NETWORK=0
|
2018-06-19 03:58:46 +00:00
|
|
|
OPTIND=1
|
2019-08-28 14:08:21 +00:00
|
|
|
NVME_DISKS_TYPE=""
|
|
|
|
NVME_DISKS_NAMESPACES=""
|
|
|
|
NVME_FILE=""
|
2019-11-19 10:38:23 +00:00
|
|
|
NVME_AUTO_CREATE=0
|
2019-10-29 12:04:11 +00:00
|
|
|
VAGRANTFILE_DIR=""
|
2019-12-06 14:16:04 +00:00
|
|
|
VAGRANT_PASSWORD_AUTH=0
|
2020-01-30 14:22:43 +00:00
|
|
|
VAGRANT_PACKAGE_BOX=0
|
2020-04-06 08:19:31 +00:00
|
|
|
VAGRANT_HUGE_MEM=0
|
2020-09-29 10:53:00 +00:00
|
|
|
VAGRANTFILE=$DIR/Vagrantfile
|
2021-11-05 09:52:24 +00:00
|
|
|
FORCE_DISTRO=false
|
2021-11-05 10:15:17 +00:00
|
|
|
VAGRANT_BOX_VERSION=""
|
2018-06-19 03:58:46 +00:00
|
|
|
|
2021-11-05 09:52:24 +00:00
|
|
|
while getopts ":b:n:s:x:p:uvcraldoHhf-:" opt; do
|
2018-06-19 03:58:46 +00:00
|
|
|
case "${opt}" in
|
2018-08-10 14:11:02 +00:00
|
|
|
-)
|
2020-05-07 11:27:06 +00:00
|
|
|
case "${OPTARG}" in
|
|
|
|
package-box) VAGRANT_PACKAGE_BOX=1 ;;
|
|
|
|
qemu-emulator=*) SPDK_QEMU_EMULATOR="${OPTARG#*=}" ;;
|
|
|
|
vagrantfiles-dir=*) VAGRANTFILE_DIR="${OPTARG#*=}" ;;
|
2020-09-29 10:53:00 +00:00
|
|
|
vagrantfile=*) [[ -n ${OPTARG#*=} ]] && VAGRANTFILE="${OPTARG#*=}" ;;
|
2021-11-05 10:15:17 +00:00
|
|
|
box-version=*) [[ -n ${OPTARG#*=} ]] && VAGRANT_BOX_VERSION="${OPTARG#*=}" ;;
|
2020-05-07 11:27:06 +00:00
|
|
|
*) echo "Invalid argument '$OPTARG'" ;;
|
|
|
|
esac
|
|
|
|
;;
|
2018-06-19 03:58:46 +00:00
|
|
|
x)
|
|
|
|
http_proxy=$OPTARG
|
|
|
|
https_proxy=$http_proxy
|
|
|
|
SPDK_VAGRANT_HTTP_PROXY="${http_proxy}"
|
2020-05-07 11:27:06 +00:00
|
|
|
;;
|
2018-06-19 03:58:46 +00:00
|
|
|
n)
|
|
|
|
SPDK_VAGRANT_VMCPU=$OPTARG
|
2020-05-07 11:27:06 +00:00
|
|
|
;;
|
2018-06-19 03:58:46 +00:00
|
|
|
s)
|
|
|
|
SPDK_VAGRANT_VMRAM=$OPTARG
|
2020-05-07 11:27:06 +00:00
|
|
|
;;
|
2018-08-10 14:11:02 +00:00
|
|
|
p)
|
2018-11-24 13:42:34 +00:00
|
|
|
SPDK_VAGRANT_PROVIDER=$OPTARG
|
2020-05-07 11:27:06 +00:00
|
|
|
;;
|
2018-06-19 03:58:46 +00:00
|
|
|
v)
|
|
|
|
VERBOSE=1
|
2020-05-07 11:27:06 +00:00
|
|
|
;;
|
2019-11-19 10:38:23 +00:00
|
|
|
c)
|
|
|
|
NVME_AUTO_CREATE=1
|
2020-05-07 11:27:06 +00:00
|
|
|
;;
|
2018-06-19 03:58:46 +00:00
|
|
|
r)
|
|
|
|
DRY_RUN=1
|
2020-05-07 11:27:06 +00:00
|
|
|
;;
|
2018-06-19 03:58:46 +00:00
|
|
|
h)
|
|
|
|
display_help >&2
|
|
|
|
exit 0
|
2020-05-07 11:27:06 +00:00
|
|
|
;;
|
2020-02-27 14:43:13 +00:00
|
|
|
a)
|
|
|
|
COPY_SPDK_ARTIFACTS=1
|
2020-05-07 11:27:06 +00:00
|
|
|
;;
|
2018-09-26 16:00:24 +00:00
|
|
|
l)
|
|
|
|
COPY_SPDK_DIR=0
|
2020-05-07 11:27:06 +00:00
|
|
|
;;
|
2018-09-26 17:11:36 +00:00
|
|
|
d)
|
|
|
|
DEPLOY_TEST_VM=1
|
2020-05-07 11:27:06 +00:00
|
|
|
;;
|
2020-09-09 09:40:45 +00:00
|
|
|
o)
|
|
|
|
SPDK_OPENSTACK_NETWORK=1
|
|
|
|
;;
|
2018-11-06 18:05:10 +00:00
|
|
|
b)
|
2019-08-28 14:08:21 +00:00
|
|
|
NVME_FILE+="${OPTARG#*=} "
|
2020-05-07 11:27:06 +00:00
|
|
|
;;
|
2019-12-06 14:16:04 +00:00
|
|
|
u)
|
|
|
|
VAGRANT_PASSWORD_AUTH=1
|
2020-05-07 11:27:06 +00:00
|
|
|
;;
|
2020-04-06 08:19:31 +00:00
|
|
|
H)
|
|
|
|
VAGRANT_HUGE_MEM=1
|
2020-05-07 11:27:06 +00:00
|
|
|
;;
|
2021-11-05 09:52:24 +00:00
|
|
|
f)
|
|
|
|
FORCE_DISTRO=true
|
|
|
|
;;
|
2018-06-19 03:58:46 +00:00
|
|
|
*)
|
|
|
|
echo " Invalid argument: -$OPTARG" >&2
|
|
|
|
echo " Try: \"$0 -h\"" >&2
|
|
|
|
exit 1
|
2020-05-07 11:27:06 +00:00
|
|
|
;;
|
2018-06-19 03:58:46 +00:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2020-05-07 11:27:06 +00:00
|
|
|
shift "$((OPTIND - 1))" # Discard the options and sentinel --
|
2018-06-19 03:58:46 +00:00
|
|
|
|
2019-11-29 08:21:39 +00:00
|
|
|
SPDK_VAGRANT_DISTRO="$*"
|
2018-06-19 03:58:46 +00:00
|
|
|
|
2019-11-29 08:21:39 +00:00
|
|
|
case "${SPDK_VAGRANT_DISTRO}" in
|
2020-11-26 13:34:01 +00:00
|
|
|
centos[78]) ;&
|
|
|
|
ubuntu1[68]04 | ubuntu2004) ;&
|
2022-04-11 10:02:20 +00:00
|
|
|
fedora3[3-6]) ;&
|
2020-11-26 13:34:01 +00:00
|
|
|
freebsd1[12]) ;&
|
2022-03-29 17:29:36 +00:00
|
|
|
rocky8) ;&
|
2021-11-05 09:52:24 +00:00
|
|
|
arch | clearlinux) ;;
|
2018-06-19 03:58:46 +00:00
|
|
|
*)
|
2021-11-05 09:52:24 +00:00
|
|
|
if [[ $FORCE_DISTRO == false ]]; then
|
|
|
|
echo " Invalid argument \"${SPDK_VAGRANT_DISTRO}\"" >&2
|
|
|
|
echo " Try: \"$0 -h\"" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-05-07 11:27:06 +00:00
|
|
|
;;
|
2018-06-19 03:58:46 +00:00
|
|
|
esac
|
2021-11-05 09:52:24 +00:00
|
|
|
export SPDK_VAGRANT_DISTRO
|
2018-06-19 03:58:46 +00:00
|
|
|
|
2019-08-28 14:08:21 +00:00
|
|
|
if [ -z "$NVME_FILE" ]; then
|
|
|
|
TMP="/var/lib/libvirt/images/nvme_disk.img"
|
|
|
|
NVME_DISKS_TYPE="nvme"
|
|
|
|
else
|
|
|
|
TMP=""
|
|
|
|
for args in $NVME_FILE; do
|
scripts/vagrant: Drop OCSSD awareness from functional tests
This also translates into switching fully to upstream QEMU for the
vagrant setup.
This is done in order to move away from OCSSD and SPDK's qemu fork
and align with what upstream QEMU supports. Main changes touch the
way how nvme namespaces are configured. With >= 5.2.0 it's possible
now to configure multiple namespace under single nvme device. Each
namespace requires a separate disk image to work with. This:
-b foo.img,nvme,1...
-b foo.img
-b foo.img,,..
Will still configure nvme controller with a single namespace attached
to foo.img.
This:
-b foo.img,,foo-ns1.img:foo-ns2.img
Will configure nvme controller with three namespaces.
Configuring nvme controller with no namespaces is possible via:
-b none ...
Note that this still allows to define other options specific to nvme
controller, like CMB and PMR. E.g:
-b none,nvme,,true
This will create nvme controller with no namespaces but with CMB
enabled.
It's possible now to also request for given controller to be zoned.
Currently if requsted, all namespaces under the target controller
will be zoned with no limit set as to max open|active zones.
All nvme devices have block size fixed to 4KB to imititate behavior
of the SPDK's qemu fork.
Compatibility with spdk-5.0.0 fork is preserved in context of setting
up namespaces so this:
-b foo.img,nvme,2
is valid as long as the emulator is set to that of spdk-5.0.0's.
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ib5d53cb5c330c1f84b57e0bf877ea0e2d0312ddd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8421
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-17 16:44:43 +00:00
|
|
|
while IFS=, read -r path type namespace cmb pmr zns; do
|
2020-05-07 11:27:06 +00:00
|
|
|
TMP+="$path,"
|
2019-08-28 14:08:21 +00:00
|
|
|
if [ -z "$type" ]; then
|
|
|
|
type="nvme"
|
|
|
|
fi
|
scripts/vagrant: Drop OCSSD awareness from functional tests
This also translates into switching fully to upstream QEMU for the
vagrant setup.
This is done in order to move away from OCSSD and SPDK's qemu fork
and align with what upstream QEMU supports. Main changes touch the
way how nvme namespaces are configured. With >= 5.2.0 it's possible
now to configure multiple namespace under single nvme device. Each
namespace requires a separate disk image to work with. This:
-b foo.img,nvme,1...
-b foo.img
-b foo.img,,..
Will still configure nvme controller with a single namespace attached
to foo.img.
This:
-b foo.img,,foo-ns1.img:foo-ns2.img
Will configure nvme controller with three namespaces.
Configuring nvme controller with no namespaces is possible via:
-b none ...
Note that this still allows to define other options specific to nvme
controller, like CMB and PMR. E.g:
-b none,nvme,,true
This will create nvme controller with no namespaces but with CMB
enabled.
It's possible now to also request for given controller to be zoned.
Currently if requsted, all namespaces under the target controller
will be zoned with no limit set as to max open|active zones.
All nvme devices have block size fixed to 4KB to imititate behavior
of the SPDK's qemu fork.
Compatibility with spdk-5.0.0 fork is preserved in context of setting
up namespaces so this:
-b foo.img,nvme,2
is valid as long as the emulator is set to that of spdk-5.0.0's.
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ib5d53cb5c330c1f84b57e0bf877ea0e2d0312ddd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8421
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-17 16:44:43 +00:00
|
|
|
NVME_CMB+="$cmb,"
|
|
|
|
NVME_PMR+="$pmr,"
|
|
|
|
NVME_ZNS+="$zns,"
|
2020-05-07 11:27:06 +00:00
|
|
|
NVME_DISKS_TYPE+="$type,"
|
|
|
|
NVME_DISKS_NAMESPACES+="$namespace,"
|
2019-11-19 10:38:23 +00:00
|
|
|
if [ ${NVME_AUTO_CREATE} = 1 ]; then
|
2022-01-02 15:38:45 +00:00
|
|
|
$SPDK_DIR/scripts/vagrant/create_nvme_img.sh -n $path
|
2019-11-19 10:38:23 +00:00
|
|
|
fi
|
2019-08-28 14:08:21 +00:00
|
|
|
done <<< $args
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
NVME_FILE=$TMP
|
2018-09-26 17:11:36 +00:00
|
|
|
|
2018-06-19 03:58:46 +00:00
|
|
|
if [ ${VERBOSE} = 1 ]; then
|
|
|
|
echo
|
|
|
|
echo DIR=${DIR}
|
|
|
|
echo SPDK_DIR=${SPDK_DIR}
|
|
|
|
echo VAGRANT_TARGET=${VAGRANT_TARGET}
|
|
|
|
echo HELP=$HELP
|
|
|
|
echo DRY_RUN=$DRY_RUN
|
2018-11-06 18:05:10 +00:00
|
|
|
echo NVME_FILE=$NVME_FILE
|
2019-08-28 14:08:21 +00:00
|
|
|
echo NVME_DISKS_TYPE=$NVME_DISKS_TYPE
|
2019-11-19 10:38:23 +00:00
|
|
|
echo NVME_AUTO_CREATE=$NVME_AUTO_CREATE
|
2019-08-28 14:08:21 +00:00
|
|
|
echo NVME_DISKS_NAMESPACES=$NVME_DISKS_NAMESPACES
|
2020-06-01 12:54:15 +00:00
|
|
|
echo NVME_CMB=$NVME_CMB
|
2021-03-23 19:09:50 +00:00
|
|
|
echo NVME_PMR=$NVME_PMR
|
scripts/vagrant: Drop OCSSD awareness from functional tests
This also translates into switching fully to upstream QEMU for the
vagrant setup.
This is done in order to move away from OCSSD and SPDK's qemu fork
and align with what upstream QEMU supports. Main changes touch the
way how nvme namespaces are configured. With >= 5.2.0 it's possible
now to configure multiple namespace under single nvme device. Each
namespace requires a separate disk image to work with. This:
-b foo.img,nvme,1...
-b foo.img
-b foo.img,,..
Will still configure nvme controller with a single namespace attached
to foo.img.
This:
-b foo.img,,foo-ns1.img:foo-ns2.img
Will configure nvme controller with three namespaces.
Configuring nvme controller with no namespaces is possible via:
-b none ...
Note that this still allows to define other options specific to nvme
controller, like CMB and PMR. E.g:
-b none,nvme,,true
This will create nvme controller with no namespaces but with CMB
enabled.
It's possible now to also request for given controller to be zoned.
Currently if requsted, all namespaces under the target controller
will be zoned with no limit set as to max open|active zones.
All nvme devices have block size fixed to 4KB to imititate behavior
of the SPDK's qemu fork.
Compatibility with spdk-5.0.0 fork is preserved in context of setting
up namespaces so this:
-b foo.img,nvme,2
is valid as long as the emulator is set to that of spdk-5.0.0's.
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ib5d53cb5c330c1f84b57e0bf877ea0e2d0312ddd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8421
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-17 16:44:43 +00:00
|
|
|
echo NVME_ZNS=$NVME_ZNS
|
2018-06-19 03:58:46 +00:00
|
|
|
echo SPDK_VAGRANT_DISTRO=$SPDK_VAGRANT_DISTRO
|
|
|
|
echo SPDK_VAGRANT_VMCPU=$SPDK_VAGRANT_VMCPU
|
|
|
|
echo SPDK_VAGRANT_VMRAM=$SPDK_VAGRANT_VMRAM
|
2018-11-24 13:42:34 +00:00
|
|
|
echo SPDK_VAGRANT_PROVIDER=$SPDK_VAGRANT_PROVIDER
|
2018-06-19 03:58:46 +00:00
|
|
|
echo SPDK_VAGRANT_HTTP_PROXY=$SPDK_VAGRANT_HTTP_PROXY
|
2019-08-21 12:50:29 +00:00
|
|
|
echo SPDK_QEMU_EMULATOR=$SPDK_QEMU_EMULATOR
|
2020-09-09 09:40:45 +00:00
|
|
|
echo SPDK_OPENSTACK_NETWORK=$SPDK_OPENSTACK_NETWORK
|
2020-01-30 14:22:43 +00:00
|
|
|
echo VAGRANT_PACKAGE_BOX=$VAGRANT_PACKAGE_BOX
|
2020-09-29 10:53:00 +00:00
|
|
|
echo VAGRANTFILE=$VAGRANTFILE
|
2021-11-05 09:52:24 +00:00
|
|
|
echo FORCE_DISTRO=$FORCE_DISTRO
|
2021-11-05 10:15:17 +00:00
|
|
|
echo VAGRANT_BOX_VERSION=$VAGRANT_BOX_VERSION
|
2018-06-19 03:58:46 +00:00
|
|
|
echo
|
|
|
|
fi
|
|
|
|
|
|
|
|
export SPDK_VAGRANT_HTTP_PROXY
|
|
|
|
export SPDK_VAGRANT_VMCPU
|
|
|
|
export SPDK_VAGRANT_VMRAM
|
|
|
|
export SPDK_DIR
|
2020-09-09 09:40:45 +00:00
|
|
|
export SPDK_OPENSTACK_NETWORK
|
2018-09-26 16:00:24 +00:00
|
|
|
export COPY_SPDK_DIR
|
2020-02-27 14:43:13 +00:00
|
|
|
export COPY_SPDK_ARTIFACTS
|
2018-09-26 17:11:36 +00:00
|
|
|
export DEPLOY_TEST_VM
|
2020-06-01 12:54:15 +00:00
|
|
|
export NVME_CMB
|
2021-03-23 19:09:50 +00:00
|
|
|
export NVME_PMR
|
scripts/vagrant: Drop OCSSD awareness from functional tests
This also translates into switching fully to upstream QEMU for the
vagrant setup.
This is done in order to move away from OCSSD and SPDK's qemu fork
and align with what upstream QEMU supports. Main changes touch the
way how nvme namespaces are configured. With >= 5.2.0 it's possible
now to configure multiple namespace under single nvme device. Each
namespace requires a separate disk image to work with. This:
-b foo.img,nvme,1...
-b foo.img
-b foo.img,,..
Will still configure nvme controller with a single namespace attached
to foo.img.
This:
-b foo.img,,foo-ns1.img:foo-ns2.img
Will configure nvme controller with three namespaces.
Configuring nvme controller with no namespaces is possible via:
-b none ...
Note that this still allows to define other options specific to nvme
controller, like CMB and PMR. E.g:
-b none,nvme,,true
This will create nvme controller with no namespaces but with CMB
enabled.
It's possible now to also request for given controller to be zoned.
Currently if requsted, all namespaces under the target controller
will be zoned with no limit set as to max open|active zones.
All nvme devices have block size fixed to 4KB to imititate behavior
of the SPDK's qemu fork.
Compatibility with spdk-5.0.0 fork is preserved in context of setting
up namespaces so this:
-b foo.img,nvme,2
is valid as long as the emulator is set to that of spdk-5.0.0's.
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ib5d53cb5c330c1f84b57e0bf877ea0e2d0312ddd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8421
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-17 16:44:43 +00:00
|
|
|
export NVME_ZNS
|
2019-08-28 14:08:21 +00:00
|
|
|
export NVME_DISKS_TYPE
|
|
|
|
export NVME_DISKS_NAMESPACES
|
2018-11-06 18:05:10 +00:00
|
|
|
export NVME_FILE
|
2019-12-06 14:16:04 +00:00
|
|
|
export VAGRANT_PASSWORD_AUTH
|
2020-04-06 08:19:31 +00:00
|
|
|
export VAGRANT_HUGE_MEM
|
2021-11-05 09:52:24 +00:00
|
|
|
export FORCE_DISTRO
|
2021-11-05 10:15:17 +00:00
|
|
|
export VAGRANT_BOX_VERSION
|
2018-06-19 03:58:46 +00:00
|
|
|
|
2018-11-24 13:42:34 +00:00
|
|
|
if [ -n "$SPDK_VAGRANT_PROVIDER" ]; then
|
2020-05-07 11:27:06 +00:00
|
|
|
provider="--provider=${SPDK_VAGRANT_PROVIDER}"
|
2018-08-10 14:11:02 +00:00
|
|
|
fi
|
|
|
|
|
2018-11-24 13:42:34 +00:00
|
|
|
if [ -n "$SPDK_VAGRANT_PROVIDER" ]; then
|
2020-05-07 11:27:06 +00:00
|
|
|
export SPDK_VAGRANT_PROVIDER
|
2018-11-24 13:42:34 +00:00
|
|
|
fi
|
|
|
|
|
2020-05-07 11:27:06 +00:00
|
|
|
if [ -n "$SPDK_QEMU_EMULATOR" ] && [ "$SPDK_VAGRANT_PROVIDER" == "libvirt" ]; then
|
|
|
|
export SPDK_QEMU_EMULATOR
|
2019-08-21 12:50:29 +00:00
|
|
|
fi
|
|
|
|
|
2018-06-19 03:58:46 +00:00
|
|
|
if [ ${DRY_RUN} = 1 ]; then
|
2021-11-25 01:40:59 +00:00
|
|
|
echo "Environment Variables"
|
2018-06-19 03:58:46 +00:00
|
|
|
printenv SPDK_VAGRANT_DISTRO
|
|
|
|
printenv SPDK_VAGRANT_VMRAM
|
|
|
|
printenv SPDK_VAGRANT_VMCPU
|
2018-11-24 13:42:34 +00:00
|
|
|
printenv SPDK_VAGRANT_PROVIDER
|
2018-06-19 03:58:46 +00:00
|
|
|
printenv SPDK_VAGRANT_HTTP_PROXY
|
2019-08-21 12:50:29 +00:00
|
|
|
printenv SPDK_QEMU_EMULATOR
|
2019-08-28 14:08:21 +00:00
|
|
|
printenv NVME_DISKS_TYPE
|
2019-11-19 10:38:23 +00:00
|
|
|
printenv NVME_AUTO_CREATE
|
2019-08-28 14:08:21 +00:00
|
|
|
printenv NVME_DISKS_NAMESPACES
|
|
|
|
printenv NVME_FILE
|
2018-06-19 03:58:46 +00:00
|
|
|
printenv SPDK_DIR
|
2020-04-06 08:19:31 +00:00
|
|
|
printenv VAGRANT_HUGE_MEM
|
2020-09-29 10:53:00 +00:00
|
|
|
printenv VAGRANTFILE
|
2021-11-05 09:52:24 +00:00
|
|
|
printenv FORCE_DISTRO
|
2021-11-05 10:15:17 +00:00
|
|
|
printenv VAGRANT_BOX_VERSION
|
2018-06-19 03:58:46 +00:00
|
|
|
fi
|
2019-10-29 12:04:11 +00:00
|
|
|
if [ -z "$VAGRANTFILE_DIR" ]; then
|
|
|
|
VAGRANTFILE_DIR="${VAGRANT_TARGET}/${SPDK_VAGRANT_DISTRO}-${SPDK_VAGRANT_PROVIDER}"
|
2020-02-27 14:43:13 +00:00
|
|
|
export VAGRANTFILE_DIR
|
2019-10-29 12:04:11 +00:00
|
|
|
fi
|
2018-06-19 03:58:46 +00:00
|
|
|
|
2019-10-29 12:04:11 +00:00
|
|
|
if [ -d "${VAGRANTFILE_DIR}" ]; then
|
|
|
|
echo "Error: ${VAGRANTFILE_DIR} already exists!"
|
2018-06-19 03:58:46 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-09-29 10:53:00 +00:00
|
|
|
if [[ ! -f $VAGRANTFILE ]]; then
|
|
|
|
echo "$VAGRANTFILE is not a regular file!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2018-06-19 03:58:46 +00:00
|
|
|
if [ ${DRY_RUN} != 1 ]; then
|
2019-10-29 12:04:11 +00:00
|
|
|
mkdir -vp "${VAGRANTFILE_DIR}"
|
2020-09-29 10:53:00 +00:00
|
|
|
ln -s "$VAGRANTFILE" "${VAGRANTFILE_DIR}/Vagrantfile"
|
2019-10-29 12:04:11 +00:00
|
|
|
pushd "${VAGRANTFILE_DIR}"
|
2019-07-25 13:01:09 +00:00
|
|
|
if [ -n "${http_proxy}" ]; then
|
2018-06-19 03:58:46 +00:00
|
|
|
export http_proxy
|
|
|
|
export https_proxy
|
2018-09-22 00:34:11 +00:00
|
|
|
if echo "$SPDK_VAGRANT_DISTRO" | grep -q freebsd; then
|
2020-05-07 11:27:06 +00:00
|
|
|
cat > ~/vagrant_pkg.conf << EOF
|
2018-09-22 00:34:11 +00:00
|
|
|
pkg_env: {
|
|
|
|
http_proxy: ${http_proxy}
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
fi
|
2018-06-19 03:58:46 +00:00
|
|
|
fi
|
2020-02-27 14:43:13 +00:00
|
|
|
mkdir -p "${VAGRANTFILE_DIR}/output"
|
2018-08-10 14:11:02 +00:00
|
|
|
vagrant up $provider
|
2020-01-30 14:22:43 +00:00
|
|
|
if [ ${VAGRANT_PACKAGE_BOX} == 1 ]; then
|
|
|
|
vagrant ssh -c 'sudo spdk_repo/spdk/scripts/vagrant/update.sh'
|
2020-03-05 08:10:51 +00:00
|
|
|
vagrant halt
|
2020-02-13 07:07:21 +00:00
|
|
|
vagrant package --output spdk_${SPDK_VAGRANT_DISTRO}.box
|
2020-05-07 11:27:06 +00:00
|
|
|
vagrant box add spdk/${SPDK_VAGRANT_DISTRO} spdk_${SPDK_VAGRANT_DISTRO}.box \
|
|
|
|
&& rm spdk_${SPDK_VAGRANT_DISTRO}.box
|
2020-03-05 08:10:51 +00:00
|
|
|
vagrant destroy
|
2020-01-30 14:22:43 +00:00
|
|
|
fi
|
2018-06-19 03:58:46 +00:00
|
|
|
echo ""
|
|
|
|
echo " SUCCESS!"
|
|
|
|
echo ""
|
2019-10-29 12:04:11 +00:00
|
|
|
echo " cd to ${VAGRANTFILE_DIR} and type \"vagrant ssh\" to use."
|
2018-06-19 03:58:46 +00:00
|
|
|
echo " Use vagrant \"suspend\" and vagrant \"resume\" to stop and start."
|
2019-10-29 12:04:11 +00:00
|
|
|
echo " Use vagrant \"destroy\" followed by \"rm -rf ${VAGRANTFILE_DIR}\" to destroy all trace of vm."
|
2018-06-19 03:58:46 +00:00
|
|
|
echo ""
|
|
|
|
fi
|