Ask Your Question

Revision history [back]

Hi,

I also hit the same and got 502 error (seen below). looks like this the example in https://docs.openstack.org/python-glanceclient/latest/reference/apiv2.html 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 "test-glance.py", line 40, in <module> glance.images.upload(image.id, open(IMAGE_FILE, 'rb')) File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/utils.py", line 545, in inner return RequestIdProxy(wrapped(args, *kwargs)) File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/images.py", line 232, in upload resp, body = self.http_client.put(url, headers=hdrs, data=body) File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 313, in put return self.request(url, 'PUT', **kwargs) File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line 349, in request return self._handle_response(resp) File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", 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 10.99.162.38 Port 80 (HTTP 502)