I've run into this bug as well. As the comment of Alexander described, the swiftclient lib does know how to connect to radosgw, so the bug is in the Ironic part getting the tempurl. I spent some time searching and I came to the following dirty trick:
In the file common/glance_service/v2/image_service.py I've added 2 lines:
========================================================================
In the function swift_temp_url:
========================================================================
if CONF.deploy.object_store_endpoint_type == 'radosgw':
chunks = urlparse.urlsplit(CONF.glance.swift_endpoint_url)
if not chunks.path: endpoint_url = urlparse.urljoin( endpoint_url, 'swift')
elif chunks.path != '/swift': raise exc.InvalidParameterValue( _('Swift endpoint URL should only contain scheme, ' 'hostname, optional port and optional /swift path ' 'without trailing slash; provided value is: %s') % endpoint_url)
*** template = '/swift/{api_version}/{container}/{object_id}' ****
else: template = '/{api_version}/{account}/{container}/{object_id}'
========================================================================
And in the function _generate_temp_url
========================================================================
if CONF.glance.swift_temp_url_cache_enabled:
self._remove_expired_items_from_cache()
if image_id in self._cache:
return self._cache[image_id].url
The url_path variable delivered by the swift_temp_url function (from glance), which is e.g. /v1/glance_images/21893723873. The swiftclient doesn't like this and needs the /swift in front like this: /swift/v1/glance_images/21893723873.
To achieve this I've changed the template var in the if statement detecting radosgw and changed the endpoint url var in the _generate_temp_url function to the swift_endpoint_url in de conf file, which you need to set anyway
I've run into this bug as well. As the comment of Alexander described, the swiftclient lib does know how to connect to radosgw, so the bug is in the Ironic part getting the tempurl. I spent some time searching and I came to the following dirty trick:
In the file common/ glance_ service/ v2/image_ service. py I've added 2 lines:
======= ======= ======= ======= ======= ======= ======= ======= ======= ======= == ======= ======= ======= ======= ======= ======= ======= ======= ======= == object_ store_endpoint_ type == 'radosgw': urlsplit( CONF.glance. swift_endpoint_ url)
endpoint_ url = urlparse.urljoin(
endpoint_ url, 'swift')
raise exc.InvalidPara meterValue(
_ ('Swift endpoint URL should only contain scheme, '
'hostname, optional port and optional /swift path '
'without trailing slash; provided value is: %s')
% endpoint_url) {api_version} /{container} /{object_ id}' ****
template = '/{api_ version} /{account} /{container} /{object_ id}'
In the function swift_temp_url:
=======
if CONF.deploy.
chunks = urlparse.
if not chunks.path:
elif chunks.path != '/swift':
*** template = '/swift/
else:
======= ======= ======= ======= ======= ======= ======= ======= ======= ======= == ======= ======= ======= ======= ======= ======= ======= ======= ======= == swift_temp_ url_cache_ enabled: _remove_ expired_ items_from_ cache() image_id] .url
And in the function _generate_temp_url
=======
if CONF.glance.
self.
if image_id in self._cache:
return self._cache[
path = swift_utils. generate_ temp_url(
path=path, seconds=seconds, key=key, method=method)
***endpoint= CONF.glance. swift_endpoint_ url ***
temp_url = '{endpoint_ url}{url_ path}'. format( url=endpoint, url_path=path)
endpoint_
======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ==
Before, it gets the endpoint variable from keystone, which is http:// 1.2.3.4: 8080/swift/ v1 1.2.3.4: 8080/swift and gives this to the _generate_temp_url function.
the swift_temp_url strips this down to http://
The url_path variable delivered by the swift_temp_url function (from glance), which is e.g. /v1/glance_ images/ 21893723873. The swiftclient doesn't like this and needs the /swift in front like this: /swift/ v1/glance_ images/ 21893723873.
To achieve this I've changed the template var in the if statement detecting radosgw and changed the endpoint url var in the _generate_temp_url function to the swift_endpoint_url in de conf file, which you need to set anyway