Bug 1833362 - Unable to rename VM using Rest API
Summary: Unable to rename VM using Rest API
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.11.5
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: GA
: 5.11.6
Assignee: drew uhlmann
QA Contact: Parthvi Vala
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-08 14:03 UTC by Riya Banerjee
Modified: 2023-10-06 19:57 UTC (History)
5 users (show)

Fixed In Version: 5.11.6.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-06-10 13:39:11 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:
pm-rhel: cfme-5.11.z+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:2480 0 None None None 2020-06-10 13:39:16 UTC

Description Riya Banerjee 2020-05-08 14:03:32 UTC
Description of problem:-
Unable to rename VM using Rest API


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


How reproducible:
Always



Steps to Reproduce:-

POST https://<cfme_fqdn>/api/vms/vm_id

{
  "action" : "edit",
  "resource" : {
    "name" : "XYZ",
    "description" : "Renaming VM"
  }
}



Actual results:-
Response:-

{
    "error": {
        "kind": "bad_request",
        "message": "Cannot edit VM - Cannot edit values name",
        "klass": "Api::BadRequestError"
    }
}



Expected results:
VM should be successfully renamed.


Additional info:
VMWare VMs can be renamed from the CloudForms UI as per below document:-
https://www.manageiq.org/docs/reference/latest/doc-Provisioning_Virtual_Machines_and_Hosts/miq/index#renaming-a-provisioned-virtual-machine

VMs can be renamed using API as per below document:-
https://www.manageiq.org/docs/reference/euwe/doc-REST_API/miq/index#updating-resources

Comment 2 drew uhlmann 2020-05-12 18:54:51 UTC
https://github.com/ManageIQ/manageiq-api/pull/832

Comment 3 CFME Bot 2020-05-13 18:51:20 UTC
New commit detected on ManageIQ/manageiq-api/master:

https://github.com/ManageIQ/manageiq-api/commit/9288b752363c9282db488012ff72f849377a63f0
commit 9288b752363c9282db488012ff72f849377a63f0
Author:     d-m-u <drewuhlmann>
AuthorDate: Tue May 12 18:40:35 2020 +0000
Commit:     d-m-u <drewuhlmann>
CommitDate: Tue May 12 18:40:35 2020 +0000

    Add name to valid edit attrs

    fixes https://bugzilla.redhat.com/show_bug.cgi?id=1833362

 app/controllers/api/vms_controller.rb | 4 +-
 spec/requests/vms_spec.rb | 6 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

Comment 4 CFME Bot 2020-05-14 12:51:16 UTC
New commit detected on ManageIQ/manageiq-api/jansa:

https://github.com/ManageIQ/manageiq-api/commit/7081cfb18b63bf967487de4f0f50dd1277ca0914
commit 7081cfb18b63bf967487de4f0f50dd1277ca0914
Author:     Alberto Bellotti <abellotti.github.com>
AuthorDate: Wed May 13 18:49:26 2020 +0000
Commit:     Alberto Bellotti <abellotti.github.com>
CommitDate: Wed May 13 18:49:26 2020 +0000

    Merge pull request #832 from d-m-u/add_name_to_vm_valid_edit_attrs

    Add name to valid edit attrs for vms

    (cherry picked from commit 3da948436ad7b71cdab1d95843feb5e5a08d3b99)

    https://bugzilla.redhat.com/show_bug.cgi?id=1833362

 app/controllers/api/vms_controller.rb | 4 +-
 spec/requests/vms_spec.rb | 6 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

Comment 5 Parthvi Vala 2020-06-01 09:47:48 UTC
FIXED. Verified on 5.11.6.0.20200526234234_3fcafeb.

Comment 8 errata-xmlrpc 2020-06-10 13:39:11 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/RHSA-2020:2480


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