Merge branch 'devel-2.5'
[ganeti-local] / doc / hooks.rst
index 77e9330..bac0649 100644 (file)
@@ -1,7 +1,7 @@
 Ganeti customisation using hooks
 ================================
 
-Documents ganeti version 2.0
+Documents Ganeti version 2.5
 
 .. contents::
 
@@ -98,7 +98,7 @@ The scripts will be run as follows:
 
 - stdout and stderr are directed to files
 
-- PATH is reset to ``/sbin:/bin:/usr/sbin:/usr/bin``
+- PATH is reset to :pyeval:`constants.HOOKS_PATH`
 
 - the environment is cleared, and only ganeti-specific variables will
   be left
@@ -213,6 +213,16 @@ Renames a node group.
 :pre-execution: master node and all nodes in the group
 :post-execution: master node and all nodes in the group
 
+OP_GROUP_EVACUATE
++++++++++++++++++
+
+Evacuates a node group.
+
+:directory: group-evacuate
+:env. vars: GROUP_NAME, TARGET_GROUPS
+:pre-execution: master node and all nodes in the group
+:post-execution: master node and all nodes in the group
+
 
 Instance operations
 ~~~~~~~~~~~~~~~~~~~
@@ -294,7 +304,7 @@ OP_INSTANCE_SET_PARAMS
 Modifies the instance parameters.
 
 :directory: instance-modify
-:env. vars: NEW_DISK_TEMPLATE
+:env. vars: NEW_DISK_TEMPLATE, RUNTIME_MEMORY
 :pre-execution: master node, primary and secondary nodes
 :post-execution: master node, primary and secondary nodes
 
@@ -393,6 +403,16 @@ Replace the disks of an instance.
 :pre-execution: master node, primary and new secondary nodes
 :post-execution: master node, primary and new secondary nodes
 
+OP_INSTANCE_CHANGE_GROUP
+++++++++++++++++++++++++
+
+Moves an instance to another group.
+
+:directory: instance-change-group
+:env. vars: TARGET_GROUPS
+:pre-execution: master node
+:post-execution: master node
+
 
 Cluster operations
 ~~~~~~~~~~~~~~~~~~
@@ -452,6 +472,26 @@ Modifies the cluster parameters.
 :pre-execution: master node
 :post-execution: master node
 
+:pyeval:`constants.FAKE_OP_MASTER_TURNUP`
++++++++++++++++++++++++++++++++++++++++++
+
+Called when the master IP is activated.
+
+:directory: master-ip-turnup
+:env. vars: MASTER_NETDEV, MASTER_IP, MASTER_NETMASK, CLUSTER_IP_VERSION
+:pre-execution: master node
+:post-execution: master node
+
+:pyeval:`constants.FAKE_OP_MASTER_TURNDOWN`
++++++++++++++++++++++++++++++++++++++++++++
+
+Called when the master IP is deactivated.
+
+:directory: master-ip-turndown
+:env. vars: MASTER_NETDEV, MASTER_IP, MASTER_NETMASK, CLUSTER_IP_VERSION
+:pre-execution: master node
+:post-execution: master node
+
 
 Obsolete operations
 ~~~~~~~~~~~~~~~~~~~
@@ -509,6 +549,9 @@ Specialised variables
 This is the list of variables which are specific to one or more
 operations.
 
+CLUSTER_IP_VERSION
+  IP version of the master IP (4 or 6)
+
 INSTANCE_NAME
   The name of the instance which is the target of the operation.
 
@@ -581,6 +624,18 @@ MASTER_CAPABLE
 VM_CAPABLE
   Whether the node can host instances.
 
+MASTER_NETDEV
+  Network device of the master IP
+
+MASTER_IP
+  The master IP
+
+MASTER_NETMASK
+  Netmask of the master IP
+
+INSTANCE_TAGS
+  A space-delimited list of the instance's tags.
+
 NODE_NAME
   The target node of this operation (not the node on which the hook
   runs).