X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/035a77831e0796438f61718fd200566d400daba9..e23881ed3d3f030cc74fc0bd7d986918e6e6911d:/doc/hooks.rst diff --git a/doc/hooks.rst b/doc/hooks.rst index 0224c8b..5d8bbc2 100644 --- a/doc/hooks.rst +++ b/doc/hooks.rst @@ -128,8 +128,9 @@ Adds a node to the cluster. OP_REMOVE_NODE ++++++++++++++ -Removes a node from the cluster. On the removed node the hooks are called -during the execution of the operation and not after its completion. +Removes a node from the cluster. On the removed node the hooks are +called during the execution of the operation and not after its +completion. :directory: node-remove :env. vars: NODE_NAME @@ -156,6 +157,62 @@ Relocate secondary instances from a node. :pre-execution: master node, target node :post-execution: master node, target node +OP_NODE_MIGRATE +++++++++++++++++ + +Relocate secondary instances from a node. + +:directory: node-migrate +:env. vars: NODE_NAME +:pre-execution: master node +:post-execution: master node + + +Node group operations +~~~~~~~~~~~~~~~~~~~~~ + +OP_ADD_GROUP +++++++++++++ + +Adds a node group to the cluster. + +:directory: group-add +:env. vars: GROUP_NAME +:pre-execution: master node +:post-execution: master node + +OP_GROUP_SET_PARAMS ++++++++++++++++++++ + +Changes a node group's parameters. + +:directory: group-modify +:env. vars: GROUP_NAME, NEW_ALLOC_POLICY +:pre-execution: master node +:post-execution: master node + +OP_REMOVE_GROUP ++++++++++++++++ + +Removes a node group from the cluster. Since the node group must be +empty for removal to succeed, the concept of "nodes in the group" does +not exist, and the hook is only executed in the master node. + +:directory: group-remove +:env. vars: GROUP_NAME +:pre-execution: master node +:post-execution: master node + +OP_RENAME_GROUP ++++++++++++++++ + +Renames a node group. + +:directory: group-rename +:env. vars: OLD_NAME, NEW_NAME +:pre-execution: master node and all nodes in the group +:post-execution: master node and all nodes in the group + Instance operations ~~~~~~~~~~~~~~~~~~~ @@ -196,7 +253,6 @@ OP_BACKUP_EXPORT Exports the instance. - :directory: instance-export :env. vars: EXPORT_NODE, EXPORT_DO_SHUTDOWN :pre-execution: master node, primary and secondary nodes @@ -208,7 +264,7 @@ OP_INSTANCE_START Starts an instance. :directory: instance-start -:env. vars: INSTANCE_NAME, INSTANCE_PRIMARY, INSTANCE_SECONDARIES, FORCE +:env. vars: FORCE :pre-execution: master node, primary and secondary nodes :post-execution: master node, primary and secondary nodes @@ -217,8 +273,8 @@ OP_INSTANCE_SHUTDOWN Stops an instance. -:directory: instance-shutdown -:env. vars: INSTANCE_NAME, INSTANCE_PRIMARY, INSTANCE_SECONDARIES +:directory: instance-stop +:env. vars: only the standard instance vars :pre-execution: master node, primary and secondary nodes :post-execution: master node, primary and secondary nodes @@ -238,29 +294,33 @@ OP_INSTANCE_MODIFY Modifies the instance parameters. :directory: instance-modify -:env. vars: INSTANCE_NAME, MEM_SIZE, VCPUS, INSTANCE_IP +:env. vars: only the standard instance vars :pre-execution: master node, primary and secondary nodes :post-execution: master node, primary and secondary nodes OP_INSTANCE_FAILOVER ++++++++++++++++++++ -Failovers an instance. +Failovers an instance. In the post phase INSTANCE_PRIMARY and +INSTANCE_SECONDARIES refer to the nodes that were repectively primary +and secondary before failover. :directory: instance-failover -:env. vars: IGNORE_CONSISTENCY +:env. vars: IGNORE_CONSISTENCY, OLD_SECONDARY, OLD_PRIMARY, NEW_SECONDARY, NEW_PRIMARY :pre-execution: master node, secondary node -:post-execution: master node, secondary node +:post-execution: master node, primary and secondary nodes OP_INSTANCE_MIGRATE ++++++++++++++++++++ -Migrates an instance. +Migrates an instance. In the post phase INSTANCE_PRIMARY and +INSTANCE_SECONDARIES refer to the nodes that were repectively primary +and secondary before migration. -:directory: instance-failover -:env. vars: INSTANCE_MIGRATE_LIVE, INSTANCE_MIGRATE_CLEANUP +:directory: instance-migrate +:env. vars: MIGRATE_LIVE, MIGRATE_CLEANUP, OLD_SECONDARY, OLD_PRIMARY, NEW_SECONDARY, NEW_PRIMARY :pre-execution: master node, secondary node -:post-execution: master node, secondary node +:post-execution: master node, primary and secondary nodes OP_INSTANCE_REMOVE @@ -269,9 +329,9 @@ OP_INSTANCE_REMOVE Remove an instance. :directory: instance-remove -:env. vars: INSTANCE_NAME, INSTANCE_PRIMARY, INSTANCE_SECONDARIES +:env. vars: only the standard instance vars :pre-execution: master node -:post-execution: master node +:post-execution: master node, primary and secondary nodes OP_INSTANCE_REPLACE_DISKS +++++++++++++++++++++++++ @@ -290,8 +350,8 @@ Grows the disk of an instance. :directory: disk-grow :env. vars: DISK, AMOUNT -:pre-execution: master node, primary node -:post-execution: master node, primary node +:pre-execution: master node, primary and secondary nodes +:post-execution: master node, primary and secondary nodes OP_INSTANCE_RENAME ++++++++++++++++++ @@ -303,19 +363,62 @@ Renames an instance. :pre-execution: master node, primary and secondary nodes :post-execution: master node, primary and secondary nodes +OP_INSTANCE_MOVE +++++++++++++++++ + +Move an instance by data-copying. + +:directory: instance-move +:env. vars: TARGET_NODE +:pre-execution: master node, primary and target nodes +:post-execution: master node, primary and target nodes + +OP_INSTANCE_RECREATE_DISKS +++++++++++++++++++++++++++ + +Recreate an instance's missing disks. + +:directory: instance-recreate-disks +:env. vars: only the standard instance vars +:pre-execution: master node, primary and secondary nodes +:post-execution: master node, primary and secondary nodes + +OP_INSTANCE_REPLACE_DISKS ++++++++++++++++++++++++++ + +Replace the disks of an instance. + +:directory: mirrors-replace +:env. vars: MODE, NEW_SECONDARY, OLD_SECONDARY +:pre-execution: master node, primary and new secondary nodes +:post-execution: master node, primary and new secondary nodes + + Cluster operations ~~~~~~~~~~~~~~~~~~ OP_POST_INIT_CLUSTER ++++++++++++++++++++ -This hook is called via a special "empty" LU right after cluster initialization. +This hook is called via a special "empty" LU right after cluster +initialization. :directory: cluster-init :env. vars: none :pre-execution: none :post-execution: master node +OP_DESTROY_CLUSTER +++++++++++++++++++ + +The post phase of this hook is called during the execution of destroy +operation and not after its completion. + +:directory: cluster-destroy +:env. vars: none +:pre-execution: none +:post-execution: master node + OP_CLUSTER_VERIFY +++++++++++++++++ @@ -435,10 +538,16 @@ INSTANCE_OS_TYPE The name of the instance OS. INSTANCE_PRIMARY - The name of the node which is the primary for the instance. + The name of the node which is the primary for the instance. Note that + for migrations/failovers, you shouldn't rely on this variable since + the nodes change during the exectution, but on the + OLD_PRIMARY/NEW_PRIMARY values. INSTANCE_SECONDARIES - Space-separated list of secondary nodes for the instance. + Space-separated list of secondary nodes for the instance. Note that + for migrations/failovers, you shouldn't rely on this variable since + the nodes change during the exectution, but on the + OLD_SECONDARY/NEW_SECONDARY values. INSTANCE_MEMORY The memory size (in MiBs) of the instance. @@ -481,13 +590,19 @@ SRC_NODE, SRC_PATH, SRC_IMAGE NEW_SECONDARY The name of the node on which the new mirror component is being - added. This can be the name of the current secondary, if the new - mirror is on the same secondary. + added (for replace disk). This can be the name of the current + secondary, if the new mirror is on the same secondary. For + migrations/failovers, this is the old primary node. OLD_SECONDARY - The name of the old secondary in the replace-disks command Note that + The name of the old secondary in the replace-disks command. Note that this can be equal to the new secondary if the secondary node hasn't - actually changed. + actually changed. For migrations/failovers, this is the new primary + node. + +OLD_PRIMARY, NEW_PRIMARY + For migrations/failovers, the old and respectively new primary + nodes. These two mirror the NEW_SECONDARY/OLD_SECONDARY variables EXPORT_NODE The node on which the exported image of the instance was done. @@ -536,3 +651,9 @@ script:: GANETI_OBJECT_TYPE=INSTANCE GANETI_OP_CODE=OP_INSTANCE_STARTUP GANETI_OP_TARGET=instance2.example.com + +.. vim: set textwidth=72 : +.. Local Variables: +.. mode: rst +.. fill-column: 72 +.. End: