本帖最后由 sipilaigou 于 2017-4-26 12:06 编辑
安装过程:
参考官方文档,在安装到glance的步骤中,上传镜像并验证,发生了问题。其中排查了配置文件、变量、数据库、Keystone日志、镜像的权限等,均没有发现问题所在,请大家帮忙。谢谢。
搭建版本:
centos 7.0 OpenStack M 参考文档:https://docs.openstack.org/mitak ... glance-install.html
环境变量:
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=admin
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
配置文件glance-api.conf :
[root@ControllerNode ~]# cat /etc/glance/glance-api.conf |grep -v ^#|grep -v ^$
[DEFAULT]
[cors]
[cors.subdomain]
[database]
connection = mysql+pymysql://glance:glance@controller/glance
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
[image_format]
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance
[matchmaker_redis]
[oslo_concurrency]
[oslo_messaging_amqp]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_policy]
[paste_deploy]
flavor = keystone
[profiler]
[store_type_location_strategy]
[task]
[taskflow_executor]
配置文件glance-registry.conf:
[root@ControllerNode ~]# cat /etc/glance/glance-registry.conf |grep -v ^#|grep -v ^$
[DEFAULT]
[database]
connection = mysql+pymysql://glance:glance@controller/glance
[glance_store]
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance
[matchmaker_redis]
[oslo_messaging_amqp]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_policy]
[paste_deploy]
flavor = keystone
[profiler]
数据库信息:MariaDB [glance]> show tables;
+----------------------------------+
| Tables_in_glance |
+----------------------------------+
| artifact_blob_locations |
| artifact_blobs |
| artifact_dependencies |
| artifact_properties |
| artifact_tags |
| artifacts |
| image_locations |
| image_members |
| image_properties |
| image_tags |
| images |
| metadef_namespace_resource_types |
| metadef_namespaces |
| metadef_objects |
| metadef_properties |
| metadef_resource_types |
| metadef_tags |
| migrate_version |
| task_info |
| tasks |
+----------------------------------+
20 rows in set (0.00 sec)
问题一:
执行命令:glance --debug image-list
提示:
DEBUG:keystoneclient.session:REQ: curl -g -i -X GET http://controller:35357/v3 -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): controller
DEBUG:requests.packages.urllib3.connectionpool:"GET /v3 HTTP/1.1" 200 250
DEBUG:keystoneclient.session:RESP: [200] Date: Wed, 26 Apr 2017 03:51:48 GMT Server: Apache/2.4.6 (CentOS) mod_wsgi/3.4 Python/2.7.5 Vary: X-Auth-Token x-openstack-request-id: req-85aeb805-d3ab-49ea-bfb5-06d0679b72a8 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"}]}}
DEBUG:keystoneclient.auth.identity.v3.base:Making authentication request to http://controller:35357/v3/auth/tokens
DEBUG:requests.packages.urllib3.connectionpool:"POST /v3/auth/tokens HTTP/1.1" 201 1940
DEBUG:keystoneclient.session:REQ: curl -g -i -X GET http://controller:9292/v2/images?limit=20&sort_key=name&sort_dir=asc -H "User-Agent: python-glanceclient" -H "Content-Type: application/octet-stream" -H "X-Auth-Token: {SHA1}a6bed6bb6b4a5310c3eeff635554b59367caef58"
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): controller
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/glanceclient/shell.py", line 675, in main
OpenStackImagesShell().main(argv)
File "/usr/lib/python2.7/site-packages/glanceclient/shell.py", line 606, in main
args.func(client, args)
File "/usr/lib/python2.7/site-packages/glanceclient/v2/shell.py", line 185, in do_image_list
utils.print_list(images, columns)
File "/usr/lib/python2.7/site-packages/glanceclient/common/utils.py", line 185, in print_list
for o in objs:
File "/usr/lib/python2.7/site-packages/glanceclient/v2/images.py", line 176, in list
for image in paginate(url, page_size, limit):
File "/usr/lib/python2.7/site-packages/glanceclient/v2/images.py", line 108, in paginate
resp, body = self.http_client.get(next_url)
File "/usr/lib/python2.7/site-packages/keystoneclient/adapter.py", line 176, in get
return self.request(url, 'GET', **kwargs)
File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 330, in request
raise exc.CommunicationError(message=message)
CommunicationError: Error finding address for http://controller:9292/v2/images?limit=20&sort_key=name&sort_dir=asc: Unable to establish connection to http://controller:9292/v2/images?limit=20&sort_key=name&sort_dir=asc
Error finding address for http://controller:9292/v2/images?limit=20&sort_key=name&sort_dir=asc: Unable to establish connection to http://controller:9292/v2/images?limit=20&sort_key=name&sort_dir=asc
问题二:
执行命令: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='', 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='', 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.11.1 CPython/2.7.5"
Starting new HTTP connection (1): controller
"GET /v3 HTTP/1.1" 200 250
RESP: [200] Date: Wed, 26 Apr 2017 04:00:16 GMT Server: Apache/2.4.6 (CentOS) mod_wsgi/3.4 Python/2.7.5 Vary: X-Auth-Token x-openstack-request-id: req-baf75319-7cfc-485f-9c64-46d482ea20b4 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 1940
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 1940
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}e758bfd79d1232c7867e2124a2b2248b0a09a8ad' -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 0x2669d10>: Failed to establish a new connection: [Errno 111] Connection refused',))
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 0x2669d10>: Failed to establish a new connection: [Errno 111] Connection refused',))
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 0x2669d10>: Failed to establish a new connection: [Errno 111] Connection refused',))
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 0x2669d10>: Failed to establish a new connection: [Errno 111] Connection refused',))
END return value: 1
|