diff --git a/doc/Pacemaker_Explained/en-US/Author_Group.xml b/doc/Pacemaker_Explained/en-US/Author_Group.xml index ce639caf4c..74ddf959ff 100644 --- a/doc/Pacemaker_Explained/en-US/Author_Group.xml +++ b/doc/Pacemaker_Explained/en-US/Author_Group.xml @@ -1,44 +1,53 @@ AndrewBeekhof Red Hat Primary author andrew@beekhof.net PhilippMarek LINBit Style and formatting updates. Indexing. philipp.marek@linbit.com TanjaRoth SUSE Utilization chapter + Resource Templates chapter Multi-Site Clusters chapter troth@suse.com LarsMarowsky-Bree SUSE Multi-Site Clusters chapter lmb@suse.com YanGao SUSE Utilization chapter + Resource Templates chapter Multi-Site Clusters chapter ygao@suse.com ThomasSchraitle SUSE Utilization chapter + Resource Templates chapter Multi-Site Clusters chapter toms@suse.com + + DejanMuhamedagic + SUSE + Resource Templates chapter + dmuhamedagic@suse.com + diff --git a/doc/Pacemaker_Explained/en-US/Ch-Resource-Templates.txt b/doc/Pacemaker_Explained/en-US/Ch-Resource-Templates.txt new file mode 100644 index 0000000000..ccc99d7719 --- /dev/null +++ b/doc/Pacemaker_Explained/en-US/Ch-Resource-Templates.txt @@ -0,0 +1,222 @@ += Resource Templates = + +== Abstract == + +If you want to create lots of resources with similar configurations, defining a +resource template simplifies the task. Once defined, it can be referenced in +primitives or in certain types of constraints. + + +== Configuring Resources with Templates == + +The primitives referencing the template will inherit all meta +attributes, instance attributes, utilization attributes and operations defined +in the template. And you can define specific attributes and operations for any +of the primitives. If any of these are defined in both the template and the +primitive, the values defined in the primitive will take precedence over the +ones defined in the template. + +Hence, resource templates help to reduce the amount of configuration work. +If any changes are needed, they can be done to the template definition and +will take effect globally in all resource definitions referencing that +template. + +Resource templates have a similar syntax like primitives. For example: + +[source,XML] +---- + +---- + +Once you defined the new resource template, you can use it in primitives: + +[source,XML] +---- + + + + + + +---- + +The new primitive `vm1` is going to inherit everything from the `vm-template`. For +example, the equivalent of the above two would be: + +[source,XML] +---- + + + + + + + + + + + + + + + + +---- + +If you want to overwrite some attributes or operations, add them to the +particular primitive's definition. + +For instance, the following new primitive `vm2` has special +attribute values. Its `monitor` operation has a longer `timeout` and `interval`, and +the primitive has an additional `stop` operation. + +[source,XML] +---- + + + + + + + + + + + + + + + + +---- + +The following command shows the resulting definition of a resource: + +[source,Bash] +---- +# crm_resource --query-xml --resource vm2 +---- + +The following command shows its raw definition in cib: + +[source,Bash] +---- +# crm_resource --query-xml-raw --resource vm2 +---- + +== Referencing Templates in Constraints == + +A resource template can be referenced in the following types of constraints: + +- `order` constraints +- `colocation` constraints, +- `rsc_ticket` constraints (for multi-site clusters). + +Resource templates referenced in constraints stand for all primitives which are +derived from that template. This means, the constraint applies to all primitive +resources referencing the resource template. Referencing resource templates in +constraints is an alternative to resource sets and can simplify the cluster +configuration considerably. + +For example: + +[source,XML] +---- + +---- + +is the equivalent of the following constraint configuration: + +[source,XML] +---- + + + + + + + + + +---- + +[NOTE] +====== +In a colocation constraint, only one template may be referenced from either +`rsc` or `with-rsc`, and the other reference must be a regular resource. +====== + +Resource templates can also be referenced in resource sets. + +For example: + +[source,XML] +---- + + + + + + + +---- + +is the equivalent of the following constraint configuration: + +[source,XML] +---- + + + + + + + + +---- + +If the resources referencing the template can run in parallel: + +[source,XML] +---- + + + + + + + + + + + +---- + +is the equivalent of the following constraint configuration: + +[source,XML] +---- + + + + + + + + + + + + +---- diff --git a/doc/Pacemaker_Explained/en-US/Pacemaker_Explained.xml b/doc/Pacemaker_Explained/en-US/Pacemaker_Explained.xml index 9c3009dc55..54662d8879 100644 --- a/doc/Pacemaker_Explained/en-US/Pacemaker_Explained.xml +++ b/doc/Pacemaker_Explained/en-US/Pacemaker_Explained.xml @@ -1,50 +1,51 @@ Receiving Notification for Cluster Events
Configuring Email Notifications
Configuring SNMP Notifications
+ Further Reading Project Website Project Documentation A comprehensive guide to cluster commands has been written by Novell Heartbeat configuration: Corosync Configuration: