1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

feature #575: changed vmm remotes to use exec_and_log

This commit is contained in:
Javi Fontan 2011-04-27 12:11:59 +02:00
parent 5fa3006adf
commit f41f12f190
9 changed files with 18 additions and 90 deletions

View File

@ -21,13 +21,5 @@ source $(dirname $0)/../../scripts_common.sh
deploy_id=$1
virsh --connect $LIBVIRT_URI destroy $deploy_id
error_code=$?
if [ "x$?" = "x0" ]; then
exit $error_code
else
error_message "Could not destroy $deploy_id"
exit $error_code
fi
exec_and_log "virsh --connect $LIBVIRT_URI destroy $deploy_id" \
"Could not destroy $deploy_id"

View File

@ -22,13 +22,5 @@ source $(dirname $0)/../../scripts_common.sh
deploy_id=$1
dest_host=$2
virsh --connect $LIBVIRT_URI migrate --live $deploy_id $QEMU_PROTOCOL://$dest_host/system
error_code=$?
if [ "x$?" = "x0" ]; then
exit $error_code
else
error_message "Could not migrate $deploy_id to $dest_host"
exit $error_code
fi
exec_and_log "virsh --connect $LIBVIRT_URI migrate --live $deploy_id $QEMU_PROTOCOL://$dest_host/system" \
"Could not migrate $deploy_id to $dest_host"

View File

@ -21,13 +21,5 @@ source $(dirname $0)/../../scripts_common.sh
file=$1
virsh --connect $LIBVIRT_URI restore $file
error_code=$?
if [ "x$?" = "x0" ]; then
exit $error_code
else
error_message "Could not restore from $file"
exit $error_code
fi
exec_and_log "virsh --connect $LIBVIRT_URI restore $file" \
"Could not restore from $file"

View File

@ -27,13 +27,5 @@ if [ ! -f $file ]; then
chmod 666 $file
fi
virsh --connect $LIBVIRT_URI save $deploy_id $file
error_code=$?
if [ "x$?" = "x0" ]; then
exit $error_code
else
error_message "Could not save $deploy_id to $file"
exit $error_code
fi
exec_and_log "virsh --connect $LIBVIRT_URI save $deploy_id $file" \
"Could not save $deploy_id to $file"

View File

@ -21,13 +21,5 @@ source $(dirname $0)/../../scripts_common.sh
deploy_id=$1
$XM_CANCEL $deploy_id
error_code=$?
if [ "x$?" = "x0" ]; then
exit $error_code
else
error_message "Could not destroy $deploy_id"
exit $error_code
fi
exec_and_log "$XM_CANCEL $deploy_id" \
"Could not destroy $deploy_id"

View File

@ -22,13 +22,5 @@ source $(dirname $0)/../../scripts_common.sh
deploy_id=$1
dest_host=$2
$XM_MIGRATE $deploy_id $dest_host
error_code=$?
if [ "x$?" = "x0" ]; then
exit $error_code
else
error_message "Could not migrate $deploy_id to $dest_host"
exit $error_code
fi
exec_and_log "$XM_MIGRATE $deploy_id $dest_host" \
"Could not migrate $deploy_id to $dest_host"

View File

@ -21,14 +21,6 @@ source $(dirname $0)/../../scripts_common.sh
file=$1
$XM_RESTORE $file
error_code=$?
if [ "x$?" = "x0" ]; then
exit $error_code
else
error_message "Could not restore from $file"
exit $error_code
fi
exec_and_log "$XM_RESTORE $file" \
"Could not restore from $file"

View File

@ -22,13 +22,5 @@ source $(dirname $0)/../../scripts_common.sh
deploy_id=$1
file=$2
$XM_SAVE $deploy_id $file
error_code=$?
if [ "x$?" = "x0" ]; then
exit $error_code
else
error_message "Could not save $deploy_id to $file"
exit $error_code
fi
exec_and_log "$XM_SAVE $deploy_id $file" \
"Could not save $deploy_id to $file"

View File

@ -25,16 +25,8 @@ function gdm {
$XM_LIST | grep "$deploy_id "
}
$XM_SHUTDOWN $deploy_id
error_code=$?
if [ "x$?" = "x0" ]; then
exit $error_code
else
error_message "Could not shutdown $deploy_id"
exit $error_code
fi
exec_and_log "$XM_SHUTDOWN $deploy_id" \
"Could not shutdown $deploy_id"
OUT=$(gdm)