Bug 1578393 - Improving the error message of provisioning a VM via rest api with wrong vlan value
Summary: Improving the error message of provisioning a VM via rest api with wrong vlan...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
low
high
Target Milestone: GA
: 5.9.3
Assignee: Alona Kaplan
QA Contact: Martin Kourim
URL:
Whiteboard: api:rest:provisioning
Depends On: 1541036
Blocks: 1561041
TreeView+ depends on / blocked
 
Reported: 2018-05-15 13:31 UTC by Satoe Imaishi
Modified: 2022-07-09 09:52 UTC (History)
10 users (show)

Fixed In Version: 5.9.3.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1541036
Environment:
Last Closed: 2018-07-12 13:15:09 UTC
Category: ---
Cloudforms Team: RHEVM
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github ManageIQ manageiq pull 17306 0 None None None 2018-05-15 13:31:50 UTC
Red Hat Bugzilla 1574351 0 medium CLOSED prov.set_vlan() method didn't set the vnicprofiles identifier 2022-03-13 14:57:15 UTC
Red Hat Product Errata RHSA-2018:2184 0 None None None 2018-07-12 13:15:44 UTC

Internal Links: 1574351

Comment 2 CFME Bot 2018-05-15 13:35:55 UTC
New commit detected on ManageIQ/manageiq/gaprindashvili:

https://github.com/ManageIQ/manageiq/commit/cfed918a101926ee63ede49932ecf018eeb6f434
commit cfed918a101926ee63ede49932ecf018eeb6f434
Author:     Adam Grare <agrare>
AuthorDate: Tue Apr 17 09:10:52 2018 -0400
Commit:     Adam Grare <agrare>
CommitDate: Tue Apr 17 09:10:52 2018 -0400

    Merge pull request #17306 from AlonaKaplan/vlan_description

    Changing the description of the 'vlan' field in provision/network
    (cherry picked from commit 9f7f72cdc7885ebb90a414411e6438a1b8576b8e)

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

 product/dialogs/miq_dialogs/miq_provision_redhat_dialogs_template.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 4 Ilanit Stein 2018-05-27 11:02:09 UTC
Tested on CFME-5.9.3/RHV-4.2.2.5

Running the VM provision request,
mentioned in the bug description (with "vlan" : "ovirtmgmt")
give now this error:

{
"error":{
"kind": "internal_server_error",
"message": "Provision failed for the following reasons:\n'Network/Virtual NIC Profile ID' is required",
"klass": "RuntimeError"
}
}

I think the naming is still confusing: 

The field name in the UI/REST api request is "vlan".
However,
for api version 3, "network" is expected,
for api version 4, "vnic_profile_id" is expected,

Can we change this field's name 
for api version 3, name it "network",
for api version 4, name it "vnic_profile_id",

and have the error contain the same name, used in the request: "network"/"vnic_profile_id"?

Thanks.

Comment 8 Alona Kaplan 2018-05-29 10:34:06 UTC
Hi Leo,

Bug https://bugzilla.redhat.com/1574351 handles the issue.

It will be possible to set the "profile_name (network_name)" instead of the profile id.

Comment 9 Ilanit Stein 2018-05-29 13:11:13 UTC
Alona,

After implementing https://bugzilla.redhat.com/1574351,

If a value for "vlan" will not be provided, or it's value will not be valid,
will the error still remain:

{
"error":{
"kind": "internal_server_error",
"message": "Provision failed for the following reasons:\n'Network/Virtual NIC Profile ID' is required",
"klass": "RuntimeError"
}
}

or will it change into something like

{
"error":{
"kind": "internal_server_error",
"message": "Provision failed for the following reasons:\n'Network/profile_name (network_name)' is required",
"klass": "RuntimeError"
}
}

Thanks.

Comment 10 Alona Kaplan 2018-05-30 07:57:27 UTC
Will change to -
"Provision failed for the following reasons:\n'Network/Virtual NIC Profile ID or 'profile_name (network_name)'".

Is it ok?

Comment 11 CFME Bot 2018-05-30 15:51:44 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/159e36074a874ca159ac5e0055f532c7f40bd380
commit 159e36074a874ca159ac5e0055f532c7f40bd380
Author:     Alona Kaplan <alkaplan>
AuthorDate: Wed May 30 07:38:36 2018 -0400
Commit:     Alona Kaplan <alkaplan>
CommitDate: Wed May 30 07:38:36 2018 -0400

    Adding the profile description option to the provision error message

    If the requested vlan/network is wrong, the error message will be-
    'Virtual NIC Profile ID or Profile Name (Network Name)'

    Fixes https://bugzilla.redhat.com/1578393
    Fixes https://bugzilla.redhat.com/1574351

 product/dialogs/miq_dialogs/miq_provision_redhat_dialogs_clone_to_vm.yaml | 1 +
 product/dialogs/miq_dialogs/miq_provision_redhat_dialogs_template.yaml | 3 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

Comment 12 CFME Bot 2018-05-30 20:16:36 UTC
New commit detected on ManageIQ/manageiq/gaprindashvili:

https://github.com/ManageIQ/manageiq/commit/fdd5b2e568e52042ccb233cff19b0dd08b3e5482
commit fdd5b2e568e52042ccb233cff19b0dd08b3e5482
Author:     Adam Grare <agrare>
AuthorDate: Wed May 30 11:49:19 2018 -0400
Commit:     Adam Grare <agrare>
CommitDate: Wed May 30 11:49:19 2018 -0400

    Merge pull request #17495 from AlonaKaplan/required_description

    Adding the profile description option to the provision error message
    (cherry picked from commit f27749569895ad0249877debf246bdfa2b5134c3)

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

 product/dialogs/miq_dialogs/miq_provision_redhat_dialogs_clone_to_vm.yaml | 1 +
 product/dialogs/miq_dialogs/miq_provision_redhat_dialogs_template.yaml | 3 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

Comment 13 Ilanit Stein 2018-06-07 11:42:24 UTC
Verified on cfme-5.9.3.1/RHV-4.2.3
Sent REST api request:

POST /api/provision_requests
{"additional_values": {"request_id": "1001"},
 "ems_custom_attributes": {},
 "miq_custom_attributes": {},
 "requester": {"auto_approve": false,
  "owner_email": "jdoe",
  "owner_first_name": "John",
  "owner_last_name": "Doe",
  "user_name": "admin"},
 "tags": {"cc": "001", "network_location": "Internal"},
 "template_fields": {"guid": "<template_guid>"},
 "version": "1.1",
 "vm_fields": {"number_of_cpus": 1,
  "provision_type": "native_clone",
  "vlan": "ovirtmgmt",
  "vm_memory": "2048",
  "vm_name": "test_rest_prov_B2qNFMMOuF"}}

This error is given:

{
"error":{
"kind": "internal_server_error",
"message": "Provision failed for the following reasons:\n'Network/Virtual NIC Profile ID or Profile Name (Network Name)' is required",
"klass": "RuntimeError"
}
}

This is the expected error.

It is not ideal error message, 
since the field in restapi body is called "vlan",
while the error refer to "Network",
but this is understandable, considering this field serve all providers,
and will require a cross platform change.

Comment 15 errata-xmlrpc 2018-07-12 13:15:09 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-2018:2184


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