not validate a metadata type when creating a vm instance
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Ken'ichi Ohmichi |
Bug Description
If specifying non-dict data(string, etc.) as metadata, "create a vm" API returns a HTTP500(Internal Server Error) response:
$ curl -i http://
ax_count": 1, "metadata": "string"}}'
HTTP/1.1 500 Internal Server Error
Content-Length: 128
Content-Type: application/json; charset=UTF-8
X-Compute-
Date: Thu, 10 Oct 2013 09:30:24 GMT
{"computeFault": {"message": "The server has either erred or is incapable of performing the requested operation.", "code": 500}}
$
The reason is that the API does not validate its metadata type.
The nova-api log is the following:
2013-10-10 18:30:24.226 TRACE nova.api.openstack action_result = self.dispatch(meth, request, action_args)
2013-10-10 18:30:24.226 TRACE nova.api.openstack File "/opt/stack/
2013-10-10 18:30:24.226 TRACE nova.api.openstack return method(req=request, **action_args)
2013-10-10 18:30:24.226 TRACE nova.api.openstack File "/opt/stack/
2013-10-10 18:30:24.226 TRACE nova.api.openstack legacy_
2013-10-10 18:30:24.226 TRACE nova.api.openstack File "/opt/stack/
2013-10-10 18:30:24.226 TRACE nova.api.openstack rv = f(*args, **kwargs)
2013-10-10 18:30:24.226 TRACE nova.api.openstack File "/opt/stack/
2013-10-10 18:30:24.226 TRACE nova.api.openstack legacy_
2013-10-10 18:30:24.226 TRACE nova.api.openstack File "/opt/stack/
2013-10-10 18:30:24.226 TRACE nova.api.openstack block_device_
2013-10-10 18:30:24.226 TRACE nova.api.openstack File "/opt/stack/
2013-10-10 18:30:24.226 TRACE nova.api.openstack instance_type, metadata, injected_files)
2013-10-10 18:30:24.226 TRACE nova.api.openstack File "/opt/stack/
2013-10-10 18:30:24.226 TRACE nova.api.openstack self._check_
2013-10-10 18:30:24.226 TRACE nova.api.openstack File "/opt/stack/
2013-10-10 18:30:24.226 TRACE nova.api.openstack for k, v in metadata.
2013-10-10 18:30:24.226 TRACE nova.api.openstack AttributeError: 'unicode' object has no attribute 'iteritems'
2013-10-10 18:30:24.226 TRACE nova.api.openstack
Changed in nova: | |
assignee: | nobody → Ken'ichi Ohmichi (oomichi) |
Changed in nova: | |
milestone: | none → icehouse-1 |
Changed in nova: | |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | icehouse-1 → 2014.1 |
Fix proposed to branch: master /review. openstack. org/51085
Review: https:/