summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2011-12-23 14:20:01 +0100
committerDominique Martinet <asmadeus@codewreck.org>2011-12-23 14:20:01 +0100
commit43ad0da773528aae8b34379909c9a5ff5fa1c697 (patch)
tree96750c44200900a37b37ac0de8dbfb9f1c2b244a
parentf1a0e356b4495cfc295178f508afa22b27f21487 (diff)
lvchange -a for any vg, not just the main one. made it possible to change time limit depending on VM
-rw-r--r--kvm-cluster.conf8
-rwxr-xr-xkvm-wrapper.sh12
2 files changed, 10 insertions, 10 deletions
diff --git a/kvm-cluster.conf b/kvm-cluster.conf
index 967d44f..0e1a197 100644
--- a/kvm-cluster.conf
+++ b/kvm-cluster.conf
@@ -1,7 +1,7 @@
-#set_cluster_host m-host1 192.168.1.8
-#set_cluster_host m-host2 192.168.1.9
-set_cluster_host m-host3 192.168.1.4
-set_cluster_host m-host4 192.168.1.5
+#set_cluster_host m-host1 138.195.7.8
+set_cluster_host m-host2 138.195.7.9
+set_cluster_host m-host3 138.195.7.4
+set_cluster_host m-host4 138.195.7.5
SSH_OPTS="-t"
diff --git a/kvm-wrapper.sh b/kvm-wrapper.sh
index f906307..6600ca1 100755
--- a/kvm-wrapper.sh
+++ b/kvm-wrapper.sh
@@ -239,14 +239,14 @@ function kvm_nbd_disconnect ()
function check_activate_lv ()
{
for DISK in $@; do
- [[ "$LVM_MANAGE_LV" == "yes" ]] && [[ "$DISK" == "/dev/$LVM_VG_NAME/"* ]] && lvchange -ay "$DISK" || true
+ [[ "$LVM_MANAGE_LV" == "yes" ]] && [[ "$DISK" == "/dev/"*"/"* ]] && lvchange -ay "$DISK" || true
done
}
function check_deactivate_lv ()
{
for DISK in $@; do
- [[ "$LVM_MANAGE_LV" == "yes" ]] && [[ "$DISK" == "/dev/$LVM_VG_NAME/"* ]] && lvchange -an "$DISK" || true
+ [[ "$LVM_MANAGE_LV" == "yes" ]] && [[ "$DISK" == "/dev/"*"/"* ]] && lvchange -an "$DISK" || true
done
}
@@ -471,16 +471,16 @@ function kvm_stop_vm ()
test_exist "$PID_FILE" || fail_exit "VM $VM_NAME doesn't seem to be running.\nPID file $PID_FILE not found"
# test_socket_rw "$MONITOR_FILE" || fail_exit "Monitor socket $MONITOR_FILE not existing or not writable"
- local TIMELIMIT=20
+ KVM_WAIT_SHUTDOWN=${KVM_WAIT_SHUTDOWN:-20}
# Send monitor command through unix socket
- echo "Trying to powerdown the VM $VM_NAME first, might take some time (up to $TIMELIMIT sec)"
+ echo "Trying to powerdown the VM $VM_NAME first, might take some time (up to $KVM_WAIT_SHUTDOWN sec)"
monitor_send_cmd "system_powerdown"
echo -n "Waiting ..."
# Now wait for it
local ELAPSED=0
- ELAPSED=$(wait_test_timelimit $TIMELIMIT "! test_file $PID_FILE")
+ ELAPSED=$(wait_test_timelimit $KVM_WAIT_SHUTDOWN "! test_file $PID_FILE")
local PROPER=$?
echo " elapsed time : $ELAPSED sec"
@@ -915,7 +915,7 @@ case "$1" in
;;
migrate)
if [[ $# -eq 3 ]]; then
- ! test_exist "$PID_FILE" && fail_exit "Error : $VM_NAME doesn't seem to be running."
+ ! test_file "$PID_FILE" && fail_exit "Error : $VM_NAME doesn't seem to be running."
! test_socket_rw "$MONITOR_FILE" && fail_exit "Error : could not open monitor socket $MONITOR_FILE."
[[ "$KVM_CLUSTER_NODE" == "$3" ]] && fail_exit "Error: $2 already runs on $3!"
[[ -z "`get_cluster_host $3`" ]] && fail_exit "Error: Unknown host $3!"