Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1992668

Summary: [RFE] Provide add/remove syntax for command `pcs stonith update-scsi-devices`
Product: Red Hat Enterprise Linux 8 Reporter: Miroslav Lisik <mlisik>
Component: pcsAssignee: Miroslav Lisik <mlisik>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: high Docs Contact:
Priority: high    
Version: 8.5CC: cfeist, cluster-maint, idevat, kmalyjur, lmiksik, mlisik, mmazoure, mpospisi, nhostako, omular, sbradley, slevine, tojeline
Target Milestone: betaKeywords: FutureFeature, Triaged
Target Release: 8.5Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.10.10-3.el8 Doc Type: Enhancement
Doc Text:
Feature: Provide add/remove syntax for command `pcs stonith update-scsi-devices` Reason: The add/remove syntax of the command is more comfortable for a user because it does not need to specify currently configured devices. Result: Command `pcs stonith update-scsi-devices` now supports add/remove syntax for updating fence scsi devices.
Story Points: ---
Clone Of:
: 2003068 (view as bug list) Environment:
Last Closed: 2021-11-09 17:34:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2003068    
Attachments:
Description Flags
proposed fix + tests none

Description Miroslav Lisik 2021-08-11 14:07:52 UTC
Description of problem:

Currently, command `pcs stonith update-scsi-devices' supports only keyword 'set', which needs to specify all configured SCSI devices + new devices being added in order to add new scsi devices. For devices removal it needs to specify all devices that should remain in a configuration.

Keywords 'add/remove' won't need to specify currently configured devices.

Comment 8 Miroslav Lisik 2021-09-10 09:12:29 UTC
Created attachment 1822045 [details]
proposed fix + tests

Updated command:
* pcs stonith update-scsi-devices

Test:
* setup a cluster with a fence scsi stonith resource
* setup resources running on each node
* update fence scsi devices using command `pcs stonith update-scsi-devices add <device>... remove <device>...
* check that resources were not restarted after update of devices

Comment 9 Miroslav Lisik 2021-09-10 11:49:33 UTC
DevTestResults:

[root@r8-node-01 ~]# rpm -q pcs
pcs-0.10.10-3.el8.x86_64

export disk1=/dev/disk/by-id/scsi-360014052bc36324cf7d4a709a959340b
export disk2=/dev/disk/by-id/scsi-3600140547721f8ee2774aa8bac6d8ebe

[root@r8-node-01 ~]# pcs stonith
  * fence-scsi  (stonith:fence_scsi):    Started r8-node-01
[root@r8-node-01 ~]# pcs stonith config
 Resource: fence-scsi (class=stonith type=fence_scsi)
  Attributes: devices=/dev/disk/by-id/scsi-360014052bc36324cf7d4a709a959340b pcmk_host_check=static-list pcmk_host_list="r8-node-01 r8-node-02 r8-node-03" pcmk_reboot_action=off
  Meta Attrs: provides=unfencing
  Operations: monitor interval=60s (fence-scsi-monitor-interval-60s)
[root@r8-node-01 ~]# pcs resource 
  * d-01        (ocf::pacemaker:Dummy):  Started r8-node-02
  * d-02        (ocf::pacemaker:Dummy):  Started r8-node-03
  * d-03        (ocf::pacemaker:Dummy):  Started r8-node-01
  * d-04        (ocf::pacemaker:Dummy):  Started r8-node-02
  * d-05        (ocf::pacemaker:Dummy):  Started r8-node-03
  * d-06        (ocf::pacemaker:Dummy):  Started r8-node-01
[root@r8-node-01 ~]# sg_persist -n -i -k -d $disk2
  PR generation=0x6, there are NO registered reservation keys

[root@r8-node-01 ~]# pcs stonith update-scsi-devices fence-scsi add $disk2 remove $disk1
[root@r8-node-01 ~]# echo $?
0
[root@r8-node-01 ~]# pcs stonith config
 Resource: fence-scsi (class=stonith type=fence_scsi)
  Attributes: devices=/dev/disk/by-id/scsi-3600140547721f8ee2774aa8bac6d8ebe pcmk_host_check=static-list pcmk_host_list="r8-node-01 r8-node-02 r8-node-03" pcmk_reboot_action=off
  Meta Attrs: provides=unfencing
  Operations: monitor interval=60s (fence-scsi-monitor-interval-60s)

Scsi devices have been updated.

[root@r8-node-01 ~]# tail -f /var/log/messages -n 0
Sep 10 12:20:13 r8-node-01 kernel: sda: sda1
Sep 10 12:20:13 r8-node-01 kernel: sda: sda1
Sep 10 12:20:13 r8-node-01 kernel: sd 6:0:0:0: reservation conflict
Sep 10 12:20:13 r8-node-01 pacemaker-controld[427444]: notice: State transition S_IDLE -> S_POLICY_ENGINE
Sep 10 12:20:13 r8-node-01 pacemaker-fenced[427440]: notice: Added 'fence-scsi' to device list (1 active device)
Sep 10 12:20:13 r8-node-01 pacemaker-schedulerd[427443]: notice: Calculated transition 9, saving inputs in /var/lib/pacemaker/pengine/pe-input-360.bz2
Sep 10 12:20:13 r8-node-01 pacemaker-controld[427444]: notice: Transition 9 (Complete=0, Pending=0, Fired=0, Skipped=0, Incomplete=0, Source=/var/lib/pacemaker/pengine/pe-input-360.bz2): Complete
Sep 10 12:20:13 r8-node-01 pacemaker-controld[427444]: notice: State transition S_TRANSITION_ENGINE -> S_IDLE

[root@r8-node-02 ~]# tail -f /var/log/messages -n 0
Sep 10 12:20:13 r8-node-02 kernel: sd 6:0:0:0: Parameters changed
Sep 10 12:20:13 r8-node-02 kernel: sda: sda1
Sep 10 12:20:13 r8-node-02 kernel: sda: sda1
Sep 10 12:20:13 r8-node-02 pacemaker-fenced[335575]: notice: Added 'fence-scsi' to device list (1 active device)

[root@r8-node-03 ~]# tail -f /var/log/messages -n 0
Sep 10 12:20:13 r8-node-03 kernel: sd 6:0:0:0: Parameters changed
Sep 10 12:20:13 r8-node-03 kernel: sda: sda1
Sep 10 12:20:13 r8-node-03 kernel: sda: sda1
Sep 10 12:20:13 r8-node-03 pacemaker-fenced[335926]: notice: Added 'fence-scsi' to device list (1 active device)

No resources were restarted.

Comment 14 Miroslav Lisik 2021-09-24 10:57:38 UTC
re-setting fixed in version to pcs-0.10.10-3.el8 nothing changed in this bz. I wrongly copied bz number to the commit message.

Comment 21 errata-xmlrpc 2021-11-09 17:34:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Low: pcs security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:4142