分享

openstack手动安装时在glance中上传image出现了错误,请问如何解决

rocky123 发表于 2016-8-3 13:36:37 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 9 40192
错误如下:
[root@controller opt]# openstack --debug image create "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --public
START with options: ['--debug', 'image', 'create', 'cirros', '--file', 'cirros-0.3.4-x86_64-disk.img', '--disk-format', 'qcow2', '--container-format', 'bare', '--public']
options: Namespace(access_token_endpoint='', auth_type='', auth_url='http://controller:35357/v3', cacert='', client_id='', client_secret='***', cloud='', debug=True, default_domain='default', deferred_help=False, domain_id='', domain_name='', endpoint='', identity_provider='', identity_provider_url='', insecure=None, interface='', log_file=None, os_compute_api_version='', os_identity_api_version='3', os_image_api_version='2', os_network_api_version='', os_object_api_version='', os_project_id=None, os_project_name=None, os_volume_api_version='', password='***', profile=None, project_domain_id='', project_domain_name='default', project_id='', project_name='admin', protocol='', region_name='', scope='', service_provider_endpoint='', timing=False, token='***', trust_id='', url='', user_domain_id='', user_domain_name='default', user_id='', username='admin', verbose_level=3, verify=None)
defaults: {u'auth_type': 'password', u'compute_api_version': u'2', 'key': None, u'database_api_version': u'1.0', 'api_timeout': None, u'baremetal_api_version': u'1', u'image_api_version': u'2', 'cacert': None, u'image_api_use_tasks': False, u'floating_ip_source': u'neutron', u'orchestration_api_version': u'1', u'interface': None, u'network_api_version': u'2', u'image_format': u'qcow2', u'key_manager_api_version': u'v1', u'metering_api_version': u'2', 'verify': True, u'identity_api_version': u'2.0', u'volume_api_version': u'2', 'cert': None, u'secgroup_source': u'neutron', u'container_api_version': u'1', u'dns_api_version': u'2', u'object_store_api_version': u'1', u'disable_vendor_agent': {}}
cloud cfg: {'auth_type': 'password', u'compute_api_version': u'2', 'key': None, u'database_api_version': u'1.0', 'timing': False, u'network_api_version': u'2', u'image_format': u'qcow2', u'image_api_version': '2', 'verify': True, u'dns_api_version': u'2', u'object_store_api_version': u'1', 'verbose_level': 3, 'region_name': '', 'api_timeout': None, u'baremetal_api_version': u'1', 'auth': {'username': 'admin', 'project_name': 'admin', 'user_domain_name': 'default', 'auth_url': 'http://controller:35357/v3', 'password': '***', 'project_domain_name': 'default'}, 'default_domain': 'default', u'container_api_version': u'1', u'image_api_use_tasks': False, u'floating_ip_source': u'neutron', u'orchestration_api_version': u'1', u'interface': None, 'cacert': None, u'key_manager_api_version': u'v1', u'metering_api_version': u'2', 'deferred_help': False, u'identity_api_version': '3', u'volume_api_version': u'2', 'cert': None, u'secgroup_source': u'neutron', 'debug': True, u'disable_vendor_agent': {}}
compute API version 2, cmd group openstack.compute.v2
network API version 2, cmd group openstack.network.v2
image API version 2, cmd group openstack.image.v2
volume API version 2, cmd group openstack.volume.v2
identity API version 3, cmd group openstack.identity.v3
object_store API version 1, cmd group openstack.object_store.v1
command: image create -> openstackclient.image.v2.image.CreateImage
Auth plugin password selected
auth_type: password
Using auth plugin: password
Using parameters {'username': 'admin', 'project_name': 'admin', 'auth_url': 'http://controller:35357/v3', 'user_domain_name': 'default', 'password': '***', 'project_domain_name': 'default'}
Get auth_ref
REQ: curl -g -i -X GET http://controller:35357/v3 -H "Accept: application/json" -H "User-Agent: python-openstackclient keystoneauth1/2.4.1 python-requests/2.10.0 CPython/2.7.5"
Starting new HTTP connection (1): controller
"GET /v3 HTTP/1.1" 200 250
RESP: [200] Date: Wed, 03 Aug 2016 04:57:52 GMT Server: Apache/2.4.6 (CentOS) mod_wsgi/3.4 Python/2.7.5 Vary: X-Auth-Token x-openstack-request-id: req-11ad6851-f083-4cae-b46d-cf8d80bf96b7 Content-Length: 250 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: application/json
RESP BODY: {"version": {"status": "stable", "updated": "2016-04-04T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.6", "links": [{"href": "http://controller:35357/v3/", "rel": "self"}]}}

