# HG changeset patch
# User Florian Haas <[email protected]>
# Date 1287380876 -7200
# Node ID 8c88afdf27b0de507ce409af74312f5cd92eed66
# Parent f238c087b79730a64f576b62c10e7cbcb638d000
Medium: ManageVE: add migration capability
OpenVZ does not support live migration, but it supports
checkpoint/restore. Which is close enough.
diff -r f238c087b797 -r 8c88afdf27b0 heartbeat/ManageVE
--- a/heartbeat/ManageVE Tue Oct 19 19:03:57 2010 +0200
+++ b/heartbeat/ManageVE Mon Oct 18 07:47:56 2010 +0200
@@ -91,6 +91,8 @@
<action name="stop" timeout="75" />
<action name="status" depth="0" timeout="10" interval="10" />
<action name="monitor" depth="0" timeout="10" interval="10" />
+ <action name="migrate_to" timeout="75" />
+ <action name="migrate_from" timeout="75" />
<action name="validate-all" timeout="5" />
<action name="meta-data" timeout="5" />
</actions>
@@ -162,6 +164,22 @@
return $OCF_SUCCESS
}
+migrate_to_ve()
+{
+ if ! status_ve; then
+ ocf_log err "VE $VEID is not running, aborting"
+ exit $OCF_ERR_GENERIC
+ fi
+ ocf_run $VZCTL chkpnt $VEID || exit $OCF_ERR_GENERIC
+ return $OCF_SUCCESS
+}
+
+migrate_from_ve()
+{
+ ocf_run $VZCTL restore $VEID || exit $OCF_ERR_GENERIC
+ return $OCF_SUCCESS
+}
+
#
# status_ve()
#
@@ -282,6 +300,12 @@
status|monitor)
status_ve
;;
+ migrate_to)
+ migrate_to_ve
+ ;;
+ migrate_from)
+ migrate_from_ve
+ ;;
validate-all)
validate_all_ve
;;
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/