1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-27 03:21:29 +03:00

feature #3362: Fixes for ceph drivers

This commit is contained in:
Ruben S. Montero 2015-10-08 22:12:26 +02:00
parent 4c523c716c
commit fd93ebbefc
2 changed files with 5 additions and 6 deletions

View File

@ -14,13 +14,12 @@
# limitations under the License. #
#------------------------------------------------------------------------------ #
#--------------------------------------------------------------------------------
# Make a base @snap for image clones
# @param $1 the volume
#--------------------------------------------------------------------------------
rbd_make_snap() {
if [ "rbd_format $1" = "2" ]; then
if [ "$(rbd_format $1)" = "2" ]; then
$RBD info "$1@snap" >/dev/null 2>&1
if [ "$?" != "0" ]; then
@ -35,10 +34,10 @@ rbd_make_snap() {
# @param $1 the volume
#--------------------------------------------------------------------------------
rbd_rm_snap() {
if [ "rbd_format $1" = "2" ]; then
if [ "$(rbd_format $1)" = "2" ]; then
$RBD info "$1@snap" >/dev/null 2>&1
if [ "$?" == "0" ]; then
if [ "$?" = "0" ]; then
$RBD snap unprotect "$1@snap"
$RBD snap rm "$1@snap"
fi
@ -109,7 +108,7 @@ rbd_format() {
# @param $1 the volume
#--------------------------------------------------------------------------------
rbd_check_2() {
if [ $(rbd_format $1) != "2" ]; then
if [ "$(rbd_format $1)" != "2" ]; then
echo "Only RBD Format 2 is supported for this operation" >&2
exit 1
fi

View File

@ -72,7 +72,7 @@ log "Removing $RBD_SRC from the rbd image repository in $DST_HOST"
DELETE_CMD=$(cat <<EOF
RBD="${RBD}"
if [ "\$(rbd_format)" = "2" ]; then
if [ "\$(rbd_format $RBD_SRC)" = "2" ]; then
rbd_rm_r \$(rbd_top_parent $RBD_SRC)
else
$RBD rm $RBD_SRC