Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1578393 - Improving the error message of provisioning a VM via rest api with wrong vlan value
Improving the error message of provisioning a VM via rest api with wrong vlan...
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API (Show other bugs)
5.9.0
Unspecified Unspecified
low Severity high
: GA
: 5.9.3
Assigned To: Alona Kaplan
Martin Kourim
api:rest:provisioning
: ZStream
Depends On: 1541036
Blocks: 1561041
  Show dependency treegraph
 
Reported: 2018-05-15 09:31 EDT by Satoe Imaishi
Modified: 2018-07-12 09:15 EDT (History)
10 users (show)

See Also:
Fixed In Version: 5.9.3.1
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1541036
Environment:
Last Closed: 2018-07-12 09:15:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: RHEVM


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Github ManageIQ/manageiq/pull/17306 None None None 2018-05-15 09:31 EDT
Red Hat Product Errata RHSA-2018:2184 None None None 2018-07-12 09:15 EDT

  None (edit)
Comment 2 CFME Bot 2018-05-15 09:35:55 EDT
New commit detected on ManageIQ/manageiq/gaprindashvili:

https://github.com/ManageIQ/manageiq/commit/cfed918a101926ee63ede49932ecf018eeb6f434
commit cfed918a101926ee63ede49932ecf018eeb6f434
Author:     Adam Grare <agrare@redhat.com>
AuthorDate: Tue Apr 17 09:10:52 2018 -0400
Commit:     Adam Grare <agrare@redhat.com>
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 07:02:09 EDT
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 06:34:06 EDT
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 09:11:13 EDT
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 03:57:27 EDT
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 11:51:44 EDT
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/159e36074a874ca159ac5e0055f532c7f40bd380
commit 159e36074a874ca159ac5e0055f532c7f40bd380
Author:     Alona Kaplan <alkaplan@redhat.com>
AuthorDate: Wed May 30 07:38:36 2018 -0400
Commit:     Alona Kaplan <alkaplan@redhat.com>
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 16:16:36 EDT
New commit detected on ManageIQ/manageiq/gaprindashvili:

https://github.com/ManageIQ/manageiq/commit/fdd5b2e568e52042ccb233cff19b0dd08b3e5482
commit fdd5b2e568e52042ccb233cff19b0dd08b3e5482
Author:     Adam Grare <agrare@redhat.com>
AuthorDate: Wed May 30 11:49:19 2018 -0400
Commit:     Adam Grare <agrare@redhat.com>
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 07:42:24 EDT
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@sample.com",
  "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 09:15:09 EDT
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.