Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1175664

Summary: Native Management Port/Host does not take into account port offset
Product: [JBoss] JBoss Operations Network Reporter: Libor Zoubek <lzoubek>
Component: Plugin -- JBoss EAP 6Assignee: Thomas Heute <theute>
Status: CLOSED ERRATA QA Contact: Sunil Kondkar <skondkar>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: JON 3.3.0CC: fbrychta, hrupp, loleary, mfoley, miburman, rhatlapa, skondkar, spinder, theute
Target Milestone: post-GAKeywords: Triaged
Target Release: One-off release   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1173479 Environment:
Last Closed: 2016-01-28 13:30:03 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: 1173479    
Bug Blocks: 1181217    
Attachments:
Description Flags
Screenshot none

Description Libor Zoubek 2014-12-18 10:14:59 UTC
This bug might prevent EAP patching to work after upgrade from 3.2 unless inventoried EAPs have default native host & port.

+++ This bug was initially created as a clone of Bug #1173479 +++

Description of problem:

When upgrading our 4.5.1 RHQ Server to 4.13, there are two new setting under Connection Settings for Jboss AS7:

Native management API host
Native management API port

I also notice that for most of the AS7 servers in inventory after upgrade, this port is set to 9999 for all server instances.

This is wrong, since we run many instances on the same host with port offset 100. So it should be 9999, 10099 and so on.

I tried uninventory of all AS7 on one host and import, and the result was that the Native Port was set correctly for the instances.

However having to do this for potentially hundreds of servers is not something I can easily do.

So the question is:
Is there a bug in discovery that would result it not taking offset into consideration when upgrading servers already in inventory?

Not sure when this connection settings property was introduced but it must have been after 4.5.1? Maybe even just the last releases?


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

RHQ 4.13 
AS7 Agent 4.13

How reproducible:

When upgrading servers this happens to most servers, but not every server.
When doing uninventory and import the servers seem to get the correct native management port.

Steps to Reproduce:
Upgrade servers from older version of RHQ. Might only affect very old (4.5.1) versions.

Actual results:

Management native port set to 9999 for all servers which is wrong according to offset.

Expected results:

Expect management native port to be set correctly.

Additional info:

--- Additional comment from Libor Zoubek on 2014-12-15 11:00:58 EST ---

Yes, there is a bug in resource upgrade code, which does not care about native host & port at all right now, so values you get in UI are defaults comming from plugin descriptor.

Comment 1 Libor Zoubek 2015-01-07 14:20:03 UTC
branch:  master
link:    https://github.com/rhq-project/rhq/commit/0832e0af3
time:    2015-01-07 15:17:21 +0100
commit:  0832e0af3505ff5ac07206884d4cdefadeda8267
author:  Libor Zoubek - lzoubek
message: Bug 1173479 - 4.13: Native Management Port/Host does not take into
         account port offset/

         Fixed AS7 resourceUpgrade code to always detect native
         management host/port in case resource is running and defaults
         are set

Comment 2 Michael Burman 2015-01-09 08:56:40 UTC
Cherry-picked to release/jon3.3.x:

commit 78a4c7beab8697dfad7ab931b0c50f6244e6087e
Author: Libor Zoubek <lzoubek>
Date:   Wed Jan 7 15:12:22 2015 +0100

    Bug 1173479 - 4.13: Native Management Port/Host does not take into account
    port offset?
    
    Fixed AS7 resourceUpgrade code to always detect native management host/port
    in case resource is running and defaults are set
    
    (cherry picked from commit 0832e0af3505ff5ac07206884d4cdefadeda8267)

Comment 3 Larry O'Leary 2015-01-14 00:32:53 UTC
This is an JBoss EAP plug-in fix. Moving to a future JBoss EAP plug-in pack update target.

Comment 4 Libor Zoubek 2015-06-05 09:05:58 UTC
I added one more commit

branch:  master
link:    https://github.com/rhq-project/rhq/commit/4c3f7829e
time:    2015-06-05 10:47:03 +0200
commit:  4c3f7829e1d9ce8fc745f8e8d468f44589798e3e
author:  Libor Zoubek - lzoubek
message: Bug 1173479 - 4.13: Native Management Port/Host does not take into ac

         One more commit to prevent resource upgrade when did not detect
         any change in native host/port settings.


The original issue was, that we introduced nativeHost and nativePort pluginConfig properties and we did not provide resource-upgrade code, to discover those properties. As a consequence, after plugin upgrade (to version wich introduced new propertes (3.3.0)) older AS7 resources were left with default values.

Steps to verify (upgrade not required):

1. import EAP6 in default configuration
2. verify resource pluginConfiguration has native host:port set to 127.0.0.1:9999
3. restart your EAP6 with -Djboss.management.native.port=19999
4. restart agent
5. verify resource pluginConfiguration has native host:port set to 127.0.01:19999

Step 4. is required to run our resource-upgrade code, which in case it detects our plugin settings are default (which may or may not mean that those values were previously discovered), it discovers native host/port again. Latest commit 4c3f7829e improves this logic a bit and only marks resource as upgraded in case we detect a change.

Steps to verify (upgrade required):
1. have EAP6 with native post shifted
2. import it prior JON 3.3.0 (no native host/port pluginConfiguration properties should exist)
3. upgrade
4. verify native port is discovered correctly.

Comment 5 Simeon Pinder 2015-06-09 15:57:56 UTC
branch: release/jon3.3.x
commit 88e5b648bb1d6780b64cc57fc3853e53e9cdc885
Author:     Libor Zoubek <lzoubek>
AuthorDate: Fri Jun 5 10:47:03 2015 +0200
Commit:     Simeon Pinder <spinder>
CommitDate: Tue Jun 9 11:52:49 2015 -0400

    Bug 1173479 - 4.13: Native Management Port/Host does not take into ac

Moving to MODIFIED.

Comment 7 Sunil Kondkar 2015-06-17 15:02:50 UTC
Installed 3.3.0.GA Update 02 with EAP6 and applied Application Platform Plugin Pack Update-01 
Restarting EAP6 with -Djboss.management.native.port=19999  and restarting the agent display the Native Host value as 127.0.0.1 and the Native Port value as 19999 correctly in EAP6->Inventory->Connection Settings.

With upgrade steps verified that after upgrade and applying Application Platform Plugin Pack Update-01 , the Native port value displayed is 19999. Screenshot is attached.

Comment 8 Sunil Kondkar 2015-06-17 15:03:28 UTC
Created attachment 1039995 [details]
Screenshot