当前位置:   article > 正文

openstack 上传glance镜像失败 解决_上传 cirros-0.3.4-x86_64-disk.img 报错404

上传 cirros-0.3.4-x86_64-disk.img 报错404
[root@controller ~]# glance image-create --name "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2  --container-format bare --visibility public --progress
  • 1

执行报错

503 Service Unavailable: The server is currently unavailable. Please try again at a later time. (HTTP 503)
  • 1

查看日志文件

[root@controller ~]# tail /var/log/glance/api.log 

2019-12-14 15:43:04.985 20004 INFO glance.common.wsgi [-] Child 20004 exiting normally
2019-12-14 15:45:38.483 1059 WARNING keystonemiddleware.auth_token [-] Use of the auth_admin_prefix, auth_host, auth_port, auth_protocol, identity_uri, admin_token, admin_user, admin_password, and admin_tenant_name configuration options is deprecated in favor of auth_plugin and related options and may be removed in a future release.
2019-12-14 15:45:38.486 1059 WARNING keystonemiddleware.auth_token [-] Configuring admin URI using auth fragments. This is deprecated, use 'identity_uri' instead.
2019-12-14 15:45:38.887 1059 INFO glance.common.wsgi [-] Starting 1 workers
2019-12-14 15:45:38.898 1059 INFO glance.common.wsgi [-] Started child 1869
2019-12-14 15:45:38.959 1869 INFO eventlet.wsgi.server [-] (1869) wsgi starting up on http://0.0.0.0:9292/
2019-12-14 16:39:29.378 1869 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}
2019-12-14 16:39:34.773 1869 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}
2019-12-14 16:39:34.776 1869 CRITICAL keystonemiddleware.auth_token [-] Unable to validate token: Identity server rejected authorization necessary to fetch token data
2019-12-14 16:39:34.811 1869 INFO eventlet.wsgi.server [-] 192.168.163.172 - - [14/Dec/2019 16:39:34] "GET /v2/schemas/image HTTP/1.1" 503 370 16.919333
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

加入debug

glance --debug image-create --name "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2  --container-format bare --visibility public --progress 
curl -g -i -X GET -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'X-Auth-Token: {SHA1}efdd5e8a6fd691f33b92f2ef3a846b2e8e6bac1b' -H 'Connection: keep-alive' -H 'User-Agent: python-glanceclient' -H 'Content-Type: application/octet-stream' http://controller:9292/v2/schemas/image
Request returned failure status 503.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/glanceclient/shell.py", line 700, in main
    args.func(client, args)
  File "/usr/lib/python2.7/site-packages/glanceclient/common/utils.py", line 96, in func_wrapper
    return func(gc, args)
  File "/usr/lib/python2.7/site-packages/glanceclient/v2/shell.py", line 62, in do_image_create
    schema = gc.schemas.get("image")
  File "/usr/lib/python2.7/site-packages/glanceclient/v2/schemas.py", line 125, in get
    _, raw_schema = self.http_client.get(uri)
  File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 280, in get
    return self._request('GET', url, **kwargs)
  File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 272, in _request
    resp, body_iter = self._handle_response(resp)
  File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 93, in _handle_response
    raise exc.from_response(resp, resp.content)
HTTPServiceUnavailable: 503 Service Unavailable: The server is currently unavailable. Please try again at a later time. (HTTP 503)
503 Service Unavailable: The server is currently unavailable. Please try again at a later time. (HTTP 503)

[root@controller ~]# tail /var/log/glance/api.log 
2019-12-14 16:58:46.616 5387 INFO glance.common.wsgi [-] Started child 5409
2019-12-14 16:58:46.723 5409 INFO eventlet.wsgi.server [-] (5409) wsgi starting up on http://0.0.0.0:9292/
2019-12-14 16:59:03.339 5409 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}
2019-12-14 16:59:03.794 5409 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}
2019-12-14 16:59:03.794 5409 CRITICAL keystonemiddleware.auth_token [-] Unable to validate token: Identity server rejected authorization necessary to fetch token data
2019-12-14 16:59:03.814 5409 INFO eventlet.wsgi.server [-] 192.168.163.172 - - [14/Dec/2019 16:59:03] "GET /v2/schemas/image HTTP/1.1" 503 370 4.363476
2019-12-14 17:00:27.582 5409 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}
2019-12-14 17:00:27.902 5409 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}
2019-12-14 17:00:27.903 5409 CRITICAL keystonemiddleware.auth_token [-] Unable to validate token: Identity server rejected authorization necessary to fetch token data
2019-12-14 17:00:27.921 5409 INFO eventlet.wsgi.server [-] 192.168.163.172 - - [14/Dec/2019 17:00:27] "GET /v2/schemas/image HTTP/1.1" 503 370 0.674821
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32

发现是 /etc/glance/glance-registry.conf glance-api.conf 的问题
干脆删掉重来

#glance-registry.conf
[DEFAULT]
notification_driver = noop
verbose = True
[database]
connection = mysql://glance:123456@controller/glance
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = 123456
[paste_deploy]
flavor = keystone
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
#glance-api.conf
[DEFAULT]
notification_driver = noop
verbose = True
[database]
connection = mysql://glance:123456@controller/glance
[glance_store]
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = 123456
[paste_deploy]
flavor = keystone
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

重启服务

[root@controller ~]#systemctl restart openstack-glance-api.service openstack-glance-registry.service

[root@controller ~]# glance image-create --name "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2  --container-format bare --visibility public --progress
[=============================>] 100%
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | ee1eca47dc88f4879d8a229cc70a07c6     |
| container_format | bare                                 |
| created_at       | 2019-12-14T09:12:16Z                 |
| disk_format      | qcow2                                |
| id               | d4907b29-4d2a-4da8-ad71-e6370ef1f2b8 |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | cirros                               |
| owner            | a4ba22b6b3c4412a9c7d001963538101     |
| protected        | False                                |
| size             | 13287936                             |
| status           | active                               |
| tags             | []                                   |
| updated_at       | 2019-12-14T09:12:17Z                 |
| virtual_size     | None                                 |
| visibility       | public                               |
+------------------+--------------------------------------+
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/77773
推荐阅读
相关标签
  

闽ICP备14008679号