Description of problem: Unable to retire a VM via REST api Version-Release number of selected component (if applicable): 5.10.15 How reproducible: Always Steps to Reproduce: 1. Provision a VM. 2. Retire the VM via REST API. Actual results: 1. 2. VM summary table shows the retirement has initialized but it does not retire. Expected results: 1. 2. VM should retire. Additional info: The bug exists on 5.11 as well, last working version for 5.11 is 5.11.0.28
Couple issues here: Per Parthvi's message about the call she's using: POST https://whatever/api/vms/# {'action': 'retire'} is the old call, and won't work. Issue 1 is that our docs need an update (https://www.manageiq.org/docs/reference/latest/api/examples/retire_service), the correct action needs to be request_retire. There's a recent talk topic about that: http://talk.manageiq.org/t/retirement-as-a-request/4797 There's still a bug here, but that call won't work today anyway.
https://github.com/ManageIQ/manageiq/pull/19855
https://github.com/ManageIQ/manageiq-api/pull/743
Hi Drew, I understand the call is old, but I even tried with the new call `request_retire` but it didn't work either.
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/8b8f58be45b7f1db318820f3587ff95b4e2ef2af commit 8b8f58be45b7f1db318820f3587ff95b4e2ef2af Author: d-m-u <drewuhlmann> AuthorDate: Thu Feb 20 15:15:04 2020 +0000 Commit: d-m-u <drewuhlmann> CommitDate: Thu Feb 20 15:15:04 2020 +0000 Call instance method for vm retire queueing Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1805119 Introduced in https://github.com/ManageIQ/manageiq-api/pull/662 app/models/vm_or_template.rb | 4 + 1 file changed, 4 insertions(+)
Urps it's not in post yet, https://github.com/ManageIQ/manageiq-api/pull/743 needs to be merged first
Okay all good here. Thanks Parthvi, this was a good catch.
New commit detected on ManageIQ/manageiq-api/master: https://github.com/ManageIQ/manageiq-api/commit/13f33f060210ddcb811e42bba9557c9b179f1fee commit 13f33f060210ddcb811e42bba9557c9b179f1fee Author: d-m-u <drewuhlmann> AuthorDate: Thu Feb 20 15:14:46 2020 +0000 Commit: d-m-u <drewuhlmann> CommitDate: Thu Feb 20 15:14:46 2020 +0000 Add user id argument for vm retire queueing to match the backend method Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1805119 Introduced in https://github.com/ManageIQ/manageiq-api/pull/662 app/controllers/api/vms_controller.rb | 2 +- spec/requests/vms_spec.rb | 16 + 2 files changed, 17 insertions(+), 1 deletion(-)
New commit detected on ManageIQ/manageiq/ivanchuk: https://github.com/ManageIQ/manageiq/commit/398fb5dcb82a36cf271869238ad58e55205c5e3c commit 398fb5dcb82a36cf271869238ad58e55205c5e3c Author: Adam Grare <agrare> AuthorDate: Wed Feb 26 13:56:51 2020 +0000 Commit: Adam Grare <agrare> CommitDate: Wed Feb 26 13:56:51 2020 +0000 Merge pull request #19855 from d-m-u/adding_instance_retire_for_queueing_retirement_vm_calls Call instance method for vm retire queuing (cherry picked from commit 9a0b7c3b206f662b4794ca0099bce2a7768f179f) https://bugzilla.redhat.com/show_bug.cgi?id=1805119 app/models/vm_or_template.rb | 4 + 1 file changed, 4 insertions(+)
New commit detected on ManageIQ/manageiq-api/ivanchuk: https://github.com/ManageIQ/manageiq-api/commit/e46a280ae9c0e173c9d9409367a8baa5f5cecb70 commit e46a280ae9c0e173c9d9409367a8baa5f5cecb70 Author: Libor Pichler <lpichler> AuthorDate: Wed Feb 26 14:02:18 2020 +0000 Commit: Libor Pichler <lpichler> CommitDate: Wed Feb 26 14:02:18 2020 +0000 Merge pull request #743 from d-m-u/change_queue_call_to_vm_retirement Call instance method for vm retire queueing (cherry picked from commit 2c70d200e88e5b06b1a4585682fe0de4a4be4806) https://bugzilla.redhat.com/show_bug.cgi?id=1805119 app/controllers/api/vms_controller.rb | 2 +- spec/requests/vms_spec.rb | 16 + 2 files changed, 17 insertions(+), 1 deletion(-)
FIXED. Verified on 5.11.5.1. Successfully retired the VM via `request_retire` action. Question: Why do we still have `retire` action on the list?
It's necessary for backwards compatibility, see http://talk.manageiq.org/t/retirement-as-a-request/4797
Any plans on backporting this to 5.10? OR is there a different fix in progress for this BZ?
yeah, you're right. https://github.com/ManageIQ/manageiq-api/pull/662, which introduced this, got backported to hammer so the fix in an ideal world would as well.
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-2020:2020
*** Bug 1834819 has been marked as a duplicate of this bug. ***
Hello Team, After upgrading the appliance to 5.11.5 and now we can retire the vm using below parameter i.e. { "action" : "request_retire" } In the result, it is giving us the output like below: { "success": true, "message": "VM id:<vmid> name:<vmname> request retire", "task_id": "1000000006444", "task_href": "https://<cfmeip>/api/tasks/1000000006444", "href": "https://<cfmeip>/api/vms/1000000000009" } When we check the status of task, it shows complete status Response: "href": "https://<cfmeip>/api/tasks/1000000006444", "name": "VM id:<vmid> name:<vmname> request retire", "state": "Finished", "status": "Ok", "message": "Task completed successfully", But the request is still is progress if we check the logs. Expected Behavior should be the state should not show "finished" when the retirement is still in progress. Regards, Neha Chugh
Hey Neha, it's expected from our side that tasks complete before the request is finished. That's not a bug, nor did that change on any 5.11.
Hey Neha, if I could ask you to please open a different bug for that, assign me, and provide a reproducer, that'd be great. Thanks.
Hello Drew, I have created different bug for the same i.e. https://bugzilla.redhat.com/show_bug.cgi?id=1849671 and shared the reproducer in the BZ itself. Regards, Neha Chugh