Zun

volumeLimitExceed need to report the error to user

Bug #1735335 reported by Kevin Zhao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zun
Fix Committed
Undecided
Kevin Zhao

Bug Description

When create many volumes, and reach the limit of the volume number, run a container with volume will failed with:
stack@zun-aio:~$ zun run -i --mount destination=/data,size=5 --mount destination=/data0,size=5 ubuntu bash
ERROR: Internal Server Error (HTTP 500) (Request-ID: req-f88b4152-ebb4-42ea-8496-7d0979d239e3)

The internal server error is not an instruction for the error. Need to catch it and raise special exception.

11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 ERROR zun.common.exception [req-2491c18b-46aa-4043-9a7a-6a70eea9ad1d admin admin] 3cc88e51-02f9-488e-90c4-2098f02012f4:VolumeLimitExceeded: Maximum number of volumes allowed (10) exceeded for quota 'volumes'. (HTTP 413) (Request-ID: req-6f1969e1-38ca-4f6e-b824-7de39c67e9b5): OverLimit: VolumeLimitExceeded: Maximum number of volumes allowed (10) exceeded for quota 'volumes'. (HTTP 413) (Request-ID: req-6f1969e1-38ca-4f6e-b824-7de39c67e9b5)
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception Traceback (most recent call last):
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception File "/opt/stack/zun/zun/common/exception.py", line 110, in wrapped
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception return func(*args, **kwargs)
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception File "/opt/stack/zun/zun/common/validation/__init__.py", line 55, in wrapper
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception return func(*args, **kwargs)
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception File "/opt/stack/zun/zun/common/validation/__init__.py", line 33, in wrapper
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception return func(*args, **kwargs)
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception File "/opt/stack/zun/zun/api/controllers/v1/containers.py", line 259, in post
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception requested_volumes = self._build_requested_volumes(context, mounts)
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception File "/opt/stack/zun/zun/api/controllers/v1/containers.py", line 436, in _build_requested_volumes
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception volume = cinder_api.create_volume(mount['size'])
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception File "/opt/stack/zun/zun/volume/cinder_api.py", line 139, in create_volume
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception volume = self.cinder.volumes.create(size)
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception File "/usr/local/lib/python2.7/dist-packages/cinderclient/v3/volumes.py", line 114, in create
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception return self._create('/volumes', body, 'volume')
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception File "/usr/local/lib/python2.7/dist-packages/cinderclient/base.py", line 324, in _create
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception resp, body = self.api.client.post(url, body=body)
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception File "/usr/local/lib/python2.7/dist-packages/cinderclient/client.py", line 202, in post
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception return self._cs_request(url, 'POST', **kwargs)
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception File "/usr/local/lib/python2.7/dist-packages/cinderclient/client.py", line 190, in _cs_request
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception return self.request(url, method, **kwargs)
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception File "/usr/local/lib/python2.7/dist-packages/cinderclient/client.py", line 176, in request
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception raise exceptions.from_response(resp, body)
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception OverLimit: VolumeLimitExceeded: Maximum number of volumes allowed (10) exceeded for quota 'volumes'. (HTTP 413) (Request-ID: req-6f1969e1-38ca-4f6e-b824-7de39c67e9b5)
11月 30 13:45:21 zun-aio <email address hidden>[698]: 2017-11-30 13:45:21.841 TRACE zun.common.exception

Kevin Zhao (kevin-zhao)
Changed in zun:
assignee: nobody → Kevin Zhao (kevin-zhao)
status: New → Invalid
Revision history for this message
hongbin (hongbin034) wrote :

Kevin, this bug looks valid. Any reason you marked it as invalid?

Revision history for this message
Kevin Zhao (kevin-zhao) wrote :

Hi Hongbin,
I've already fixed the bug by patch:
https://review.openstack.org/523283

So it's better to mark it as completed. Invalid is not accuracy

Changed in zun:
status: Invalid → Fix Committed
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.