From b7ceb7508fa492cc1ac74485ea37d39f08b566ab Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Thu, 27 Sep 2018 13:13:53 -0700 Subject: [PATCH] scripts/vagrant: Add fc28 image and update docs. Keeping consistent with the distributions we support in the build pool. Change-Id: Iec13686507f890e9e18ecd5a1f4f238b2370f1d7 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/427161 Chandler-Test-Pool: SPDK Automated Test System Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- scripts/vagrant/README.md | 44 ++++++++++++++++++---------------- scripts/vagrant/Vagrantfile | 5 +++- scripts/vagrant/create_vbox.sh | 3 +++ 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/scripts/vagrant/README.md b/scripts/vagrant/README.md index 7faa7168ee..b44597ba6e 100644 --- a/scripts/vagrant/README.md +++ b/scripts/vagrant/README.md @@ -1,6 +1,6 @@ # SPDK Vagrant and VirtualBox -The following guide explains how to use the scripts in the `spdk/scripts/vagrant`. Both Mac and Windows platforms are supported. +The following guide explains how to use the scripts in the `spdk/scripts/vagrant`. Mac, Windows, and Linux platforms are supported. 1. Install and configure [Git](https://git-scm.com/) on your platform. 2. Install [VirtualBox 5.1](https://www.virtualbox.org/wiki/Downloads) or newer @@ -38,6 +38,10 @@ Quick start instructions for OSX: - Note: VirtualBox requires virtualization to be enabled in the BIOS. - Note: You should disable Hyper-V in Windows RS 3 laptop. Search `windows features` uncheck Hyper-V, restart laptop +## Linux Setup + +Following the generic instructions should be sufficient for most Linux distributions. For more thorough instructions on installing VirtualBox on your distribution of choice, please see the following [guide](https://www.virtualbox.org/wiki/Linux_Downloads). + ## Configure Vagrant If you are behind a corporate firewall, configure the following proxy settings. @@ -64,27 +68,34 @@ Use the `spdk/scripts/vagrant/create_vbox.sh` script to create a VM of your choi - ubuntu18 - fedora26 - fedora27 +- fedora28 - freebsd11 ``` $ spdk/scripts/vagrant/create_vbox.sh -h - Usage: create_vbox.sh [-n ] [-s ] [-x ] [-hvr] + Usage: create_vbox.sh [-n ] [-s ] [-x ] [-hvrld] - distro = + distro = -s in kb default: 4096 -n 1 to 4 default: 4 -x default: "" + -p libvirt or virtualbox + --vhost-host-dir= directory path with vhost test dependencies + (test VM qcow image, fio binary, ssh keys) + --vhost-vm-dir= directory where to put vhost dependencies in VM -r dry-run + -l use a local copy of spdk, don't try to rsync from the host. + -d deploy a test vm by provisioning all prerequisites for spdk autotest -h help -v verbose Examples: - spdk/scripts/vagrant/create_vbox.sh -x http://user:password@host:port fedora27 - spdk/scripts/vagrant/create_vbox.sh -s 2048 -n 2 ubuntu16 - spdk/scripts/vagrant/create_vbox.sh -rv freebsd - spdk/scripts/vagrant/create_vbox.sh fedora26 + ./scripts/vagrant/create_vbox.sh -x http://user:password@host:port fedora27 + ./scripts/vagrant/create_vbox.sh -s 2048 -n 2 ubuntu16 + ./scripts/vagrant/create_vbox.sh -rv freebsd + ./scripts/vagrant/create_vbox.sh fedora26 ``` It is recommended that you call the `create_vbox.sh` script from outside of the spdk repository. Call this script from a parent directory. This will allow the creation of multiple VMs in separate directories, all using the same spdk repository. For example: @@ -98,11 +109,12 @@ This script will: 1. create a subdirectory named in your $PWD 2. copy the needed files from `spdk/scripts/vagrant/` into the directory 3. create a working virtual box in the directory -4. rsycn the `~/.gitconfig` file to `/home/vagrant/` in the newly provisioned virtual box -5. rsync a copy of the source `spdk` repository to `/home/vagrant/spdk_repo/spdk` +4. rsync the `~/.gitconfig` file to `/home/vagrant/` in the newly provisioned virtual box +5. rsync a copy of the source `spdk` repository to `/home/vagrant/spdk_repo/spdk` (optional) 6. rsync a copy of the `~/vagrant_tools` directory to `/home/vagrant/tools` (optional) +7. execute vm_setup.sh on the guest to install all spdk dependencies (optional) -This arrangement allows the provisioning of multiple, different VMs within that same directory hiearchy using the same spdk repository. Following the creation of the vm you'll need to ssh into your virtual box and finish the VM initializaton. +This arrangement allows the provisioning of multiple, different VMs within that same directory hierarchy using the same spdk repository. Following the creation of the vm you'll need to ssh into your virtual box and finish the VM initializaton. ``` $ cd @@ -123,7 +135,7 @@ The `update.sh` script completes initialization of the VM by automating the foll 2. Runs the scripts/pdkdep.sh script 3. Installs the FreeBSD source in /usr/sys (FreeBSD only) -This only needs to be done once. +This only needs to be done once. This is also not necessary for Fedora VMs provisioned with the -d flag. The `vm_setup` script performs these operations instead. ## Post VM Initializtion @@ -157,17 +169,9 @@ Following VM initializtion you must: $ sudo ./hello_bdev ``` -## Additional Setup for Fedora 26 - -As of this writing the `vm_setup.sh` script only supports Fedora 26. To complete the full installation of all packages needed to run autotest.sh on your fedora26 VM, run the `spdk/test/common/config/vm_setup.sh` script. Note: this will take some time. It is recommended that the output of vm_setup.sh is captured in a script log. - -``` - $ script -c 'spdk_repo/spdk/test/common/config/vm_setup.sh -i -t librxe,iscsi,rocksdb,fio,flamegraph,libiscsi' vm_setup.log -``` - ### Running autorun.sh with vagrant -After running vm_setup.sh the `run-autorun.sh` can be used to run `spdk/autorun.sh` on a Fedora 26 vagrant machine. Note that the `spdk/scripts/vagrant/autorun-spdk.conf` should be copied to `~/autorun-spdk.conf` before starting your tests. +After running vm_setup.sh the `run-autorun.sh` can be used to run `spdk/autorun.sh` on a Fedora vagrant machine. Note that the `spdk/scripts/vagrant/autorun-spdk.conf` should be copied to `~/autorun-spdk.conf` before starting your tests. ``` $ cp spdk/scripts/vagrant/autorun-spdk.conf ~/ diff --git a/scripts/vagrant/Vagrantfile b/scripts/vagrant/Vagrantfile index e11468fb2c..40e012b280 100644 --- a/scripts/vagrant/Vagrantfile +++ b/scripts/vagrant/Vagrantfile @@ -3,7 +3,7 @@ Vagrant.configure(2) do |config| - # Pick the right distro and bootstrap, default is ubuntu1604 + # Pick the right distro and bootstrap, default is fedora26 distro = ( ENV['SPDK_VAGRANT_DISTRO'] || "fedora26") case distro when "centos7" @@ -27,6 +27,9 @@ Vagrant.configure(2) do |config| when "fedora27" #See: https://app.vagrantup.com/generic/boxes/fedora27 config.vm.box = "generic/fedora27" + when "fedora28" + #See: https://app.vagrantup.com/generic/boxes/fedora28 + config.vm.box = "generic/fedora28" when "freebsd11" #See: https://app.vagrantup.com/generic/boxes/freebsd11 config.vm.box = "generic/freebsd11" diff --git a/scripts/vagrant/create_vbox.sh b/scripts/vagrant/create_vbox.sh index db4ca9c1f3..5fc6cb2179 100755 --- a/scripts/vagrant/create_vbox.sh +++ b/scripts/vagrant/create_vbox.sh @@ -122,6 +122,9 @@ case "$SPDK_VAGRANT_DISTRO" in fedora27) export SPDK_VAGRANT_DISTRO ;; + fedora28) + export SPDK_VAGRANT_DISTRO + ;; freebsd11) export SPDK_VAGRANT_DISTRO ;;