Making authentication request to http://controller:35357/v3/auth/tokens
"POST /v3/auth/tokens HTTP/1.1" 201 1636
run(Namespace(checksum=None, columns=[], container_format='bare', copy_from=None, disk_format='qcow2', file='cirros-0.3.4-x86_64-disk.img', force=False, formatter='table', id=None, location=None, max_width=0, min_disk=None, min_ram=None, name='cirros', noindent=False, owner=None, prefix='', private=False, project=None, project_domain=None, properties=None, protected=False, public=True, size=None, store=None, tags=None, unprotected=False, variables=[], volume=None))
Instantiating identity client: <class 'keystoneclient.v3.client.Client'>
Instantiating image client: <class 'glanceclient.v2.client.Client'>
Making authentication request to http://controller:35357/v3/auth/tokens
"POST /v3/auth/tokens HTTP/1.1" 201 1636
Instantiating image api: <class 'openstackclient.api.image_v2.APIv2'>
curl -g -i -X GET -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'X-Auth-Token: {SHA1}a54e2e05034300251e50082844a1dc5d88c7d5b2' -H 'Connection: keep-alive' -H 'User-Agent: python-glanceclient' -H 'Content-Type: application/octet-stream' http://controller:9292/v2/schemas/image
Starting new HTTP connection (1): controller
Error finding address for http://controller:9292/v2/schemas/image: HTTPConnectionPool(host='controller', port=9292): Max retries exceeded with url: /v2/schemas/image (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x3baab10>: Failed to establish a new connection: [Errno 111] \xe6\x8b\x92\xe7\xbb\x9d\xe8\xbf\x9e\xe6\x8e\xa5',))
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 346, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/openstackclient/common/command.py", line 38, in run
    return super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/display.py", line 79, in run
    column_names, data = self.take_action(parsed_args)
  File "/usr/lib/python2.7/site-packages/openstackclient/image/v2/image.py", line 330, in take_action
    image = image_client.images.create(**kwargs)
  File "/usr/lib/python2.7/site-packages/glanceclient/v2/images.py", line 228, in create
    image = self.model()
  File "/usr/lib/python2.7/site-packages/glanceclient/common/utils.py", line 448, in _memoized_property
    setattr(self, attr_name, fn(self))
  File "/usr/lib/python2.7/site-packages/glanceclient/v2/images.py", line 41, in model
    schema = self.schema_client.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 275, in get
    return self._request('GET', url, **kwargs)
  File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 256, in _request
    raise exc.CommunicationError(message=message)
CommunicationError: Error finding address for http://controller:9292/v2/schemas/image: HTTPConnectionPool(host='controller', port=9292): Max retries exceeded with url: /v2/schemas/image (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x3baab10>: Failed to establish a new connection: [Errno 111] \xe6\x8b\x92\xe7\xbb\x9d\xe8\xbf\x9e\xe6\x8e\xa5',))
clean_up CreateImage: Error finding address for http://controller:9292/v2/schemas/image: HTTPConnectionPool(host='controller', port=9292): Max retries exceeded with url: /v2/schemas/image (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x3baab10>: Failed to establish a new connection: [Errno 111] \xe6\x8b\x92\xe7\xbb\x9d\xe8\xbf\x9e\xe6\x8e\xa5',))
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/openstackclient/shell.py", line 118, in run
    ret_val = super(OpenStackShell, self).run(argv)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 226, in run
    result = self.run_subcommand(remainder)
  File "/usr/lib/python2.7/site-packages/openstackclient/shell.py", line 153, in run_subcommand
    ret_value = super(OpenStackShell, self).run_subcommand(argv)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 346, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/openstackclient/common/command.py", line 38, in run
    return super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/display.py", line 79, in run
    column_names, data = self.take_action(parsed_args)
  File "/usr/lib/python2.7/site-packages/openstackclient/image/v2/image.py", line 330, in take_action
    image = image_client.images.create(**kwargs)
  File "/usr/lib/python2.7/site-packages/glanceclient/v2/images.py", line 228, in create
    image = self.model()
  File "/usr/lib/python2.7/site-packages/glanceclient/common/utils.py", line 448, in _memoized_property
    setattr(self, attr_name, fn(self))
  File "/usr/lib/python2.7/site-packages/glanceclient/v2/images.py", line 41, in model
    schema = self.schema_client.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 275, in get
    return self._request('GET', url, **kwargs)
  File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 256, in _request
    raise exc.CommunicationError(message=message)
