From 0036098e46e16c9ae5b795b108a5b9566c02906b Mon Sep 17 00:00:00 2001 From: Yichen Wang Date: Fri, 4 Aug 2017 17:06:18 -0700 Subject: Add the scipts to build NFVbench VM Change-Id: I9632333777260468d6f07cf0149c789626f20145 Signed-off-by: Yichen Wang --- nfvbenchvm/dib/build-image.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 nfvbenchvm/dib/build-image.sh (limited to 'nfvbenchvm/dib/build-image.sh') diff --git a/nfvbenchvm/dib/build-image.sh b/nfvbenchvm/dib/build-image.sh new file mode 100755 index 0000000..034c4dd --- /dev/null +++ b/nfvbenchvm/dib/build-image.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# A shell script to build the VPP VM image using diskinage-builder +# +# The following packages must be installed prior to using this script: +# sudo apt-get -y install python-virtualenv qemu-utils kpartx + +# image version number +__version__=0.3 +image_name=nfvbenchvm_centos-$__version__ + +# install diskimage-builder +if [ -d dib-venv ]; then + . dib-venv/bin/activate +else + virtualenv dib-venv + . dib-venv/bin/activate + pip install diskimage-builder +fi + +# Add nfvbenchvm_centos elements directory to the DIB elements path +export ELEMENTS_PATH=`pwd`/elements + +# canned user/password for direct login +export DIB_DEV_USER_USERNAME=nfvbench +export DIB_DEV_USER_PASSWORD=nfvbench +export DIB_DEV_USER_PWDLESS_SUDO=Y + +# Set the data sources to have ConfigDrive only +export DIB_CLOUD_INIT_DATASOURCES="ConfigDrive" + +# Configure VPP REPO +export DIB_YUM_REPO_CONF=$ELEMENTS_PATH/nfvbenchvm/fdio-release.repo + +# Use ELRepo to have latest kernel +export DIB_USE_ELREPO_KERNEL=True + +echo "Building $image_name.qcow2..." +time disk-image-create -o $image_name centos7 nfvbenchvm + +ls -l $image_name.qcow2 -- cgit 1.2.3-korg