Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cs_order fails with pcs provider because of score parameter #485

Closed
efoft opened this issue May 11, 2020 · 2 comments · May be fixed by #487
Closed

cs_order fails with pcs provider because of score parameter #485

efoft opened this issue May 11, 2020 · 2 comments · May be fixed by #487

Comments

@efoft
Copy link

efoft commented May 11, 2020

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: puppet-agent-6.15.0-1.el7.x86_64
  • Ruby: ruby 2.0.0p648 (2015-12-16) [x86_64-linux]
  • Distribution: CentOS 7.7, 7.8
  • Module version: master

How to reproduce (e.g Puppet code you use)

cs_order { 'drbd_before_fs':
    first  => 'ms_drbd:promote',
    second => 'drbd_mount:start',
    cib => 'puppet'
}

What are you seeing

Error: /Stage[main]/Profile::Ha::Nfs/Cs_order[drbd_before_fs]: Could not evaluate: Execution of '/usr/sbin/pcs constraint order promote ms_drbd then start drbd_mount INFINITY kind=Mandatory id=drbd_before_fs symmetrical=true -f /opt/puppetlabs/puppet/cache/shadow.puppet' returned 1: Error: missing value of 'INFINITY' option

What behaviour did you expect instead

Proper creation of cluster resources order without error.

Output log

Any additional information you'd like to impart

This errorneous INFINITY word in produced pcs command comes from the score parameter:

lib/puppet/type/cs_order.rb:

newproperty(:score) do
    desc "The priority of the this ordered grouping.  Primitives can be a part
      of multiple order groups and so there is a way to control which
      primitives get priority when forcing the order of state changes on
      other primitives.  This value can be an integer but is often defined
      as the string INFINITY."

    defaultto 'INFINITY'
  end

lib/puppet/provider/cs_order/pcs.rb:

score = if items['score']
                  items['score']
                else
                  'INFINITY'
                end

Actually neither pacemaker 1.1 nor 2.0 currently have score parameter for order constraints.
https://clusterlabs.org/pacemaker/doc/en-US/Pacemaker/1.1/html-single/Pacemaker_Explained/#idm140583457263504
https://clusterlabs.org/pacemaker/doc/en-US/Pacemaker/2.0/html-single/Pacemaker_Explained/#idm47160732931568

Seems that score was completely replaced with kind feature some time ago.

Need to update the type and provider code to reflect current pcs syntax.

@efoft efoft changed the title cs_order fails with pcs provider because of score parameters cs_order fails with pcs provider because of score parameter May 11, 2020
rstuart-indue added a commit to rstuart-indue/puppet-corosync that referenced this issue May 31, 2020
@zpeschke
Copy link

The schema for an order constraint indicates that either score or kind parameter can be passed in, but not both. https://github.com/ClusterLabs/pacemaker/blob/master/xml/constraints-3.5.rng#L155-L160

The problem is that this resource sets a default to both values.

@zpeschke
Copy link

zpeschke commented Dec 21, 2020

Looks like this was fixed here: #450

@kenyon kenyon closed this as completed Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants