Skip to content

Development environment set up using Vagrant

Daniel Moore edited this page Sep 22, 2018 · 6 revisions

Doing these steps, hello_nvme_bdev_rust worked for me!

Creating the VM

$ mkdir vagr
$ cd vagr
$ ../spdk/scripts/vagrant/create_vbox.sh -s 512 -n 1 -v ubuntu16
$ cd ubuntu16

Add this line to VagrantFile:

config.vm.synced_folder "/home/zeyuanhu/rustfs", "/home/vagrant/rustfs"

Finish the VM

$ vagrant reload
$ vagrant ssh
$ script -c 'sudo spdk_repo/spdk/scripts/vagrant/update.sh' update.log

Install spdk

$ cd spdk_repo/spdk/
$ git submodule update --init
$ mkdir ~/spdk_install
$ ./configure --prefix=~/spdk_install
$ make

Set Environmental Variables

$ export SPDK_INSTALL_DIR=/home/vagrant/spdk_install

Install Rust

$ curl https://sh.rustup.rs -sSf | sh
$ source $HOME/.cargo/env

Configure NVMe

$ sudo ./scripts/setup.sh
$ ./scripts/gen_nvme.sh
$ vim ~/rustfs/examples/hello_nvme_bdev/bdev.conf
  Replacing last two lines with output from ./scripts/gen_nvme.sh
    [Nvme]
        TransportID "trtype:PCIe traddr:0000:00:0e.0" Nvme0

Run!

$ sudo -E /home/vagrant/.cargo/bin/cargo run

Tail of my output:

   Writing to the bdev
   bdev io write completed successfully
   Reading io
   string buffer size without nul terminator: 14
   Read string from bdev: Hello World!
Clone this wiki locally