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 2003068

Summary: [RFE] Provide add/remove syntax for command `pcs stonith update-scsi-devices` [rhel-8.6.0]
Product: Red Hat Enterprise Linux 8 Reporter: RHEL Program Management Team <pgm-rhel-tools>
Component: pcsAssignee: Miroslav Lisik <mlisik>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: high Docs Contact:
Priority: high    
Version: 8.5CC: cluster-maint, idevat, kmalyjur, lmiksik, mlisik, mmazoure, mpospisi, nhostako, omular, sbradley, tojeline
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: 8.6Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.10.11-1.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: 1992668 Environment:
Last Closed: 2022-05-10 14:50:48 UTC Type: ---
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: 1992668    
Bug Blocks:    
Attachments:
Description Flags
proposed fix + tests none

Comment 1 Miroslav Lisik 2021-09-24 14:16:47 UTC
Created attachment 1825906 [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 4 Miroslav Lisik 2021-11-02 09:24:19 UTC
DevTestResults:

[root@r8-node-01 ~]# rpm -q pcs
pcs-0.10.11-1.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=0x0, 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 ~]# journalctl -f -n0
-- Logs begin at Tue 2021-10-26 10:49:32 CEST. --
Oct 27 12:22:14 r8-node-01 kernel:  sdb: sdb1
Oct 27 12:22:14 r8-node-01 kernel:  sda: sda1
Oct 27 12:22:14 r8-node-01 pacemaker-fenced[11058]:  notice: Added 'fence-scsi' to device list (1 active device)
Oct 27 12:22:14 r8-node-01 pacemaker-controld[11062]:  notice: State transition S_IDLE -> S_POLICY_ENGINE
Oct 27 12:22:14 r8-node-01 pacemaker-schedulerd[11061]:  notice: Calculated transition 4, saving inputs in /var/lib/pacemaker/pengine/pe-input-819.bz2
Oct 27 12:22:14 r8-node-01 pacemaker-controld[11062]:  notice: Transition 4 (Complete=0, Pending=0, Fired=0, Skipped=0, Incomplete=0, Source=/var/lib/pacemaker/pengine/pe-input-819.bz2): Complete
Oct 27 12:22:14 r8-node-01 pacemaker-controld[11062]:  notice: State transition S_TRANSITION_ENGINE -> S_IDLE

[root@r8-node-02 ~]# journalctl -f -n0
-- Logs begin at Tue 2021-10-26 10:49:29 CEST. --
Oct 27 12:22:14 r8-node-02 kernel:  sdb: sdb1
Oct 27 12:22:14 r8-node-02 kernel:  sda: sda1
Oct 27 12:22:14 r8-node-02 pacemaker-fenced[6045]:  notice: Added 'fence-scsi' to device list (1 active device)

[root@r8-node-03 ~]# journalctl -f -n0
-- Logs begin at Tue 2021-10-26 10:49:26 CEST. --
Oct 27 12:22:14 r8-node-03 kernel:  sdb: sdb1
Oct 27 12:22:14 r8-node-03 kernel:  sda: sda1
Oct 27 12:22:14 r8-node-03 pacemaker-fenced[10780]:  notice: Added 'fence-scsi' to device list (1 active device)

No resources were restarted.

Comment 16 errata-xmlrpc 2022-05-10 14:50:48 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 (pcs 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/RHEA-2022:1978