'Creates a new volume.'

@wsgi.response(http_client.OK)
def create(self, req, body):

    if ((body is None) or (not body.get('volume')) or (not isinstance(body['volume'], dict))):
        raise exc.HTTPUnprocessableEntity()
    image_id = None
    if body.get('volume'):
        image_id = body['volume'].get('imageRef')
    try:
        return _volume_v2_to_v1(super(VolumeController, self).create(req, body), image_id=image_id)
    except exc.HTTPBadRequest as e:
        error_msg = ('%s' % e)
        if ('Invalid    image' in error_msg):
            raise
        raise exc.HTTPUnprocessableEntity()
