Bug 1408476 - pcs does not currently work with systemd's instantiated services
Summary: pcs does not currently work with systemd's instantiated services
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pcs
Version: 7.3
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Ivan Devat
QA Contact: cluster-qe@redhat.com
Depends On:
Blocks: 1335682 1412244
TreeView+ depends on / blocked
Reported: 2016-12-23 16:05 UTC by Michele Baldessari
Modified: 2017-08-01 18:26 UTC (History)
8 users (show)

Fixed In Version: pcs-0.9.156-1.el7
Doc Type: Bug Fix
Doc Text:
Cause: User creates a cluster resource based on a systemd service which supports multiple instances (i.e. there is the "@" character in the resource agent name). Consequence: The resource agent is not recognized by pcs and the command fails. User has to specify --force in the command for it to succeed. Fix: Fixed validation of systemd resource agent names. Result: It is possible to create cluster resource based on a systemd service which supports multiple instances.
Clone Of:
: 1412244 (view as bug list)
Last Closed: 2017-08-01 18:26:07 UTC
Target Upstream Version:

Attachments (Terms of Use)
Locally tested fix (652 bytes, patch)
2016-12-23 16:05 UTC, Michele Baldessari
no flags Details | Diff
proposed fix (1.08 KB, patch)
2017-01-11 14:45 UTC, Tomas Jelinek
no flags Details | Diff

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1958 0 normal SHIPPED_LIVE pcs bug fix and enhancement update 2017-08-01 18:09:47 UTC

Description Michele Baldessari 2016-12-23 16:05:48 UTC
Created attachment 1235077 [details]
Locally tested fix

Description of problem:
Currently (pcs-0.9.152-10.el7.centos.x86_64) we do not support systemd instantiated services (0pointer.de/blog/projects/instances.html) aka the services that have an @ in the service filename and that can be instantiated multiple times.

For example:
[root@centos pcs]# pcs resource create gettytest systemd:getty@tty3 
Error: Unable to create resource 'systemd:getty@tty3', it is not installed on this system (use --force to override)

With --force this does get created and it works, but pcs is not considering the instantiated service scenario when it does the prevalidation.

I attach the trivial patch that fixes it for me. I attach it here to the downstream bug only, because this is actually already fixed in pcs master via the following change:
commit 491ac087fd06480a9fda0dfc5dd97f6b9dfbae56
Author: Tomas Jelinek <tojeline@redhat.com>
Date:   Tue Oct 11 17:12:11 2016 +0200

    get resource/fence agents info from pacemaker

With the attached patch applied I can correctly do the following:
[root@centos system]# pcs resource create gettytest4 systemd:getty@tty4

[root@centos system]# pcs status
Cluster name: clustername
Stack: corosync
Current DC: centos (version 1.1.15-11.el7_3.2-e174ec8) - partition with quorum
Last updated: Fri Dec 23 16:40:53 2016		Last change: Fri Dec 23 16:40:49 2016 by root via cibadmin on centos

1 node and 4 resources configured

Online: [ centos ]

Full list of resources:

 gettytest4	(systemd:getty@tty4):	Started centos

Comment 2 Tomas Jelinek 2017-01-11 14:45:23 UTC
Created attachment 1239460 [details]
proposed fix

This will be eventually fixed by a rebase. Until then (and for the z-stream) here is the patch.

Comment 4 Michele Baldessari 2017-01-12 18:26:31 UTC
Giulio, could you provide us some feedback on this just to be 100% sure we covered your use case correctly?

Comment 5 Giulio Fidente 2017-01-13 15:47:50 UTC
hi guys, thanks a lot! I've tested manually the "proposed fix" attachment together with https://review.openstack.org/#/c/407039/ (meant to deploy the ceph rbd-mirror daemon) and it completed successfully:

  [root@overcloud-controller-0 ~]# pcs status|grep -i rbd
   ceph-rbd-mirror_openstack      (systemd:ceph-rbd-mirror@openstack):    Started overcloud-controller-0

looking forward to use it in OSPd11 :)

Comment 6 Ivan Devat 2017-02-20 07:32:06 UTC
After Fix:                                                                      
[vm-rhel72-1 ~] $ rpm -q pcs                                                                                                                                                                                         
[vm-rhel72-1 ~] $ pcs resource create gettytest systemd:getty@tty3              
[vm-rhel72-1 ~] $ pcs status|grep gettytest                                     
 gettytest      (systemd:getty@tty3):   Started vm-rhel72-2

Comment 10 errata-xmlrpc 2017-08-01 18:26:07 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, and where to find the updated
files, follow the link below.

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


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