Ganeti customisation using hooks
================================
-Documents Ganeti version 2.5
+Documents Ganeti version 2.6
.. contents::
Introduction
------------
-
-In order to allow customisation of operations, ganeti runs scripts
-under ``/etc/ganeti/hooks`` based on certain rules.
-
+In order to allow customisation of operations, Ganeti runs scripts in
+sub-directories of ``@SYSCONFDIR@/ganeti/hooks``. These sub-directories
+are named ``$hook-$phase.d``, where ``$phase`` is either ``pre`` or
+``post`` and ``$hook`` matches the directory name given for a hook (e.g.
+``cluster-verify-post.d`` or ``node-add-pre.d``).
This is similar to the ``/etc/network/`` structure present in Debian
for network interface handling.
:pre-execution: master node, the target node
:post-execution: master node, the target node
-OP_NODE_EVACUATE
-++++++++++++++++
-
-Relocate secondary instances from a node.
-
-:directory: node-evacuate
-:env. vars: NEW_SECONDARY, NODE_NAME
-:pre-execution: master node, target node
-:post-execution: master node, target node
-
OP_NODE_MIGRATE
++++++++++++++++
:pre-execution: master node and all nodes in the group
:post-execution: master node and all nodes in the group
+Network operations
+~~~~~~~~~~~~~~~~~~
+
+OP_NETWORK_ADD
+++++++++++++++
+
+Adds a network to the cluster.
+
+:directory: network-add
+:env. vars: NETWORK_NAME, NETWORK_SUBNET, NETWORK_GATEWAY, NETWORK_SUBNET6,
+ NETWORK_GATEWAY6, NETWORK_TYPE, NETWORK_MAC_PREFIX, NETWORK_TAGS
+:pre-execution: master node
+:post-execution: master node
+
+OP_NETWORK_REMOVE
++++++++++++++++++
+
+Removes a network from the cluster.
+
+:directory: network-remove
+:env. vars: NETWORK_NAME
+:pre-execution: master node
+:post-execution: master node
+
+OP_NETWORK_CONNECT
+++++++++++++++++++
+
+Connects a network to a nodegroup.
+
+:directory: network-connect
+:env. vars: GROUP_NAME, NETWORK_NAME,
+ GROUP_NETWORK_MODE, GROUP_NETWORK_LINK,
+ NETWORK_SUBNET, NETWORK_GATEWAY, NETWORK_SUBNET6,
+ NETWORK_GATEWAY6, NETWORK_TYPE, NETWORK_MAC_PREFIX, NETWORK_TAGS
+:pre-execution: nodegroup nodes
+:post-execution: nodegroup nodes
+
+
+OP_NETWORK_DISCONNECT
++++++++++++++++++++++
+
+Disconnects a network from a nodegroup.
+
+:directory: network-disconnect
+:env. vars: GROUP_NAME, NETWORK_NAME,
+ GROUP_NETWORK_MODE, GROUP_NETWORK_LINK,
+ NETWORK_SUBNET, NETWORK_GATEWAY, NETWORK_SUBNET6,
+ NETWORK_GATEWAY6, NETWORK_TYPE, NETWORK_MAC_PREFIX, NETWORK_TAGS
+:pre-execution: nodegroup nodes
+:post-execution: nodegroup nodes
+
+
+OP_NETWORK_SET_PARAMS
++++++++++++++++++++++
+
+Modifies a network.
+
+:directory: network-modify
+:env. vars: NETWORK_NAME, NETWORK_SUBNET, NETWORK_GATEWAY, NETWORK_SUBNET6,
+ NETWORK_GATEWAY6, NETWORK_TYPE, NETWORK_MAC_PREFIX, NETWORK_TAGS
+:pre-execution: master node
+:post-execution: master node
+
Instance operations
~~~~~~~~~~~~~~~~~~~
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
:pre-execution: master node
:post-execution: master node, primary and secondary nodes
-OP_INSTANCE_REPLACE_DISKS
-+++++++++++++++++++++++++
-
-Replace an instance's disks.
-
-:directory: mirror-replace
-:env. vars: MODE, NEW_SECONDARY, OLD_SECONDARY
-:pre-execution: master node, primary and secondary nodes
-:post-execution: master node, primary and secondary nodes
-
OP_INSTANCE_GROW_DISK
+++++++++++++++++++++
:pre-execution: master node
:post-execution: master node
-:pyeval:`constants.FAKE_OP_MASTER_TURNUP`
-+++++++++++++++++++++++++++++++++++++++++
+Virtual operation :pyeval:`constants.FAKE_OP_MASTER_TURNUP`
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Called when the master IP is activated.
+This doesn't correspond to an actual op-code, but it is 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`
-+++++++++++++++++++++++++++++++++++++++++++
+Virtual operation :pyeval:`constants.FAKE_OP_MASTER_TURNDOWN`
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Called when the master IP is deactivated.
+This doesn't correspond to an actual op-code, but it is called when the
+master IP is deactivated.
:directory: master-ip-turndown
:env. vars: MASTER_NETDEV, MASTER_IP, MASTER_NETMASK, CLUSTER_IP_VERSION