Volume is getting created even with size value zero

Bug #1006875 reported by Rajalakshmi Ganesan
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Low
Mike Perez
OpenStack Compute (nova)
Fix Released
Low
Mike Perez

Bug Description

Volume creation should not happen when size parameter value is zero. But the volume is reaching available status even when size is zero.

Expected Result:
Should throw bad request error i.e code 400 should be returned

Actual Result:
The procees is successful and code of 200 is returned.

LOG:
------

REQ: curl -i http://10.233.52.27:8774/v2/72bf0c9efd60493a9aacfc1ab13f4fad/os-volumes -X POST -H "X-Auth-Project-Id: demo" -H "User-Agent: python-novaclient" -H "Content-Type: application/json" -H "X-Auth-Token: 2af929b122604bd1bd12d2a95018df7e"

REQ BODY: {"volume": {"size": "0", "display_name": "auto_hpcs_vol", "display_description": "volumedes", "metadata": {"Type": "Work"}}}

RESP:{'date': 'Thu, 31 May 2012 18:15:43 GMT', 'status': '200', 'x-compute-request-id': 'req-f8bfbc73-b480-4a1a-93cc-9feb50fee263', 'content-type': 'application/json', 'content-length': '272'} {"volume": {"status": "creating", "displayDescription": "volumedes", "availabilityZone": "nova", "displayName": "auto_hpcs_vol", "attachments": [{}], "volumeType": null, "snapshotId": null, "size": "0", "id": 10, "createdAt": "2012-05-31 18:15:43.464923", "metadata": {}}}

--- START OF RESPONSE ---
{ u'volume': { u'attachments': [{ }],
                   u'availabilityZone': u'nova',
                   u'createdAt': u'2012-05-31 18:15:43.464923',
                   u'displayDescription': u'volumedes',
                   u'displayName': u'auto_hpcs_vol',
                   u'id': 10,
                   u'metadata': { },
                   u'size': u'0',
                   u'snapshotId': None,
                   u'status': u'creating',
                   u'volumeType': None}}
--- ENF OF RESPONSE ---

Revision history for this message
Daryl Walleck (dwalleck) wrote :

Shouldn't this be in the Nova queue?

affects: tempest → nova
Vincent Hou (houshengbo)
Changed in nova:
status: New → Confirmed
Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Low
Mike Perez (thingee)
Changed in cinder:
status: New → Confirmed
Mike Perez (thingee)
Changed in cinder:
assignee: nobody → Mike Perez (thingee)
Mike Perez (thingee)
Changed in cinder:
status: Confirmed → In Progress
Mike Perez (thingee)
Changed in nova:
assignee: nobody → Mike Perez (thingee)
status: Confirmed → In Progress
Revision history for this message
Mike Perez (thingee) wrote :

I'm actually getting a 500 error from nova instead of a 200. This is also happening because nova will explicitly give a 500 error to hide stuff from the user. Going to need to talk to talk to someone about what we want to do for this case.

Cinder on the other hand is return a 400.

Changed in cinder:
status: In Progress → Invalid
Revision history for this message
Mike Perez (thingee) wrote :

To be more clear, cinder is returning a 200, because it'll create a do a 1gig volume by default. Running by Jgriffith if this should be expected.

Changed in cinder:
status: Invalid → Confirmed
Changed in cinder:
importance: Undecided → Low
Mike Perez (thingee)
Changed in cinder:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/10042
Committed: http://github.com/openstack/cinder/commit/635f1498757d5ab8a0a8957d6e5aafaf3ceee022
Submitter: Jenkins
Branch: master

commit 635f1498757d5ab8a0a8957d6e5aafaf3ceee022
Author: Mike Perez <email address hidden>
Date: Thu Jul 19 23:35:32 2012 -0700

    Don't create volumes if an incorrect size was given

    bug 1006875

    Change-Id: Ied4c6f6d03c0a70838e1e483d69f3ed1ec08a9b5

Changed in cinder:
status: In Progress → Fix Committed
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/10064

Mike Perez (thingee)
Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/10064
Committed: http://github.com/openstack/nova/commit/ac5df2277968598914aeb803f5d7b57fabe876f0
Submitter: Jenkins
Branch: master

commit ac5df2277968598914aeb803f5d7b57fabe876f0
Author: Mike Perez <email address hidden>
Date: Fri Jul 20 09:12:50 2012 -0700

    Don't create volumes if an incorrect size was given

    backported from cinder

    bug 1006875

    Change-Id: I5f327dc0278413575e8c686b2db3b6000f19c4c7

Revision history for this message
Rajalakshmi Ganesan (rajalakshmi-ganesan) wrote :

Have verified this bug after fix-commit. The bug is resolved as expected.

LOG after fix:

rajalakshmi_ganesan@ubuntu:~/tempest_26july/tempest/tempest/tests/compute$ nova volume-create 0
Invalid input received: Volume size must be an integer and greater than 0 (HTTP 400)
rajalakshmi_ganesan@ubuntu:~/tempest_26july/tempest/tempest/tests/compute$ nova volume-create ''
usage: nova volume-create [--snapshot_id <snapshot_id>]
                          [--display_name <display_name>]
                          [--display_description <display_description>]
                          <size>
nova volume-create: error: argument <size>: invalid int value: ''
rajalakshmi_ganesan@ubuntu:~/tempest_26july/tempest/tempest/tests/compute$ nova volume-create '!@#$%'
usage: nova volume-create [--snapshot_id <snapshot_id>]
                          [--display_name <display_name>]
                          [--display_description <display_description>]
                          <size>
nova volume-create: error: argument <size>: invalid int value: '!@#$%'
rajalakshmi_ganesan@ubuntu:~/tempest_26july/tempest/tempest/tests/compute$ nova volume-create 00
Invalid input received: Volume size must be an integer and greater than 0 (HTTP 400)
rajalakshmi_ganesan@ubuntu:~/tempest_26july/tempest/tempest/tests/compute$ nova volume-create '0'
Invalid input received: Volume size must be an integer and greater than 0 (HTTP 400)
rajalakshmi_ganesan@ubuntu:~/tempest_26july/tempest/tempest/tests/compute$

Hence closing the bug.

Changed in cinder:
status: Fix Committed → Fix Released
Changed in nova:
status: Fix Committed → Fix Released
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.