test_volume_create_get_update_delete_from_image failed when imageRef in tempest.conf is larger than 1G

Bug #1289118 reported by Chen Xiao
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Undecided
Markus Zoeller (markus_z)

Bug Description

======================================================================
FAIL: tempest.api.volume.test_volumes_get.VolumesGetTestXML.test_volume_create_get_update_delete_from_image[gate,image,smoke]
----------------------------------------------------------------------
_StringException: pythonlogging:'': {{{
2014-03-05 06:45:48,511 Request: POST http://10.11.0.16:8776/v1/40c4f775eaa44c6e94ae1f947ea715d0/volumes
2014-03-05 06:45:48,511 Request Headers: {'Content-Type': 'application/xml', 'Accept': 'application/xml', 'X-Auth-Token': '<Token omitted>'}
2014-03-05 06:45:48,512 Request Body: <?xml version="1.0" encoding="UTF-8"?>
<volume xmlns="http://docs.openstack.org/compute/api/v1.1" display_name="Volume-1986524606" imageRef="d0a3fb96-a216-4fcb-a4ab-256b387ea901" size="1"><metadata ><meta key="Type">Test</meta></metadata></volume>
2014-03-05 06:45:48,869 Response Status: 400
2014-03-05 06:45:48,870 Nova request id: req-1ee52e5c-f44d-46ca-84da-bff9cad930b8
2014-03-05 06:45:48,870 Response Headers: {'content-length': '208', 'date': 'Wed, 05 Mar 2014 12:45:48 GMT', 'content-type': 'application/xml; charset=UTF-8', 'connection': 'close', 'x-openstack-request-id': 'req-1ee52e5c-f44d-46ca-84da-bff9cad930b8'}
2014-03-05 06:45:48,870 Response Body: <badRequest code="400" xmlns="http://docs.openstack.org/volume/api/v1"><message>CN-5805C53 Invalid input received: Size of specified image 2GB is larger than volume size 1GB.</message></badRequest>
}}}

Traceback (most recent call last):
  File "/tempest/tempest/test.py", line 101, in wrapper
    return f(self, *func_args, **func_kwargs)
  File "/tempest/tempest/api/volume/test_volumes_get.py", line 130, in test_volume_create_get_update_delete_from_image
    self._volume_create_get_update_delete(imageRef=CONF.compute.image_ref)
  File "/tempest/tempest/api/volume/test_volumes_get.py", line 58, in _volume_create_get_update_delete
    **kwargs)
  File "/tempest/tempest/services/volume/xml/volumes_client.py", line 154, in create_volume
    resp, body = self.post('volumes', str(Document(volume)))
  File "/tempest/tempest/common/rest_client.py", line 184, in post
    return self.request('POST', url, headers, body)
  File "/tempest/tempest/common/rest_client.py", line 360, in request
    resp, resp_body)
  File "/tempest/tempest/common/rest_client.py", line 409, in _error_checker
    raise exceptions.BadRequest(resp_body)
BadRequest: Bad request
Details: {'message': ' Invalid input received: Size of specified image 2GB is larger than volume size 1GB.', 'code': '400'}

Revision history for this message
Chen Xiao (chenxiao) wrote :

Should add Configuration items about size setting in tempest.conf if test creating volume from image.

Changed in tempest:
assignee: nobody → Chen Xiao (chenxiao)
status: New → In Progress
Revision history for this message
Jordan Pittier (jordan-pittier) wrote :

We already have tons of tempest config flag.

I've also run into this issue, and conclude that using a Cirros for tempest works great. If you can't have a cirrOS in your env, maybe you could start a discussion to set the default volume-size to 2G instead of 1G but this would have potentially impacts on the Gate.

Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

The configuration parameter ``CONF.volume.volume_size`` is not considered on every place, e.g.

https://github.com/openstack/tempest/blob/master/tempest/api/volume/base.py#L94
https://github.com/openstack/tempest/blob/master/tempest/api/volume/test_volumes_get.py#L107

These places (and others) still use hardcoded volume sizes of 1.

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/159878

Changed in tempest:
assignee: Chen Xiao (chenxiao) → Markus Zoeller (mzoeller)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/159878
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=3d2a21ccfdcf84bbb16fe192061250f6eea6f84a
Submitter: Jenkins
Branch: master

commit 3d2a21ccfdcf84bbb16fe192061250f6eea6f84a
Author: Markus Zoeller <email address hidden>
Date: Fri Feb 27 12:04:22 2015 +0100

    Replaces hardcoded volume size by configured value

    The volume_create methods used a hardcoded volume_size of 1GB. The
    configured volume_size wasn't used on each place. If one used a
    configured image_ref with a volume_size > 1GB this would result in an
    error.
    This patch replaces all occurrences of the hardcoded volume_size by
    the configured value.

    Closes-Bug: 1289118
    Change-Id: I99cf80e4078eec6a5021793b664b6cfcf02d2988

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.