1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-24 02:03:52 +03:00

F #4393: add tm/{qcow2/shared/ssh}/resize

This commit is contained in:
Javi Fontan 2016-11-23 19:45:40 +01:00
parent 3ebdc8d8f4
commit 53413e0c29
5 changed files with 48 additions and 3 deletions

View File

@ -874,7 +874,8 @@ TM_SHARED_FILES="src/tm_mad/shared/clone \
src/tm_mad/shared/snap_delete \ src/tm_mad/shared/snap_delete \
src/tm_mad/shared/snap_revert \ src/tm_mad/shared/snap_revert \
src/tm_mad/shared/monitor \ src/tm_mad/shared/monitor \
src/tm_mad/shared/cpds" src/tm_mad/shared/cpds \
src/tm_mad/shared/resize"
TM_FS_LVM_FILES="src/tm_mad/fs_lvm/clone \ TM_FS_LVM_FILES="src/tm_mad/fs_lvm/clone \
src/tm_mad/fs_lvm/context \ src/tm_mad/fs_lvm/context \
@ -910,7 +911,8 @@ TM_QCOW2_FILES="src/tm_mad/qcow2/clone \
src/tm_mad/qcow2/snap_create_live \ src/tm_mad/qcow2/snap_create_live \
src/tm_mad/qcow2/snap_delete \ src/tm_mad/qcow2/snap_delete \
src/tm_mad/qcow2/snap_revert \ src/tm_mad/qcow2/snap_revert \
src/tm_mad/qcow2/cpds" src/tm_mad/qcow2/cpds \
src/tm_mad/qcow2/resize"
TM_SSH_FILES="src/tm_mad/ssh/clone \ TM_SSH_FILES="src/tm_mad/ssh/clone \
src/tm_mad/ssh/delete \ src/tm_mad/ssh/delete \
@ -929,7 +931,8 @@ TM_SSH_FILES="src/tm_mad/ssh/clone \
src/tm_mad/ssh/snap_revert \ src/tm_mad/ssh/snap_revert \
src/tm_mad/ssh/monitor \ src/tm_mad/ssh/monitor \
src/tm_mad/ssh/monitor_ds \ src/tm_mad/ssh/monitor_ds \
src/tm_mad/ssh/cpds" src/tm_mad/ssh/cpds \
src/tm_mad/ssh/resize"
TM_DUMMY_FILES="src/tm_mad/dummy/clone \ TM_DUMMY_FILES="src/tm_mad/dummy/clone \
src/tm_mad/dummy/delete \ src/tm_mad/dummy/delete \

39
src/tm_mad/common/resize Executable file
View File

@ -0,0 +1,39 @@
#!/bin/bash
# -------------------------------------------------------------------------- #
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
# resize image size vmid
SRC=$1
SIZE=$2
VMID=$3
if [ -z "${ONE_LOCATION}" ]; then
TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh
DATASTORES=/var/lib/one/datastores
else
TMCOMMON=$ONE_LOCATION/var/remotes/tm/tm_common.sh
DATASTORES=$ONE_LOCATION/var/datastores
fi
. $TMCOMMON
SRC_PATH=$(arg_path $SRC)
SRC_HOST=$(arg_host $SRC)
ssh_exec_and_log "${SRC_HOST}" "qemu-img resize ${SRC_PATH} ${SIZE}M" \
"Error resizing image ${SRC_PATH}"

1
src/tm_mad/qcow2/resize Symbolic link
View File

@ -0,0 +1 @@
../common/resize

1
src/tm_mad/shared/resize Symbolic link
View File

@ -0,0 +1 @@
../common/resize

1
src/tm_mad/ssh/resize Symbolic link
View File

@ -0,0 +1 @@
../common/resize