Re: [ClusterLabs] Coming in 1.1.14: Fencing topology based on node attribute

2015-09-24 Thread Ken Gaillot
An update: as of upstream commit 8940fca, the syntax has been tweaked as
Beekhof mentioned. To create a fencing topology on a node attribute, you
would use the following for the same example:

   
  
   

This avoids any additional restrictions or difficulties related to what
characters can be where.

Combined with the existing methods, this means a topology can be
targeted in one of these ways:

  By node name: target="node1"
  By regular expression matching node names: target-pattern="pcmk.*"
  By node attribute: target-attribute="rack" target-value="1"

On 09/09/2015 07:20 AM, Andrew Beekhof wrote:
> 
>> On 9 Sep 2015, at 7:45 pm, Kristoffer Grönlund  wrote:
>>
>> Hi,
>>
>> Ken Gaillot  writes:
>>
>>> Pacemaker's upstream master branch has a new feature that will be part
>>> of the eventual 1.1.14 release.
>>>
>>> Fencing topology is used when a node requires multiple fencing devices
>>> (in combination or as fallbacks). Currently, topologies must be
>>> specified by node name (or a regular expression matching node names).
>>>
>>> The new feature allows topologies to specified by node attribute.
>>
>> Sounds like a really useful feature. :) I have implemented initial
>> support for this syntax in crmsh,
> 
> word of warning, i’m in the process of changing it to avoid overloading the 
> ‘target’ attribute and exposing quoting issues stemming from people’s use of 
> ‘='
> 
>https://github.com/beekhof/pacemaker/commit/ea4fc1c
> 
> 
> 
>> so this will work fine in the next
>> version of crmsh.
>>
>> Examples of crmsh syntax below:
>>
>>> Previously, if node1 was in rack #1, you'd have to register a fencing
>>> topology by its name, which at the XML level would look like:
>>>
>>>   
>>>  >>  devices="apc01,apc02"/>
>>>   
>>>
>>
>> crm cfg fencing-topology node1: apc01,apc02
>>
>>>
>>> With the new feature, you could instead register a topology for all
>>> hosts that have a node attribute "rack" whose value is "1":
>>>
>>>   
>>>  >>  devices="apc01,apc02"/>
>>>   
>>>
>>
>> crm cfg fencing-topology rack=1: apc01,apc02
>>
>>>
>>> You would assign that attribute to all nodes in that rack, e.g.:
>>>
>>>   crm_attribute --type nodes --node node1 --name rack --update 1
>>>
>>
>> crm node attr node1 set rack 1
>>
>>>
>>> The syntax accepts either '=' or ':' as the separator for the name/value
>>> pair, so target="rack:1" would work in the XML as well.
>>
>> crm cfg fencing-topology rack:1: apc01,apc02
>>
>> (admittedly perhaps not as clean as using '=', but it works)
>>
>> Cheers,
>> Kristoffer


___
Users mailing list: Users@clusterlabs.org
http://clusterlabs.org/mailman/listinfo/users

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org


Re: [ClusterLabs] Coming in 1.1.14: Fencing topology based on node attribute

2015-09-09 Thread Kristoffer Grönlund
Hi,

Ken Gaillot  writes:

> Pacemaker's upstream master branch has a new feature that will be part
> of the eventual 1.1.14 release.
>
> Fencing topology is used when a node requires multiple fencing devices
> (in combination or as fallbacks). Currently, topologies must be
> specified by node name (or a regular expression matching node names).
>
> The new feature allows topologies to specified by node attribute.

Sounds like a really useful feature. :) I have implemented initial
support for this syntax in crmsh, so this will work fine in the next
version of crmsh.

Examples of crmsh syntax below:

> Previously, if node1 was in rack #1, you'd have to register a fencing
> topology by its name, which at the XML level would look like:
>
>
>  devices="apc01,apc02"/>
>
>

crm cfg fencing-topology node1: apc01,apc02

>
> With the new feature, you could instead register a topology for all
> hosts that have a node attribute "rack" whose value is "1":
>
>
>  devices="apc01,apc02"/>
>
>

crm cfg fencing-topology rack=1: apc01,apc02

>
> You would assign that attribute to all nodes in that rack, e.g.:
>
>crm_attribute --type nodes --node node1 --name rack --update 1
>

crm node attr node1 set rack 1

>
> The syntax accepts either '=' or ':' as the separator for the name/value
> pair, so target="rack:1" would work in the XML as well.

crm cfg fencing-topology rack:1: apc01,apc02

(admittedly perhaps not as clean as using '=', but it works)

Cheers,
Kristoffer

> -- 
> Ken Gaillot 
>
> ___
> Users mailing list: Users@clusterlabs.org
> http://clusterlabs.org/mailman/listinfo/users
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org
>

-- 
// Kristoffer Grönlund
// kgronl...@suse.com

