Bug 1254984 - Support resource name as an identifier in 'remote-node remove'
Support resource name as an identifier in 'remote-node remove'
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pcs (Show other bugs)
7.2
Unspecified Unspecified
low Severity low
: rc
: ---
Assigned To: Ivan Devat
cluster-qe@redhat.com
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-19 07:33 EDT by Radek Steiger
Modified: 2017-08-01 14:22 EDT (History)
5 users (show)

See Also:
Fixed In Version: pcs-0.9.158-2.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-01 14:22:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
proposed fix (part1) (388.08 KB, patch)
2017-05-25 04:55 EDT, Ivan Devat
no flags Details | Diff
proposed fix (part2) (130.59 KB, patch)
2017-05-25 04:56 EDT, Ivan Devat
no flags Details | Diff
proposed fix (part3) (266.66 KB, patch)
2017-05-25 04:56 EDT, Ivan Devat
no flags Details | Diff

  None (edit)
Description Radek Steiger 2015-08-19 07:33:24 EDT
> Description of problem:

So far the 'remote-node remove' expected a hostname to be specified. The only way to find out the hostname is to list resource meta attributes, so it might be more practical to be able to specify the target by resource name in addition to the hostname.

[root@virt-143 /]# pcs status|grep Online
Online: [ virt-142 virt-143 virt-144 ]
RemoteOnline: [ RemoteNode ]
...

[root@virt-142 pcs]# pcs resource show RemoteNode 
 Resource: RemoteNode (class=ocf provider=pacemaker type=remote)
  Attributes: server=virt-145 
  Meta Attrs: remote-node=virt-145 
  Operations: start interval=0s timeout=60 (RemoteNode-start-interval-0s)
              stop interval=0s timeout=60 (RemoteNode-stop-interval-0s)
              monitor interval=60s timeout=30 (RemoteNode-monitor-interval-60s)


> Version-Release number of selected component (if applicable):

pcs-0.9.143-2.el7.x86_64


> Actual results:

[root@virt-142 pcs]# pcs cluster remote-node remove RemoteNode
Error: unable to remove: cannot find remote-node 'RemoteNode'
[root@virt-142 pcs]# pcs cluster remote-node remove virt-145
[root@virt-142 pcs]#


> Expected results:

[root@virt-142 pcs]# pcs cluster remote-node remove RemoteNode
[root@virt-142 pcs]#
Comment 3 Ivan Devat 2017-05-25 04:55 EDT
Created attachment 1282160 [details]
proposed fix (part1)
Comment 4 Ivan Devat 2017-05-25 04:56 EDT
Created attachment 1282161 [details]
proposed fix (part2)
Comment 5 Ivan Devat 2017-05-25 04:56 EDT
Created attachment 1282162 [details]
proposed fix (part3)
Comment 6 Tomas Jelinek 2017-05-26 07:58:49 EDT
After fix:

[root@rh73-node1:~]# rpm -q pcs
pcs-0.9.158-2.el7.x86_64

> a remote node by its name:

[root@rh73-node1:~]# pcs cluster node add-remote rh73-node3 remote-node
Sending remote node configuration files to 'rh73-node3'
rh73-node3: successful distribution of the file 'pacemaker_remote authkey'
Requesting start of service pacemaker_remote on 'rh73-node3'
rh73-node3: successful run of 'pacemaker_remote enable'
rh73-node3: successful run of 'pacemaker_remote start'
[root@rh73-node1:~]# pcs status
Cluster name: rhel73
Stack: corosync
Current DC: rh73-node2 (version 1.1.16-9.el7-94ff4df) - partition with quorum
Last updated: Fri May 26 13:48:04 2017
Last change: Fri May 26 13:47:55 2017 by root via cibadmin on rh73-node1

3 nodes configured
5 resources configured

Online: [ rh73-node1 rh73-node2 ]
RemoteOnline: [ remote-node ]

