diff options
author | Gwenael Lambrouin <gwenael.lambrouin@orange.com> | 2021-12-13 13:17:53 +0100 |
---|---|---|
committer | Gwenael Lambrouin <gwenael.lambrouin@orange.com> | 2022-02-28 15:44:58 +0100 |
commit | 1a9c875d35daf4e742cd980e824c862ad793a658 (patch) | |
tree | 3fabbc360d61759f168e250c41aed5f6a309a064 /nfvbenchvm/dib/build-image.sh | |
parent | b8186aa57c5026c556f5ac41f49126b14d720cf4 (diff) |
nfvbenchvm: fix broken build after dib update
Attempting to build nfvbench VM images with diskimage_builder (dib)
3.16.0 leads to the following error:
diskimage_builder.element_dependencies.MissingElementException: Element
'block-device' not found
Something changed at some point of diskimage_builder history, and the
updated doc states: "When using the vm element, an element that provides
block-device should be included".
To fix this and prevent future similar issues, this patch:
- adds the "block-device-mbr" element to the dependency list
- sets diskimage_builder version
By the way:
- replace the deprecated "centos7" element with the more generic
"centos" element.
- add missing dependencies in the pre-requisites section of nfvbenchvm
doc
- install pip with package manager (the current latest version of
get-pip.py is not compatible with python 3.6, so let's use the
occasion to stop getting pip directly from the Internet)
- use Python 3 in build-image.sh
Change-Id: I3198a1042eca04224b2a62db443c39a76903cf22
Signed-off-by: Gwenael Lambrouin <gwenael.lambrouin@orange.com>
Diffstat (limited to 'nfvbenchvm/dib/build-image.sh')
-rwxr-xr-x | nfvbenchvm/dib/build-image.sh | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/nfvbenchvm/dib/build-image.sh b/nfvbenchvm/dib/build-image.sh index 6339f01..4559bb6 100755 --- a/nfvbenchvm/dib/build-image.sh +++ b/nfvbenchvm/dib/build-image.sh @@ -3,7 +3,8 @@ # A shell script to build the VPP VM image or NFVbench+TRex 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 +# Ubuntu: sudo apt-get -y install python3 python3-venv qemu-utils kpartx +# CentOS: sudo yum install -y python3 qemu-img kpartx usage() { echo "Usage: $0 [-l] [-g] [-v]" @@ -77,9 +78,9 @@ function build_image { if [ -d dib-venv ]; then . dib-venv/bin/activate else - virtualenv dib-venv + python3 -m venv dib-venv . dib-venv/bin/activate - pip install diskimage-builder + pip install diskimage-builder==3.16.0 fi # Add nfvbenchvm_centos elements directory to the DIB elements path @@ -110,8 +111,11 @@ function build_image { export TREX_VER=$(awk '/ENV TREX_VER/ {print $3}' ../../docker/Dockerfile | sed 's/"//g' | sed 's/\r//g') fi + # Specify CentOS version + export DIB_RELEASE=7 + echo "Building $1.qcow2..." - time disk-image-create -o $1 centos7 nfvbenchvm + time disk-image-create -o $1 centos nfvbenchvm fi ls -l $1.qcow2 @@ -146,4 +150,4 @@ else echo "Build generator image" build_image $generator_image_name fi -fi
\ No newline at end of file +fi |