___
Users mailing list: Users@clusterlabs.org
http://clusterlabs.org/mailman/listinfo/users

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org


Re: [ClusterLabs] Coming in 1.1.14: Fencing topology based on node attribute

2015-09-09 Thread Andrew Beekhof

> On 9 Sep 2015, at 7:45 pm, Kristoffer Grönlund  wrote:
> 
> Hi,
> 
> Ken Gaillot  writes:
> 
>> Pacemaker's upstream master branch has a new feature that will be part
>> of the eventual 1.1.14 release.
>> 
>> Fencing topology is used when a node requires multiple fencing devices
>> (in combination or as fallbacks). Currently, topologies must be
>> specified by node name (or a regular expression matching node names).
>> 
>> The new feature allows topologies to specified by node attribute.
> 
> Sounds like a really useful feature. :) I have implemented initial
> support for this syntax in crmsh,

word of warning, i’m in the process of changing it to avoid overloading the 
‘target’ attribute and exposing quoting issues stemming from people’s use of ‘='

   https://github.com/beekhof/pacemaker/commit/ea4fc1c



> so this will work fine in the next
> version of crmsh.
> 
> Examples of crmsh syntax below:
> 
>> Previously, if node1 was in rack #1, you'd have to register a fencing
>> topology by its name, which at the XML level would look like:
>> 
>>   
>>  >  devices="apc01,apc02"/>
>>   
>> 
> 
> crm cfg fencing-topology node1: apc01,apc02
> 
>> 
>> With the new feature, you could instead register a topology for all
>> hosts that have a node attribute "rack" whose value is "1":
>> 
>>   
>>  >  devices="apc01,apc02"/>
>>   
>> 
> 
> crm cfg fencing-topology rack=1: apc01,apc02
> 
>> 
>> You would assign that attribute to all nodes in that rack, e.g.:
>> 
>>   crm_attribute --type nodes --node node1 --name rack --update 1
>> 
> 
> crm node attr node1 set rack 1
> 
>> 
>> The syntax accepts either '=' or ':' as the separator for the name/value
>> pair, so target="rack:1" would work in the XML as well.
> 
> crm cfg fencing-topology rack:1: apc01,apc02
> 
> (admittedly perhaps not as clean as using '=', but it works)
> 
> Cheers,
> Kristoffer
> 
>> -- 
>> Ken Gaillot 
>> 
>> ___
>> Users mailing list: Users@clusterlabs.org
>> http://clusterlabs.org/mailman/listinfo/users
>> 
>> Project Home: http://www.clusterlabs.org
>> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
>> Bugs: http://bugs.clusterlabs.org
>> 
> 
> -- 
> // Kristoffer Grönlund
> // kgronl...@suse.com
> 
> ___
> Users mailing list: Users@clusterlabs.org
> http://clusterlabs.org/mailman/listinfo/users
> 
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org


___
Users mailing list: Users@clusterlabs.org
http://clusterlabs.org/mailman/listinfo/users

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org


Re: [ClusterLabs] Coming in 1.1.14: Fencing topology based on node attribute

2015-09-08 Thread Digimer
On 08/09/15 11:23 AM, Ken Gaillot wrote:
> Pacemaker's upstream master branch has a new feature that will be part
> of the eventual 1.1.14 release.
> 
> Fencing topology is used when a node requires multiple fencing devices
> (in combination or as fallbacks). Currently, topologies must be
> specified by node name (or a regular expression matching node names).
> 
> The new feature allows topologies to specified by node attribute.
> 
> For example, imagine a data center where all devices in rack #1 use
> fence devices apc01 and apc02, while all devices in rack #2 use fence
> devices apc03 and apc04.
> 
> Previously, if node1 was in rack #1, you'd have to register a fencing
> topology by its name, which at the XML level would look like:
> 
>
>  devices="apc01,apc02"/>
>
> 
> 
> With the new feature, you could instead register a topology for all
> hosts that have a node attribute "rack" whose value is "1":
> 
>
>  devices="apc01,apc02"/>
>
> 
> 
> You would assign that attribute to all nodes in that rack, e.g.:
> 
>crm_attribute --type nodes --node node1 --name rack --update 1
> 
> 
> If a server is moved to a different rack, simply update the value of its
> attribute and it will use that rack's fencing configuration. Or if a
> rack gets a new fencing device, you only have to update the fencing
> configuration once rather than for every node in the rack.
> 
> The syntax accepts either '=' or ':' as the separator for the name/value
> pair, so target="rack:1" would work in the XML as well.

Holy crap that is awesome! :D

-- 
Digimer
Papers and Projects: https://alteeve.ca/w/
What if the cure for cancer is trapped in the mind of a person without
access to education?

___
Users mailing list: Users@clusterlabs.org
http://clusterlabs.org/mailman/listinfo/users

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org