Full list of resources:

 xvmNode1       (stonith:fence_xvm):    Started rh73-node2
 xvmNode2       (stonith:fence_xvm):    Started rh73-node1
 xvmNode3       (stonith:fence_xvm):    Started rh73-node2
 dummy  (ocf::pacemaker:Dummy): Started remote-node
 remote-node    (ocf::pacemaker:remote):        Started rh73-node1

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled
[root@rh73-node1:~]# pcs cluster node remove-remote remote-node              
Attempting to stop: remote-node...Stopped
Requesting stop of service pacemaker_remote on 'remote-node'
remote-node: successful run of 'pacemaker_remote disable'
remote-node: successful run of 'pacemaker_remote stop'
Requesting remove remote node files from 'remote-node'
remote-node: successful removal of the file 'pacemaker_remote authkey'
[root@rh73-node1:~]# pcs status
Cluster name: rhel73
Stack: corosync
Current DC: rh73-node2 (version 1.1.16-9.el7-94ff4df) - partition with quorum
Last updated: Fri May 26 13:48:51 2017
Last change: Fri May 26 13:48:45 2017 by root via cibadmin on rh73-node1

2 nodes configured
4 resources configured

Online: [ rh73-node1 rh73-node2 ]

Full list of resources:

 xvmNode1       (stonith:fence_xvm):    Started rh73-node2
 xvmNode2       (stonith:fence_xvm):    Started rh73-node1
 xvmNode3       (stonith:fence_xvm):    Started rh73-node2
 dummy  (ocf::pacemaker:Dummy): Started rh73-node1

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled

> a remote node by its host:

[root@rh73-node1:~]# pcs cluster node add-remote rh73-node3 remote-node
Sending remote node configuration files to 'rh73-node3'
rh73-node3: successful distribution of the file 'pacemaker_remote authkey'
Requesting start of service pacemaker_remote on 'rh73-node3'
rh73-node3: successful run of 'pacemaker_remote enable'
rh73-node3: successful run of 'pacemaker_remote start'
[root@rh73-node1:~]# pcs status
Cluster name: rhel73
Stack: corosync
Current DC: rh73-node2 (version 1.1.16-9.el7-94ff4df) - partition with quorum
Last updated: Fri May 26 13:49:10 2017
Last change: Fri May 26 13:48:59 2017 by root via cibadmin on rh73-node1

3 nodes configured
5 resources configured

Online: [ rh73-node1 rh73-node2 ]
RemoteOnline: [ remote-node ]

Full list of resources:

 xvmNode1       (stonith:fence_xvm):    Started rh73-node2
 xvmNode2       (stonith:fence_xvm):    Started rh73-node1
 xvmNode3       (stonith:fence_xvm):    Started rh73-node2
 dummy  (ocf::pacemaker:Dummy): Started remote-node
 remote-node    (ocf::pacemaker:remote):        Started rh73-node1

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled
[root@rh73-node1:~]# pcs cluster node remove-remote rh73-node3
Attempting to stop: remote-node...Stopped
Requesting stop of service pacemaker_remote on 'remote-node'
remote-node: successful run of 'pacemaker_remote disable'
remote-node: successful run of 'pacemaker_remote stop'
Requesting remove remote node files from 'remote-node'
remote-node: successful removal of the file 'pacemaker_remote authkey'
[root@rh73-node1:~]# pcs status
Cluster name: rhel73
Stack: corosync
Current DC: rh73-node2 (version 1.1.16-9.el7-94ff4df) - partition with quorum
Last updated: Fri May 26 13:49:46 2017
Last change: Fri May 26 13:49:33 2017 by root via cibadmin on rh73-node1

2 nodes configured
4 resources configured

Online: [ rh73-node1 rh73-node2 ]

Full list of resources:

 xvmNode1       (stonith:fence_xvm):    Started rh73-node2
 xvmNode2       (stonith:fence_xvm):    Started rh73-node1
 xvmNode3       (stonith:fence_xvm):    Started rh73-node2
 dummy  (ocf::pacemaker:Dummy): Started rh73-node1

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled

