Boxes to support libvirt as provider. Virtualbox set as default.
For ubuntu18 and 16 logic added to only download sjohnsen boxes if provider is libvirt. Also changed PROVIDER to SPDK_VAGRANT_PROVIDER and initialized to virtualbox. Now the directory of the default provider should read unbuntu16-virtualbox as opposed to ubuntu16-. Change-Id: I6cac03432b02cfd259759d504ec133d29d1f740e Signed-off-by: Lavar Askew <open.hyperion@gmail.com> Reviewed-on: https://review.gerrithub.io/434599 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Karol Latecki <karol.latecki@intel.com>
This commit is contained in:
parent
1d75aad3ff
commit
1cbd14ca1b
23
scripts/vagrant/Vagrantfile
vendored
23
scripts/vagrant/Vagrantfile
vendored
@ -5,6 +5,7 @@ Vagrant.configure(2) do |config|
|
||||
|
||||
# Pick the right distro and bootstrap, default is fedora26
|
||||
distro = ( ENV['SPDK_VAGRANT_DISTRO'] || "fedora26")
|
||||
provider = (ENV['SPDK_VAGRANT_PROVIDER'] || "virtualbox")
|
||||
case distro
|
||||
when "centos7"
|
||||
config.vm.box = "puppetlabs/centos-7.2-64-nocm"
|
||||
@ -14,13 +15,23 @@ Vagrant.configure(2) do |config|
|
||||
config.vm.box = "centos/7"
|
||||
end if Vagrant.has_plugin?('vagrant-libvirt')
|
||||
when "ubuntu16"
|
||||
# See: https://app.vagrantup.com/puppetlabs/boxes/ubuntu-16.04-64-nocm
|
||||
config.vm.box = "puppetlabs/ubuntu-16.04-64-nocm"
|
||||
config.vm.box_version = "1.0.0"
|
||||
if provider.eql?("libvirt")
|
||||
# https://app.vagrantup.com/sjohnsen/boxes/ubuntu1604
|
||||
config.vm.box = "sjohnsen/ubuntu1604"
|
||||
else
|
||||
# See: https://app.vagrantup.com/puppetlabs/boxes/ubuntu-16.04-64-nocm
|
||||
config.vm.box = "puppetlabs/ubuntu-16.04-64-nocm"
|
||||
config.vm.box_version = "1.0.0"
|
||||
end
|
||||
when "ubuntu18"
|
||||
# See: https://app.vagrantup.com/bento/boxes/ubuntu-18.04
|
||||
config.vm.box = "bento/ubuntu-18.04"
|
||||
config.vm.box_version = "201803.24.0"
|
||||
if provider.eql?("libvirt")
|
||||
# https://app.vagrantup.com/sjohnsen/boxes/ubuntu1804
|
||||
config.vm.box = "sjohnsen/ubuntu1804"
|
||||
else
|
||||
# See: https://app.vagrantup.com/bento/boxes/ubuntu-18.04
|
||||
config.vm.box = "bento/ubuntu-18.04"
|
||||
config.vm.box_version = "201803.24.0"
|
||||
end
|
||||
when "fedora26"
|
||||
#See: https://app.vagrantup.com/generic/boxes/fedora2
|
||||
config.vm.box = "generic/fedora26"
|
||||
|
@ -54,6 +54,7 @@ DEPLOY_TEST_VM=0
|
||||
SPDK_VAGRANT_DISTRO="distro"
|
||||
SPDK_VAGRANT_VMCPU=4
|
||||
SPDK_VAGRANT_VMRAM=4096
|
||||
SPDK_VAGRANT_PROVIDER="virtualbox"
|
||||
OPTIND=1
|
||||
NVME_FILE="nvme_disk.img"
|
||||
|
||||
@ -78,7 +79,7 @@ while getopts ":b:n:s:x:p:vrldh-:" opt; do
|
||||
SPDK_VAGRANT_VMRAM=$OPTARG
|
||||
;;
|
||||
p)
|
||||
PROVIDER=$OPTARG
|
||||
SPDK_VAGRANT_PROVIDER=$OPTARG
|
||||
;;
|
||||
v)
|
||||
VERBOSE=1
|
||||
@ -156,6 +157,7 @@ if [ ${VERBOSE} = 1 ]; then
|
||||
echo SPDK_VAGRANT_DISTRO=$SPDK_VAGRANT_DISTRO
|
||||
echo SPDK_VAGRANT_VMCPU=$SPDK_VAGRANT_VMCPU
|
||||
echo SPDK_VAGRANT_VMRAM=$SPDK_VAGRANT_VMRAM
|
||||
echo SPDK_VAGRANT_PROVIDER=$SPDK_VAGRANT_PROVIDER
|
||||
echo SPDK_VAGRANT_HTTP_PROXY=$SPDK_VAGRANT_HTTP_PROXY
|
||||
echo VHOST_HOST_DIR=$VHOST_HOST_DIR
|
||||
echo VHOST_VM_DIR=$VHOST_VM_DIR
|
||||
@ -170,8 +172,8 @@ export COPY_SPDK_DIR
|
||||
export DEPLOY_TEST_VM
|
||||
export NVME_FILE
|
||||
|
||||
if [ -n "$PROVIDER" ]; then
|
||||
provider="--provider=${PROVIDER}"
|
||||
if [ -n "$SPDK_VAGRANT_PROVIDER" ]; then
|
||||
provider="--provider=${SPDK_VAGRANT_PROVIDER}"
|
||||
fi
|
||||
|
||||
if [ -n "$VHOST_HOST_DIR" ]; then
|
||||
@ -182,24 +184,29 @@ if [ -n "$VHOST_VM_DIR" ]; then
|
||||
export VHOST_VM_DIR
|
||||
fi
|
||||
|
||||
if [ -n "$SPDK_VAGRANT_PROVIDER" ]; then
|
||||
export SPDK_VAGRANT_PROVIDER
|
||||
fi
|
||||
|
||||
if [ ${DRY_RUN} = 1 ]; then
|
||||
echo "Environemnt Variables"
|
||||
printenv SPDK_VAGRANT_DISTRO
|
||||
printenv SPDK_VAGRANT_VMRAM
|
||||
printenv SPDK_VAGRANT_VMCPU
|
||||
printenv SPDK_VAGRANT_PROVIDER
|
||||
printenv SPDK_VAGRANT_HTTP_PROXY
|
||||
printenv SPDK_DIR
|
||||
fi
|
||||
|
||||
if [ -d "${VAGRANT_TARGET}/${SPDK_VAGRANT_DISTRO}-${PROVIDER}" ]; then
|
||||
echo "Error: ${VAGRANT_TARGET}/${SPDK_VAGRANT_DISTRO}-${PROVIDER} already exists!"
|
||||
if [ -d "${VAGRANT_TARGET}/${SPDK_VAGRANT_DISTRO}-${SPDK_VAGRANT_PROVIDER}" ]; then
|
||||
echo "Error: ${VAGRANT_TARGET}/${SPDK_VAGRANT_DISTRO}-${SPDK_VAGRANT_PROVIDER} already exists!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ${DRY_RUN} != 1 ]; then
|
||||
mkdir -vp "${VAGRANT_TARGET}/${SPDK_VAGRANT_DISTRO}-${PROVIDER}"
|
||||
cp ${DIR}/Vagrantfile ${VAGRANT_TARGET}/${SPDK_VAGRANT_DISTRO}-${PROVIDER}
|
||||
pushd "${VAGRANT_TARGET}/${SPDK_VAGRANT_DISTRO}-${PROVIDER}"
|
||||
mkdir -vp "${VAGRANT_TARGET}/${SPDK_VAGRANT_DISTRO}-${SPDK_VAGRANT_PROVIDER}"
|
||||
cp ${DIR}/Vagrantfile ${VAGRANT_TARGET}/${SPDK_VAGRANT_DISTRO}-${SPDK_VAGRANT_PROVIDER}
|
||||
pushd "${VAGRANT_TARGET}/${SPDK_VAGRANT_DISTRO}-${SPDK_VAGRANT_PROVIDER}"
|
||||
if [ ! -z "${http_proxy}" ]; then
|
||||
export http_proxy
|
||||
export https_proxy
|
||||
@ -220,7 +227,7 @@ EOF
|
||||
echo ""
|
||||
echo " SUCCESS!"
|
||||
echo ""
|
||||
echo " cd to ${SPDK_VAGRANT_DISTRO}-${PROVIDER} and type \"vagrant ssh\" to use."
|
||||
echo " cd to ${SPDK_VAGRANT_DISTRO}-${SPDK_VAGRANT_PROVIDER} and type \"vagrant ssh\" to use."
|
||||
echo " Use vagrant \"suspend\" and vagrant \"resume\" to stop and start."
|
||||
echo " Use vagrant \"destroy\" followed by \"rm -rf ${SPDK_VAGRANT_DISTRO}\" to destroy all trace of vm."
|
||||
echo ""
|
||||
|
Loading…
Reference in New Issue
Block a user