Create empty volume when snapshot id is "" or srv volume is ""

Bug #1302609 reported by ling-yun
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Unassigned

Bug Description

When call create volume api with image id "", it will create an empty volume.
But when create volume with snapshot id "" or srv volume "", it will return an 404 error.
So we should create an empty volume when call create volume api with snapshot id "" or srv volume "".

ling-yun (zengyunling)
Changed in cinder:
assignee: nobody → ling-yun (zengyunling)
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/85357

Changed in cinder:
status: New → In Progress
Revision history for this message
John Griffith (john-griffith) wrote :

I think the fact that the image-id argument accepts an empty string and creates the volume is *the* bug. The other items behave as I would expect and should not be changed.

We should file a new bug that the image-id behavior is wrong.

Changed in cinder:
status: In Progress → Invalid
Revision history for this message
Thang Pham (thang-pham) wrote :

I believe you might have gotten the solution backwards. If you specify an image-id to create the volume from, and it is NULL or not defined, cinder should print out an error (similar to snapshot-id = ''):

$ cinder create --snapshot-id '' --name volume3 2
ERROR: snapshot id: not found (HTTP 404) (Request-ID: req-5bc0b46f-2348-486f-8d9e-92ed76b362d3)

Changed in cinder:
status: Invalid → In Progress
Revision history for this message
John Griffith (john-griffith) wrote :

@Thang Pham
I *think* we said the same thing in comments #2 and #3. Regardless it seems we both agree that we should raise an error when "null" or "empy" string is provided for the id of src, image or snapshot so we should make a bug that's very clear about that.

Changed in cinder:
status: In Progress → Invalid
Changed in cinder:
status: Invalid → In Progress
Mike Perez (thingee)
Changed in cinder:
status: In Progress → Invalid
Changed in cinder:
status: Invalid → In Progress
Mike Perez (thingee)
Changed in cinder:
assignee: ling-yun (zengyunling) → nobody
status: In Progress → Invalid
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/85357
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=eacab523be3d8f2f97809c785dba98e5e2e75c7b
Submitter: Jenkins
Branch: master

commit eacab523be3d8f2f97809c785dba98e5e2e75c7b
Author: ling-yun <email address hidden>
Date: Fri Apr 4 21:58:14 2014 +0800

    Create volume fail when image id is ""

    When call create volume api with image id "", it will create an empty
    volume.
    But when create volume with snapshot id "" or srv volume "", it will
    return an 404 error.
    So it should create volume fail when call create volume api with image id
    "".

    Change-Id: If2c7b061753bbbd172a09d35b343e73e90a1b7b4
    Closes-Bug: #1302609

Changed in cinder:
status: Invalid → Fix Committed
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix proposed to cinder (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/88547

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

Other bug subscribers

Remote bug watches

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