> a guest node by its resource:

[root@rh73-node1:~]# pcs cluster node add-guest guest-node dummy-guest remote-addr=rh73-node3
Sending remote node configuration files to 'rh73-node3'
rh73-node3: successful distribution of the file 'pacemaker_remote authkey'
Requesting start of service pacemaker_remote on 'rh73-node3'
rh73-node3: successful run of 'pacemaker_remote enable'
rh73-node3: successful run of 'pacemaker_remote start'
[root@rh73-node1:~]# pcs status
Cluster name: rhel73
Stack: corosync
Current DC: rh73-node2 (version 1.1.16-9.el7-94ff4df) - partition with quorum
Last updated: Fri May 26 13:54:28 2017
Last change: Fri May 26 13:54:20 2017 by root via cibadmin on rh73-node1

3 nodes configured
6 resources configured

Online: [ rh73-node1 rh73-node2 ]
GuestOnline: [ guest-node@rh73-node1 ]

Full list of resources:

 xvmNode1       (stonith:fence_xvm):    Started rh73-node2
 xvmNode2       (stonith:fence_xvm):    Started rh73-node2
 xvmNode3       (stonith:fence_xvm):    Started rh73-node2
 dummy  (ocf::pacemaker:Dummy): Started guest-node
 dummy-guest    (ocf::pacemaker:Dummy): Started rh73-node1

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled
[root@rh73-node1:~]# pcs cluster node remove-guest dummy-guest
Requesting stop of service pacemaker_remote on 'guest-node'
guest-node: successful run of 'pacemaker_remote disable'
guest-node: successful run of 'pacemaker_remote stop'
Requesting remove remote node files from 'guest-node'
guest-node: successful removal of the file 'pacemaker_remote authkey'
[root@rh73-node1:~]# pcs status
Cluster name: rhel73
Stack: corosync
Current DC: rh73-node2 (version 1.1.16-9.el7-94ff4df) - partition with quorum
Last updated: Fri May 26 13:55:23 2017
Last change: Fri May 26 13:55:15 2017 by root via cibadmin on rh73-node1

2 nodes configured
5 resources configured

Online: [ rh73-node1 rh73-node2 ]

Full list of resources:

 xvmNode1       (stonith:fence_xvm):    Started rh73-node2
 xvmNode2       (stonith:fence_xvm):    Started rh73-node1
 xvmNode3       (stonith:fence_xvm):    Started rh73-node1
 dummy  (ocf::pacemaker:Dummy): Started rh73-node2
 dummy-guest    (ocf::pacemaker:Dummy): Started rh73-node1

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled

> a guest node by its name:

root@rh73-node1:~]# pcs cluster node add-guest guest-node dummy-guest remote-addr=rh73-node3
Sending remote node configuration files to 'rh73-node3'
rh73-node3: successful distribution of the file 'pacemaker_remote authkey'
Requesting start of service pacemaker_remote on 'rh73-node3'
rh73-node3: successful run of 'pacemaker_remote enable'
rh73-node3: successful run of 'pacemaker_remote start'
[root@rh73-node1:~]# pcs status
Cluster name: rhel73
Stack: corosync
Current DC: rh73-node2 (version 1.1.16-9.el7-94ff4df) - partition with quorum
Last updated: Fri May 26 13:55:53 2017
Last change: Fri May 26 13:55:51 2017 by root via cibadmin on rh73-node1

3 nodes configured
6 resources configured

Online: [ rh73-node1 rh73-node2 ]
GuestOnline: [ guest-node@rh73-node1 ]

