diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 13138a543af1883b479afda61bad645d9ef2ca43..38c36c855b48419afa4d9d6036443d59ceaa2e2e 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -1039,7 +1039,7 @@ class LUSetClusterParams(LogicalUnit): """Check prerequisites. This checks whether the given params don't conflict and - if the given volume group is valid. + if the given volume group is valid. """ if not self.op.vg_name: @@ -1832,6 +1832,12 @@ class LURunClusterCommand(NoHooksLU): """Run a command on some nodes. """ + # put the master at the end of the nodes list + master_node = self.sstore.GetMasterNode() + if master_node in self.nodes: + self.nodes.remove(master_node) + self.nodes.append(master_node) + data = [] for node in self.nodes: result = self.ssh.Run(node, "root", self.op.command) diff --git a/man/gnt-cluster.sgml b/man/gnt-cluster.sgml index 4c55449976cedbbe1ae3cd255235bbb095d8668b..947237570e522c66f1d186eb69485765554645d6 100644 --- a/man/gnt-cluster.sgml +++ b/man/gnt-cluster.sgml @@ -101,6 +101,21 @@ </para> + <para> + The command is executed serially on the selected nodes. If the + master node is present in the list, the command will be + executed last on the master. Regarding the other nodes, the + execution order is somewhat alphabetic (it's smarter so that + node2.example.com will be earlier than node10.example.com but + after node1.example.com). + </para> + + <para> + So given the node names node1, node2, node3, node10, node11, + with node3 being the master, the order will be: node1, node2, + node10, node11, node3. + </para> + <para> The command is constructed by concatenating all other command line arguments. For example, to list the contents of the