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

Provider pcs for cs_primitive generates a syntax error when updating a Master/Slave Resource #459

Closed
pdemonaco opened this issue Feb 20, 2019 · 0 comments · Fixed by #458 or #476
Closed

Comments

@pdemonaco
Copy link
Contributor

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5.5
  • Ruby: 2.4.4
  • Distribution: RedHat Enterprise Linux 7.5
  • Module version: 6.0.1

Cluster package versions

  • pcs: 0.9.162
  • corosync: 2.4.3
  • pacemaker: 1.1.18

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

The example below details the initialization of a the SAPInstance resource for a particular configuration that uses the master/slave 2-node topology. This code functions normally on the first apply, however, subsequent applies fail because the cs_primitive pcs provider generates a malformed command.

$scs_operations = [
  {
    'start' => {
      'interval' => '0s',
      'timeout'  => '180s',
    },
  },
  {
    'stop'  => {
      'interval' => '0s',
      'timeout'  => '240s',
    },
  },
  {
    'monitor' => {
      'interval' => '30s',
      'timeout'  => '60s',
    },
  },
  {
    'monitor' => {
      'interval' => '31s',
      'timeout'  => '60s',
      'role'     => 'Slave',
    },
  },
  {
    'monitor' => {
      'interval' => '29s',
      'timeout'  => '60s',
      'role'     => 'Master',
    },
  },
  {
    'promote' => {
      'interval' => '0s',
      'timeout'  => '320s',
    },
  },
  {
    'demote' => {
      'interval' => '0s',
      'timeout'  => '320s',
    },
  },
  {
    'methods' => {
      'interval' => '0s',
      'timeout'  => '320s',
    },
  },
]
$scs_ms_metadata = {
  'master-max' => '1',
  'clone-max'  => '2',
  'notify'     => true,
}
$scs_parameters = {
  'InstanceName'      => $scs_instname,
  'START_PROFILE'     => $scs_start_profile,
  'ERS_InstanceName'  => $ers_instname,
  'ERS_START_PROFILE' => $ers_start_profile,
}

cs_primitive { "prm_${sid}_SCS":
  primitive_class => 'ocf',
  primitive_type  => 'SAPInstance',
  provided_by     => 'heartbeat',
  cib             => $cib_name,
  promotable      => true, # Indicates this is a master/slave
  ms_metadata     => $scs_ms_metadata,
  parameters      => $scs_parameters,
  operations      => $scs_operations,
}

What are you seeing

This is the error generated on a subsequent apply by the pcs provider.

image

What behaviour did you expect instead

I expect it not to error. Based on my understanding of the command, the updated should include the name of the master resource, not the base.

The following command works without error:

/sbin/pcs resource update ms_prm_LP0_SCS meta clone-max=2 master-max=1 notify=true -f /opt/puppetlabs/puppet/cache/shadow.sap

Any additional information you'd like to impart

I believe simply removing the (@property_hash[:name]).to_s from the end of the array in the line below would correct this issue.

cmd = [command(:pcs), 'resource', 'update', "ms_#{@property_hash[:name]}", (@property_hash[:name]).to_s]

pdemonaco added a commit to pdemonaco/puppet-corosync that referenced this issue Feb 20, 2019
fixes voxpupuli#459

Removing the standard resource from the master update command allows
pcs resource update to function correctly.
pdemonaco added a commit to pdemonaco/puppet-corosync that referenced this issue Mar 2, 2019
fixes voxpupuli#459

Removing the standard resource from the master update command allows
pcs resource update to function correctly.
pdemonaco added a commit to pdemonaco/puppet-corosync that referenced this issue Jul 26, 2019
fixes voxpupuli#459

Removing the standard resource from the master update command allows
pcs resource update to function correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant