Tempest fails to create an volume with imageRef in test_volume_create_get_update_delete_from_image due to 1G size doesn't match the actual image 5G size

Bug #1293885 reported by Jerry Cai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Medium
Jerry Cai

Bug Description

I got this failure when run the tempest case in test_volumes_get.py#_volume_create_get_update_delete

------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/stack/tempest/tempest/test.py", line 100, in wrapper
    return f(self, *func_args, **func_kwargs)
  File "/opt/stack/tempest/tempest/api/volume/test_volumes_get.py", line 155, in test_volume_create_get_update_delete_from_image
    self._volume_create_get_update_delete(imageRef=CONF.compute.image_ref)
  File "/opt/stack/tempest/tempest/api/volume/test_volumes_get.py", line 57, in _volume_create_get_update_delete
    **kwargs)
  File "/opt/stack/tempest/tempest/services/volume/xml/volumes_client.py", line 152, in create_volume
    resp, body = self.post('volumes', str(common.Document(volume)))
  File "/opt/stack/tempest/tempest/common/rest_client.py", line 199, in post
    return self.request('POST', url, headers, body)
  File "/opt/stack/tempest/tempest/common/rest_client.py", line 374, in request
    resp, resp_body)
  File "/opt/stack/tempest/tempest/common/rest_client.py", line 423, in _error_checker
    raise exceptions.BadRequest(resp_body)
BadRequest: Bad request
Details: {'message': 'Invalid input received: Size of specified image 5GB is larger than volume size 1GB.', 'code': '400'}
------------------------------------------------------------
This is because when create a volume with imageRef set and the image size is not equals with 1 (hardcoded which is incorrect),
it will fail with the exception above.
Workaround is to change the tempest code:
In _volume_create_get _update_delete()
set size={image_size} if "imageRef" is not None

I would try to fix this.

Jerry Cai (caimin)
Changed in tempest:
assignee: nobody → Jerry Cai (caimin)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

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

Changed in tempest:
status: New → In Progress
Changed in tempest:
importance: Undecided → Medium
Revision history for this message
Matthew Treinish (treinish) wrote :

So this is a bug because the volume size is hard coded to 1G and images specified in the config can potentially exceed that size. I think the best fix here is to probably add a new volume create size config option to let the user specify the size of volumes created by volume tests.

Having tempest dynamically determine the volume size is not desired behaviour because it has potential implications on disk size and quotas in ci systems. In this case it's better to be explicit about what the behavior is expected to be.

Revision history for this message
Jerry Cai (caimin) wrote :

@treinish, agree, revised and submitted for review again.

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

Reviewed: https://review.openstack.org/81471
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=9733d0e1520cae67e084ee63da98aa3de4be840e
Submitter: Jenkins
Branch: master

commit 9733d0e1520cae67e084ee63da98aa3de4be840e
Author: Jerry Cai <email address hidden>
Date: Wed Mar 19 15:50:49 2014 +0800

    Volume size could be specified to create volume

    1. Provide a "volume_size" config at VolumeGroup
    2. Make size as optional prameter, modify all volumes_client to
    read the size from CONf if size is None.
    3. Modify the testcase: test_volume_create_get_update
    _delete_from_image to call create_volume with no size
    parameter specified.

    Change-Id: I2897f6d6bd970f73867f56d9d23a768cafcbfd80
    Closes-Bug: #1293885

Changed in tempest:
status: In Progress → Fix Released
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.