aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfmenguy <francoisregis.menguy@orange.com>2021-05-17 09:07:01 +0200
committerfmenguy <francoisregis.menguy@orange.com>2021-05-17 11:38:09 +0200
commit424d660b5355205afeb736163d3e6cf140e9b9f1 (patch)
treeb93f8838bc724c25fdc5af060977e710a3afb68a
parent1e262c6d86f105fc73739f623f6d97ee2aae8eb2 (diff)
NFVBENCH-208 Fix VM images
Change-Id: I9014b36b4f2e044f807a9b8a997e8c455511c046 Signed-off-by: fmenguy <francoisregis.menguy@orange.com>
-rwxr-xr-xnfvbenchvm/dib/build-image.sh23
-rwxr-xr-x[-rw-r--r--]nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/03-copy-rc-local0
-rwxr-xr-x[-rw-r--r--]nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/04-add-execute-attribute0
-rwxr-xr-x[-rw-r--r--]nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/52-nfvbench-script0
-rwxr-xr-x[-rw-r--r--]nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/53-sshd-script0
5 files changed, 23 insertions, 0 deletions
diff --git a/nfvbenchvm/dib/build-image.sh b/nfvbenchvm/dib/build-image.sh
index e4b468a..c595f6b 100755
--- a/nfvbenchvm/dib/build-image.sh
+++ b/nfvbenchvm/dib/build-image.sh
@@ -53,6 +53,25 @@ __version__=0.13
loopvm_image_name=nfvbenchvm_centos-$__version__
generator_image_name=nfvbenchvm_centos-generator-$__version__
+
+
+function cleanup_image {
+ # if image exists skip building
+ echo "Checking if image exists in google storage..."
+ if command -v gsutil >/dev/null; then
+ if gsutil -q stat gs://$gs_url/$1.qcow2; then
+ gsutil rm http://$gs_url/$1.qcow2
+ echo "Image is deleted"
+ exit 0
+ fi
+ echo "Image does not exist in google storage, starting build..."
+ echo
+ else
+ echo "Cannot check image availability in OPNFV artifact repository (gsutil not available)"
+ fi
+}
+
+
function build_image {
# if image exists skip building
echo "Checking if image exists in google storage..."
@@ -133,8 +152,12 @@ function build_image {
if [ ! $generator_only -eq 1 ] && [ ! $loopvm_only -eq 1 ]; then
+ echo "cleanup old loop VM image (wrong content)"
+ cleanup_image $loopvm_image_name
echo "Build loop VM image"
build_image $loopvm_image_name
+ echo "cleanup old generator VM image (wrong content)"
+ cleanup_image $generator_image_name
echo "Build generator image"
build_image $generator_image_name
else
diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/03-copy-rc-local b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/03-copy-rc-local
index 3311530..3311530 100644..100755
--- a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/03-copy-rc-local
+++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/03-copy-rc-local
diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/04-add-execute-attribute b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/04-add-execute-attribute
index 666d9dc..666d9dc 100644..100755
--- a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/04-add-execute-attribute
+++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/04-add-execute-attribute
diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/52-nfvbench-script b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/52-nfvbench-script
index 9162952..9162952 100644..100755
--- a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/52-nfvbench-script
+++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/52-nfvbench-script
diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/53-sshd-script b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/53-sshd-script
index 64e8877..64e8877 100644..100755
--- a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/53-sshd-script
+++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/53-sshd-script