CommunicationError: Error finding address for http://controller:9292/v2/schemas/image: HTTPConnectionPool(host='controller', port=9292): Max retries exceeded with url: /v2/schemas/image (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x3baab10>: Failed to establish a new connection: [Errno 111] \xe6\x8b\x92\xe7\xbb\x9d\xe8\xbf\x9e\xe6\x8e\xa5',))

END return value: 1
下面是环境变量:
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=nicai
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
请问应该如何解决?

已有(9)人评论

跳转到指定楼层
lake11_1 发表于 2016-11-7 15:16:57
是glance-api.conf,glance-registry.conf两个配置文件中
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357

一个是uri,一个是url ,如果敲错了,就会出现如上错误。
如果修正好再不行,则加上auth_uri = http://controller:5000/v3
auth_url = http://controller:35357/v3
(openstack 版本为mitaka)
回复

使用道具 举报

tntzbzc 发表于 2016-8-3 14:29:07
http://controller:9292/v2/schemas/image
一直说这个地址是错误的。
楼主配置的镜像的位置是哪里?
权限是否足够。
把glance列出来看下
回复

使用道具 举报

rocky123 发表于 2016-8-3 14:43:17
tntzbzc 发表于 2016-8-3 14:29
http://controller:9292/v2/schemas/image
一直说这个地址是错误的。
楼主配置的镜像的位置是哪里?

-rw-r-----. 1 root glance 64068 8月   2 18:16 glance-api.conf
-rw-r-----. 1 root glance 13387 4月   7 15:37 glance-cache.conf
-rw-r-----. 1 root glance 33360 4月   7 15:37 glance-glare.conf
-rw-r-----. 1 root glance 50197 8月   2 16:35 glance-registry.conf
-rw-r-----. 1 root glance 19700 4月   7 15:37 glance-scrubber.conf
drwxr-xr-x. 2 root root    4096 8月   2 16:17 metadefs
-rw-r-----. 1 root glance  1351 4月   7 15:37 policy.json
-rw-r-----. 1 root glance  1380 4月   7 15:37 schema-image.json


这些是glance中的文件,你看下
回复

使用道具 举报

qcbb001 发表于 2016-8-3 21:11:23
楼主格式是否有问题
glance image-create --name "cirros-0.3.3-x86_64" --file /tmp/images/cirros-0.3.3-x86_64-disk.img \
  --disk-format qcow2 --container-format bare --visibility public --progress

回复

使用道具 举报

qcbb001 发表于 2016-8-3 21:12:07


用这个命令查看下
[mw_shl_code=bash,true]glance image-list[/mw_shl_code]
回复

使用道具 举报

rocky123 发表于 2016-8-6 15:40:36
qcbb001 发表于 2016-8-3 21:12
用这个命令查看下

已经解决了,是数据库没创建成功,谢谢了
回复

使用道具 举报

luoba 发表于 2016-10-24 13:41:13
本帖最后由 luoba 于 2016-10-24 14:10 编辑
rocky123 发表于 2016-8-6 15:40
已经解决了,是数据库没创建成功,谢谢了



回复

使用道具 举报

rocky123 发表于 2016-10-24 13:46:26
luoba 发表于 2016-10-24 13:41
我安装glance到上传镜像这一步时也遇到了和你一样的错误,但我的glance数据库看起来已经建好了啊。。。怎 ...

你先检查数据库里面的内容是否正常,我当时里面没有写入内容,连接不正常,然后重装了一下数据库就好了
回复

使用道具 举报

luoba 发表于 2016-10-24 14:12:41
rocky123 发表于 2016-10-24 13:46
你先检查数据库里面的内容是否正常,我当时里面没有写入内容,连接不正常,然后重装了一下数据库就好了

刚刚发现问题所在了,配置里打错了一个字母,没想到您回答得这么快,再次表示感谢!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条