aboutsummaryrefslogtreecommitdiffstats
path: root/nfvbenchvm/dib/build-image.sh
diff options
context:
space:
mode:
authorYichen Wang <yicwang@cisco.com>2017-08-04 17:06:18 -0700
committerYichen Wang <yicwang@cisco.com>2017-08-04 17:07:25 -0700
commit0036098e46e16c9ae5b795b108a5b9566c02906b (patch)
tree005463f0fa4f7a37dead0fa0c0f35c212a551ae7 /nfvbenchvm/dib/build-image.sh
parentba423e2c7f322871507835341d8265074d747781 (diff)
Add the scipts to build NFVbench VM
Change-Id: I9632333777260468d6f07cf0149c789626f20145 Signed-off-by: Yichen Wang <yicwang@cisco.com>
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