Revert "Delete image TestVM only"
This reverts commit 8b0701cced
.
Change-Id: I7fa5439b4abb30ed6a277984904785aa60bbcf21
This commit is contained in:
parent
8b0701cced
commit
28f51a8d8d
|
@ -4,7 +4,14 @@ LOG_ROOT="/var/log/fuel-plugin-xenserver/"
|
|||
mkdir -p $LOG_ROOT
|
||||
LOG_FILE=$LOG_ROOT"controller_post_deployment.log"
|
||||
|
||||
function replace_test_image {
|
||||
function clear_images {
|
||||
for ID in $(glance image-list | awk 'NR>2{print $2}' | grep -v '^$');
|
||||
do
|
||||
glance image-delete $ID &>> $LOG_FILE
|
||||
done
|
||||
}
|
||||
|
||||
function create_image {
|
||||
local image_name
|
||||
image_name="$1"
|
||||
|
||||
|
@ -14,22 +21,16 @@ function replace_test_image {
|
|||
local image_file
|
||||
image_file="$3"
|
||||
|
||||
image_id=$(glance image-list | grep "$image_name" | awk -F "|" '{print $2}' | grep -v '^$')
|
||||
|
||||
if [[ -n "$image_id" ]]; then
|
||||
echo "Delete image $image_name" >> $LOG_FILE
|
||||
glance image-delete $image_id &>> $LOG_FILE
|
||||
if ! glance image-list | grep -q "$image_name"; then
|
||||
glance image-create \
|
||||
--name "$image_name" \
|
||||
--container-format ovf \
|
||||
--disk-format vhd \
|
||||
--property vm_mode="$vm_mode" \
|
||||
--visibility public \
|
||||
--file "$image_file" \
|
||||
&>> $LOG_FILE
|
||||
fi
|
||||
|
||||
echo "Create image $image_name" >> $LOG_FILE
|
||||
glance image-create \
|
||||
--name "$image_name" \
|
||||
--container-format ovf \
|
||||
--disk-format vhd \
|
||||
--property vm_mode="$vm_mode" \
|
||||
--visibility public \
|
||||
--file "$image_file" \
|
||||
&>> $LOG_FILE
|
||||
}
|
||||
|
||||
function mod_novnc {
|
||||
|
@ -52,12 +53,8 @@ EOF
|
|||
|
||||
source /root/openrc admin
|
||||
|
||||
echo "Before image replacement" >> $LOG_FILE
|
||||
glance image-list >> $LOG_FILE
|
||||
|
||||
replace_test_image "TestVM" "xen" cirros-0.3.4-x86_64-disk.vhd.tgz
|
||||
|
||||
echo "After image replacement" >> $LOG_FILE
|
||||
clear_images
|
||||
create_image "TestVM" "xen" cirros-0.3.4-x86_64-disk.vhd.tgz
|
||||
glance image-list >> $LOG_FILE
|
||||
|
||||
mod_novnc
|
||||
|
|
|
@ -3,7 +3,7 @@ name: fuel-plugin-xenserver
|
|||
# Human-readable name for your plugin
|
||||
title: XenServer Plugin
|
||||
# Plugin version
|
||||
version: '3.90.3'
|
||||
version: '3.90.2'
|
||||
# Description
|
||||
description: Enable Mirantis OpenStack to integrate with Xenserver
|
||||
# Required fuel version
|
||||
|
|
Loading…
Reference in New Issue