Nova responses unexpected error messages when fail to create flavor

Bug #1350751 reported by Wang Bo
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Wang Bo

Bug Description

The response message is unexpected(not easy to understand) if the requested resource exceeded limitation when to create new flavor. Following are examples:

1. requested ram exceeded limitation:
Run "nova --debug flavor-create ram_test 10 9999999999 20 1", the response info is:
RESP BODY: {"badRequest": {"message": "Invalid input received: memory_mb must be <= 2147483647", "code": 400}}

2. requested disk exceeded limitation:
nova --debug flavor-create ram_test 10 1024 2000000000000000000 1
RESP BODY: {"badRequest": {"message": "Invalid input received: root_gb must be <= 2147483647", "code": 400}}

I think "memory_mb" and "root_gb" in above response messages are unexpected, "ram" and "disk" could be better to user.

Hope for your comments. Thanks!

Tags: api
Revision history for this message
Wang Bo (chestack) wrote :

Why codes use "memory_mb, root_gb" because they are columns in db table instances_types. We should keep that code, only need update code here: https://github.com/openstack/nova/blob/master/nova/compute/flavors.py#L135 to change the response message from "memory_mb" and "root_gb" to "ram" and "disk" or other expected info.

Changed in nova:
assignee: nobody → Wang Bo (chrische)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/110891

Changed in nova:
status: New → In Progress
Matt Riedemann (mriedem)
tags: added: api
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/110891
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=045b2cce1414adab88ba30a8cad2d7a8419d9720
Submitter: Jenkins
Branch: master

commit 045b2cce1414adab88ba30a8cad2d7a8419d9720
Author: wangbo <email address hidden>
Date: Thu Jul 31 18:06:32 2014 +0800

    Update RESP message when failed to create flavor

    The response message is unexpected(not easy to understand),if
    requested resource exceeded limitation when to create flavor.
    Because the error message used DB model fields but not that
    used by API body. Such as following response message:
    "Invalid input received: memory_mb must be <= 2147483647"
    'memory_mb' is DB model field but 'ram' used in REST API

    Change "memory_mb" to "ram", "root_gb" to "disk" and
    "ephemeral_gb" to "ephemeral".

    Change-Id: I43e2f307d21325a6b54815edf157f3d5fa1135e5
    Fixes: bug #1350751

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-3 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.