aboutsummaryrefslogtreecommitdiffstats
path: root/nfvbenchvm/dib/build-image.sh
diff options
context:
space:
mode:
Diffstat (limited to 'nfvbenchvm/dib/build-image.sh')
-rwxr-xr-xnfvbenchvm/dib/build-image.sh41
1 files changed, 41 insertions, 0 deletions
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