Bug 1462248

Summary: pcs should not allow or at least warn about a bundle with no IP address having an inner resource
Product: Red Hat Enterprise Linux 7 Reporter: Tomas Jelinek <tojeline>
Component: pcsAssignee: Ondrej Mular <omular>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 7.4CC: abeekhof, cfeist, cluster-maint, cluster-qe, idevat, kgaillot, omular, rsteiger, tojeline
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.9.165-2.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1447951
: 1578898 (view as bug list) Environment:
Last Closed: 2018-10-30 08:05:31 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:

Description Tomas Jelinek 2017-06-16 13:30:15 UTC
+++ This bug was initially created as a clone of Bug #1447951 +++

Description of problem:
If a bundle resource is created without an IP address and a primitive resource is put inside the bundle, the bundle and the primitive is not shown in crm_mon and crm_mon --xml output. crm_verify shows why:
# crm_verify --live-check --verbose
   error: container_unpack:     Cannot control http-bundle inside dummy1
without either ip-range-start or control-port
   error: unpack_resources:     Failed unpacking bundle http-bundle
Errors found during check: config not valid

It would be nice to see these resources in crm_mon output.


Version-Release number of selected component (if applicable):
pacemaker-1.1.16-8.el7.x86_64


How reproducible:
always, easily


Steps to Reproduce:
1. create a bundle without an IP
2. put a primitive into the bundle


Actual results:
The bundle is missing in crm_mon and crm_mon --xml output. 


Expected results:
The bundle is present in crm_mon --xml output. Failed actions are shown in crm_mon output.


Additional info:
Expected results seem to be consistent with a misconfigured primitive (tested with a primitive based on a nonexistent resource agent).

--- Additional comment from Ken Gaillot on 2017-05-04 10:42:41 EDT ---

This will be considered in the 7.5 timeframe.

--- Additional comment from Andrew Beekhof on 2017-05-04 20:09:23 EDT ---

I agree invalid resources (not just bundles) should be in the xml output, I'm less sure about the normal output - unless as a "invalid resources detected, use crm_verify" line somewhere.

(Consider that it may be invalid because there is no id)

> Expected results seem to be consistent with a misconfigured primitive (tested with a primitive based on a nonexistent resource agent).

Thats a very different kind of invalid resource.

We would not want resources that cannot even be unpacked to show up in the "failed operations" section of the output.

--- Additional comment from Tomas Jelinek on 2017-05-05 03:07:16 EDT ---

This is the use case I am concerned about:
1) The user creates an invalid resource.
2) The user runs pcs status / crm_mon.
3) There is no sign of the resource created in step 1.
4) The user is confused.

Consider some time may pass between step 1 and two.

As long as crm_mon shows there is something wrong, by any means possible, I am fine with that.

Comment 1 Tomas Jelinek 2017-06-16 13:31:53 UTC
When putting a resource into a bundle, pcs should check the bundle has an IP address defined. Similar check should be done when removing an IP address in the bundle update command.

Comment 2 Ken Gaillot 2017-06-16 14:24:42 UTC
(In reply to Tomas Jelinek from comment #1)
> When putting a resource into a bundle, pcs should check the bundle has an IP
> address defined. Similar check should be done when removing an IP address in
> the bundle update command.

IP address or control port. Pacemaker can reach inside the container if it using the host's network (without its own IP address) and has pacemaker remote running on a distinct port.

Comment 3 Andrew Beekhof 2017-06-19 01:10:38 UTC
> It would be nice to see these resources in crm_mon output.

I disagree, it's not the right tool (clearly, since we have one for this purpose).
At most, a catch-all "You should go and run crm_verify now" could be added.

Comment 6 Ivan Devat 2018-06-22 12:07:04 UTC
After Fix:

[ant ~] $ rpm -q pcs pcs-snmp
pcs-0.9.165-1.el7.x86_64
pcs-snmp-0.9.165-1.el7.x86_64

[ant ~] $ pcs resource bundle create B1 container docker image=pcs:test network host-netmask=24
[ant ~] $ pcs resource create R ocf:heartbeat:Dummy bundle B1
Error: Unknown report: RESOURCE_IN_BUNDLE_NOT_ACCESSIBLE info: {'inner_resource_id': 'R', 'bundle_id': 'B1'}, use --force to override

Comment 8 Tomas Jelinek 2018-06-22 13:44:37 UTC
additional fix which actually makes --force work and translates the error to a comprehensible message:
https://github.com/ClusterLabs/pcs/commit/6f6cce412538da12845576b018a3e6d7512f0b96

Comment 9 Ivan Devat 2018-07-24 06:56:03 UTC
After Fix:

[ant ~] $ rpm -q pcs
pcs-0.9.165-2.el7.x86_64

[ant ~] $ pcs resource bundle create B1 container docker image=pcs:test network host-netmask=24
[ant ~] $ pcs resource create R ocf:heartbeat:Dummy bundle B1
Error: Resource 'R' will not be accessible by the cluster inside bundle 'B1', at least one of bundle options 'control-port' or 'ip-range-start' has to be specified, use --force to override
[ant ~] $ pcs resource create R ocf:heartbeat:Dummy bundle B1 --force
Warning: Resource 'R' will not be accessible by the cluster inside bundle 'B1', at least one of bundle options 'control-port' or 'ip-range-start' has to be specified

Comment 13 errata-xmlrpc 2018-10-30 08:05:31 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.

https://access.redhat.com/errata/RHBA-2018:3066