Description of problem: Service with vm has parent service defined ("ancestry": "<parent_id>"). When running power operation on parent service using REST API, it has no effect. When running power operation on child service using REST API, it works. Power actions on a service should be processed from the service it is initiated and child services, i.e. calling the action on the top-level service should work. The top-level (parent) service is minimal service with just name and description. Version-Release number of selected component (if applicable): 5.7.1.0 How reproducible: 100% Steps to Reproduce: 1. create child service with vm 2. create minimal service, e.g. POST /api/services { "name" : "test_service_parent", "description" : "Test Service parent" } 3. edit child vm to add ancestor: POST /api/services/:child_id { "action": "edit", "ancestry" : "<parent_id>" } 4. run power operation on parent service: POST /api/services/:parent_id { "action": "stop" } Actual results: No effect on the vm associated with child service. Following is set in parent service: "options": {"power_status": "stopping"} Expected results: The vm associated with child service is stopped.
Martin - Please retest with the fix from https://github.com/ManageIQ/manageiq/pull/13232 which was created for Bug 1394202. This change resolves a few issues and should correct this scenario.
Tested on 5.8.0.2 and the described issue is still there.
Martin, I was able to duplicate the problem yesterday (3/20/2017.) I'm working on a PR to resolve it.
PR: https://github.com/ManageIQ/manageiq/pull/14550
PR: https://github.com/ManageIQ/manageiq/pull/14550 - Refactored how atomic? and composite? services are clarified - now they are clarified (from the services level) simply as child_resources? and empty_child_resources?
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/ec58361e4c0940d4dac70094fe3c00452d681f54 commit ec58361e4c0940d4dac70094fe3c00452d681f54 Author: Drew Bomhof <dbomhof> AuthorDate: Mon Apr 3 16:11:52 2017 -0400 Commit: Drew Bomhof <dbomhof> CommitDate: Tue Apr 18 14:48:55 2017 -0400 Adjust power states to handle children 1. Iterate through the children if there are no service_resources on the parent 2. Iterate through the children for power states to adjust the power state and status for the entire service https://bugzilla.redhat.com/show_bug.cgi?id=1416903 app/models/mixins/service_mixin.rb | 6 +++++- app/models/service.rb | 28 +++++++++++++++++----------- 2 files changed, 22 insertions(+), 12 deletions(-)
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/3daf3fe27f08a15605721eeb249c60a85793dc1e commit 3daf3fe27f08a15605721eeb249c60a85793dc1e Author: Drew Bomhof <dbomhof> AuthorDate: Mon Apr 3 16:12:25 2017 -0400 Commit: Drew Bomhof <dbomhof> CommitDate: Tue Apr 18 14:48:55 2017 -0400 Add specs around the the all_states_match? method https://bugzilla.redhat.com/show_bug.cgi?id=1416903 spec/models/service_spec.rb | 76 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 18 deletions(-)
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/a52d65d8895fe942750b15caaab80f4024889024 commit a52d65d8895fe942750b15caaab80f4024889024 Author: Drew Bomhof <dbomhof> AuthorDate: Wed Apr 5 11:42:03 2017 -0400 Commit: Drew Bomhof <dbomhof> CommitDate: Tue Apr 18 14:48:55 2017 -0400 Re use the composite? and atomic? method names https://bugzilla.redhat.com/show_bug.cgi?id=1416903 app/models/service.rb | 8 +++---- spec/models/service_spec.rb | 55 +++++++++++++++++++++------------------------ 2 files changed, 30 insertions(+), 33 deletions(-)
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/f2a06a87a849786153fa0589b18b4c546e793a4a commit f2a06a87a849786153fa0589b18b4c546e793a4a Author: Drew Bomhof <dbomhof> AuthorDate: Tue Apr 18 15:47:50 2017 -0400 Commit: Drew Bomhof <dbomhof> CommitDate: Tue Apr 18 15:47:50 2017 -0400 Extract service actions list into a method https://bugzilla.redhat.com/show_bug.cgi?id=1416903 app/models/service.rb | 14 ++++++++------ spec/models/service_spec.rb | 2 ++ 2 files changed, 10 insertions(+), 6 deletions(-)
Verified using CFME QE test automation on 5.9.0.2
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/RHSA-2018:0380