Ask Your Question

Revision history [back]


I also hit the same and got 502 error (seen below). looks like this the example in need update and adding extra fields works for me...

image = glance.images.create(name=IMAGE_NAME,container_format='bare',disk_format='qcow2')

Traceback (most recent call last): File "", line 40, in <module> glance.images.upload(, open(IMAGE_FILE, 'rb')) File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/", line 545, in inner return RequestIdProxy(wrapped(args, *kwargs)) File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/", line 232, in upload resp, body = self.http_client.put(url, headers=hdrs, data=body) File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/", line 313, in put return self.request(url, 'PUT', **kwargs) File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/", line 349, in request return self._handle_response(resp) File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/", line 98, in _handle_response raise exc.from_response(resp, resp.content) glanceclient.exc.HTTPBadGateway: 502 Bad Gateway: Bad Gateway: The proxy server received an invalid: response from an upstream server.: Apache/2.4.18 (Ubuntu) Server at Port 80 (HTTP 502)