Full list of resources:

 xvmNode1       (stonith:fence_xvm):    Started rh73-node2
 xvmNode2       (stonith:fence_xvm):    Started rh73-node2
 xvmNode3       (stonith:fence_xvm):    Started rh73-node1
 dummy  (ocf::pacemaker:Dummy): Started guest-node
 dummy-guest    (ocf::pacemaker:Dummy): Started rh73-node1

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled
[root@rh73-node1:~]# pcs cluster node remove-guest guest-node
Requesting stop of service pacemaker_remote on 'guest-node'
guest-node: successful run of 'pacemaker_remote disable'
guest-node: successful run of 'pacemaker_remote stop'
Requesting remove remote node files from 'guest-node'
guest-node: successful removal of the file 'pacemaker_remote authkey'
[root@rh73-node1:~]# pcs status
Cluster name: rhel73
Stack: corosync
Current DC: rh73-node2 (version 1.1.16-9.el7-94ff4df) - partition with quorum
Last updated: Fri May 26 13:57:16 2017
Last change: Fri May 26 13:57:10 2017 by root via cibadmin on rh73-node1

2 nodes configured
5 resources configured

Online: [ rh73-node1 rh73-node2 ]

Full list of resources:

 xvmNode1       (stonith:fence_xvm):    Started rh73-node2
 xvmNode2       (stonith:fence_xvm):    Started rh73-node1
 xvmNode3       (stonith:fence_xvm):    Started rh73-node1
 dummy  (ocf::pacemaker:Dummy): Started rh73-node2
 dummy-guest    (ocf::pacemaker:Dummy): Started rh73-node1

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled

> a guest node by its host:

[root@rh73-node1:~]# pcs cluster node add-guest guest-node dummy-guest remote-addr=rh73-node3
Sending remote node configuration files to 'rh73-node3'
rh73-node3: successful distribution of the file 'pacemaker_remote authkey'
Requesting start of service pacemaker_remote on 'rh73-node3'
rh73-node3: successful run of 'pacemaker_remote enable'
rh73-node3: successful run of 'pacemaker_remote start'
[root@rh73-node1:~]# pcs status
Cluster name: rhel73
Stack: corosync
Current DC: rh73-node2 (version 1.1.16-9.el7-94ff4df) - partition with quorum
Last updated: Fri May 26 13:57:42 2017
Last change: Fri May 26 13:57:41 2017 by root via cibadmin on rh73-node1

3 nodes configured
6 resources configured

Online: [ rh73-node1 rh73-node2 ]
GuestOnline: [ guest-node@rh73-node1 ]

Full list of resources:

 xvmNode1       (stonith:fence_xvm):    Started rh73-node2
 xvmNode2       (stonith:fence_xvm):    Started rh73-node2
 xvmNode3       (stonith:fence_xvm):    Started rh73-node1
 dummy  (ocf::pacemaker:Dummy): Stopped
 dummy-guest    (ocf::pacemaker:Dummy): Started rh73-node1

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled
[root@rh73-node1:~]# pcs cluster node remove-guest rh73-node3
Requesting stop of service pacemaker_remote on 'guest-node'
guest-node: successful run of 'pacemaker_remote disable'
guest-node: successful run of 'pacemaker_remote stop'
Requesting remove remote node files from 'guest-node'
guest-node: successful removal of the file 'pacemaker_remote authkey'
[root@rh73-node1:~]# pcs status
Cluster name: rhel73
Stack: corosync
Current DC: rh73-node2 (version 1.1.16-9.el7-94ff4df) - partition with quorum
Last updated: Fri May 26 13:57:57 2017
Last change: Fri May 26 13:57:54 2017 by root via cibadmin on rh73-node1

2 nodes configured
5 resources configured

Online: [ rh73-node1 rh73-node2 ]

Full list of resources:

 xvmNode1       (stonith:fence_xvm):    Started rh73-node2
 xvmNode2       (stonith:fence_xvm):    Started rh73-node1
 xvmNode3       (stonith:fence_xvm):    Started rh73-node1
 dummy  (ocf::pacemaker:Dummy): Started rh73-node2
 dummy-guest    (ocf::pacemaker:Dummy): Started rh73-node1

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled
Comment 10 errata-xmlrpc 2017-08-01 14:22:57 EDT
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, 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/RHBA-2017:1958

Note You need to log in before you can comment on or make changes to this bug.