在openstack上传镜像的时候总是提示上传镜像错误,使用glance add命令上传后返回:
root@DevStackOSDomU:~# glance add name="ubuntu-13.04" is_public=true disk_format=vhd container_format=ovf < ~/precise-server-cloudimg-i386-disk1.img
Request returned failure status.
500 Internal Server Error
Failed to upload image f5459320-8fc0-4a92-ba53-b08d51920c1e
(HTTP 500)
出现HTTP 500错误,修改一下glance的配置文件/etc/glance/glance-api.conf和/etc/glance/glangce-registry.conf文件,设置一下使用系统的日志/var/log/glance文件夹中的日志文件,重新启动glance服务。
然后再上传镜像文件,可以查看到日志如下:
2013-11-26 14:43:20.257 2556 DEBUG glance.registry.client.v1.client [b738b8fc-4fab-4295-9a6a-c220312c73d7 1c6331c7964743388e9d27537fd56b8c 67b67cf299a54ff9b38bfc45743fd1e1] Registry request POST /images HTTP 200 request id req-91517d63-4005-4d53-81cf-f0a1f300b50d do_request /opt/stack/glance/glance/registry/client/v1/client.py:115
2013-11-26 14:43:20.259 2556 DEBUG glance.common.client [b738b8fc-4fab-4295-9a6a-c220312c73d7 1c6331c7964743388e9d27537fd56b8c 67b67cf299a54ff9b38bfc45743fd1e1] Constructed URL: http://0.0.0.0:9191/images/f5459320-8fc0-4a92-ba53-b08d51920c1e _construct_url /opt/stack/glance/glance/common/client.py:408
2013-11-26 14:43:20.272 2556 DEBUG glance.registry.client.v1.client [b738b8fc-4fab-4295-9a6a-c220312c73d7 1c6331c7964743388e9d27537fd56b8c 67b67cf299a54ff9b38bfc45743fd1e1] Registry request GET /images/f5459320-8fc0-4a92-ba53-b08d51920c1e HTTP 200 request id req-893ea6e9-4892-423d-b470-eda7dff9df40 do_request /opt/stack/glance/glance/registry/client/v1/client.py:115
2013-11-26 14:43:20.273 2556 DEBUG glance.api.v1.images [b738b8fc-4fab-4295-9a6a-c220312c73d7 1c6331c7964743388e9d27537fd56b8c 67b67cf299a54ff9b38bfc45743fd1e1] Setting image f5459320-8fc0-4a92-ba53-b08d51920c1e to status 'saving' _upload /opt/stack/glance/glance/api/v1/images.py:542
2013-11-26 14:43:20.274 2556 DEBUG glance.registry.client.v1.api [b738b8fc-4fab-4295-9a6a-c220312c73d7 1c6331c7964743388e9d27537fd56b8c 67b67cf299a54ff9b38bfc45743fd1e1] Updating image metadata for image f5459320-8fc0-4a92-ba53-b08d51920c1e... update_image_metadata /opt/stack/glance/glance/registry/client/v1/api.py:168
2013-11-26 14:43:20.274 2556 DEBUG glance.common.client [b738b8fc-4fab-4295-9a6a-c220312c73d7 1c6331c7964743388e9d27537fd56b8c 67b67cf299a54ff9b38bfc45743fd1e1] Constructed URL: http://0.0.0.0:9191/images/f5459320-8fc0-4a92-ba53-b08d51920c1e _construct_url /opt/stack/glance/glance/common/client.py:408
2013-11-26 14:43:20.298 2556 DEBUG glance.registry.client.v1.client [b738b8fc-4fab-4295-9a6a-c220312c73d7 1c6331c7964743388e9d27537fd56b8c 67b67cf299a54ff9b38bfc45743fd1e1] Registry request PUT /images/f5459320-8fc0-4a92-ba53-b08d51920c1e HTTP 200 request id req-7fc61b96-9a88-44a6-a9c9-91ce65f18f39 do_request /opt/stack/glance/glance/registry/client/v1/client.py:115
2013-11-26 14:43:20.298 2556 DEBUG glance.api.v1.images [b738b8fc-4fab-4295-9a6a-c220312c73d7 1c6331c7964743388e9d27537fd56b8c 67b67cf299a54ff9b38bfc45743fd1e1] Uploading image data for image f5459320-8fc0-4a92-ba53-b08d51920c1e to swift store _upload /opt/stack/glance/glance/api/v1/images.py:547
2013-11-26 14:43:20.326 2556 DEBUG keystoneclient.httpclient [-] REQ: curl -i -X POST https://192.168.1.128:5000/v2.0/tokens -H "Content-Type: application/json" -H "User-Agent: python-keystoneclient" request /opt/stack/python-keystoneclient/keystoneclient/httpclient.py:101
2013-11-26 14:43:20.327 2556 DEBUG keystoneclient.httpclient [-] REQ BODY: {"auth": {"tenantName": "service", "passwordCredentials": {"username": "glance", "password": "citrix"}}}
request /opt/stack/python-keystoneclient/keystoneclient/httpclient.py:105
2013-11-26 14:43:20.328 2556 INFO requests.packages.urllib3.connectionpool [-] Starting new HTTPS connection (1): 192.168.1.128
2013-11-26 14:43:20.528 2556 ERROR swiftclient [-] Authorization Failure. Authorization Failed: Unable to establish connection to https://192.168.1.128:5000/v2.0/tokens
2013-11-26 14:43:20.528 2556 TRACE swiftclient Traceback (most recent call last):
2013-11-26 14:43:20.528 2556 TRACE swiftclient File "/opt/stack/python-swiftclient/swiftclient/client.py", line 1105, in _retry
2013-11-26 14:43:20.528 2556 TRACE swiftclient self.url, self.token = self.get_auth()
2013-11-26 14:43:20.528 2556 TRACE swiftclient File "/opt/stack/python-swiftclient/swiftclient/client.py", line 1081, in get_auth
2013-11-26 14:43:20.528 2556 TRACE swiftclient insecure=self.insecure)
2013-11-26 14:43:20.528 2556 TRACE swiftclient File "/opt/stack/python-swiftclient/swiftclient/client.py", line 304, in get_auth
2013-11-26 14:43:20.528 2556 TRACE swiftclient insecure=insecure)
2013-11-26 14:43:20.528 2556 TRACE swiftclient File "/opt/stack/python-swiftclient/swiftclient/client.py", line 242, in get_keystoneclient_2_0
2013-11-26 14:43:20.528 2556 TRACE swiftclient raise ClientException('Authorization Failure. %s' % err)
2013-11-26 14:43:20.528 2556 TRACE swiftclient ClientException: Authorization Failure. Authorization Failed: Unable to establish connection to https://192.168.1.128:5000/v2.0/tokens
2013-11-26 14:43:20.528 2556 TRACE swiftclient
2013-11-26 14:43:20.530 2556 ERROR glance.api.v1.upload_utils [b738b8fc-4fab-4295-9a6a-c220312c73d7 1c6331c7964743388e9d27537fd56b8c 67b67cf299a54ff9b38bfc45743fd1e1] Failed to upload image f5459320-8fc0-4a92-ba53-b08d51920c1e
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils Traceback (most recent call last):
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils File "/opt/stack/glance/glance/api/v1/upload_utils.py", line 101, in upload_data_to_store
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils store)
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils File "/opt/stack/glance/glance/store/__init__.py", line 333, in store_add_to_backend
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils (location, size, checksum, metadata) = store.add(image_id, data, size)
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils File "/opt/stack/glance/glance/store/swift.py", line 339, in add
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils self._create_container_if_missing(location.container, connection)
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils File "/opt/stack/glance/glance/store/swift.py", line 500, in _create_container_if_missing
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils connection.head_container(container)
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils File "/opt/stack/python-swiftclient/swiftclient/client.py", line 1167, in head_container
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils return self._retry(None, head_container, container)
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils File "/opt/stack/python-swiftclient/swiftclient/client.py", line 1105, in _retry
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils self.url, self.token = self.get_auth()
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils File "/opt/stack/python-swiftclient/swiftclient/client.py", line 1081, in get_auth
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils insecure=self.insecure)
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils File "/opt/stack/python-swiftclient/swiftclient/client.py", line 304, in get_auth
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils insecure=insecure)
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils File "/opt/stack/python-swiftclient/swiftclient/client.py", line 242, in get_keystoneclient_2_0
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils raise ClientException('Authorization Failure. %s' % err)
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils ClientException: Authorization Failure. Authorization Failed: Unable to establish connection to https://192.168.1.128:5000/v2.0/tokens
2013-11-26 14:43:20.530 2556 TRACE glance.api.v1.upload_utils
2013-11-26 14:43:20.534 2556 DEBUG glance.registry.client.v1.api [b738b8fc-4fab-4295-9a6a-c220312c73d7 1c6331c7964743388e9d27537fd56b8c 67b67cf299a54ff9b38bfc45743fd1e1] Updating image metadata for image f5459320-8fc0-4a92-ba53-b08d51920c1e... update_image_metadata /opt/stack/glance/glance/registry/client/v1/api.py:168
2013-11-26 14:43:20.534 2556 DEBUG glance.common.client [b738b8fc-4fab-4295-9a6a-c220312c73d7 1c6331c7964743388e9d27537fd56b8c 67b67cf299a54ff9b38bfc45743fd1e1] Constructed URL: http://0.0.0.0:9191/images/f5459320-8fc0-4a92-ba53-b08d51920c1e _construct_url /opt/stack/glance/glance/common/client.py:408
2013-11-26 14:43:20.589 2556 DEBUG glance.registry.client.v1.client [b738b8fc-4fab-4295-9a6a-c220312c73d7 1c6331c7964743388e9d27537fd56b8c 67b67cf299a54ff9b38bfc45743fd1e1] Registry request PUT /images/f5459320-8fc0-4a92-ba53-b08d51920c1e HTTP 200 request id req-8b07e644-476d-476d-96f4-063c901973f7 do_request /opt/stack/glance/glance/registry/client/v1/client.py:115
|
|