Failed to connect to glance.
Hi, I'm try to setup glance in my openstack controller node. I have two nodes: controller (192.168.253.10, hostname=controller) and computer (192.168.253.15, hostname=computer). I add the following to glance_api.conf:
[database]
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance
[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_PASS
[paste_deploy]
flavor = keystone
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
And the following is added to glance-registry.conf
[database]
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance
[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_PASS
[paste_deploy]
flavor = keystone
Then I set the following evn:
export OS_USERNAME=admin
export OS_PASSWORD='mypasswd'
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_DOMAIN_NAME=default
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
The glance service is restarted:
/root>service glance-api status
● glance-api.service - OpenStack Glance Service API
Loaded: loaded (/lib/systemd/system/glance-api.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2019-10-27 22:40:17 EDT; 2min 14s ago
Main PID: 3241 (uwsgi_python37)
Tasks: 5 (limit: 4673)
Memory: 315.8M
CGroup: /system.slice/glance-api.service
├─3241 /usr/bin/uwsgi_python37 --http-socket [::]:9292 --ini /etc/glance/glance-api-uwsgi.ini
├─3245 /usr/bin/uwsgi_python37 --http-socket [::]:9292 --ini /etc/glance/glance-api-uwsgi.ini
├─3246 /usr/bin/uwsgi_python37 --http-socket [::]:9292 --ini /etc/glance/glance-api-uwsgi.ini
├─3247 /usr/bin/uwsgi_python37 --http-socket [::]:9292 --ini /etc/glance/glance-api-uwsgi.ini
└─3248 /usr/bin/uwsgi_python37 --http-socket [::]:9292 --ini /etc/glance/glance-api-uwsgi.ini
Oct 27 22:40:17 controller systemd[1]: Started OpenStack Glance Service API.
Oct 27 22:40:17 controller glance-api[3241]: [uwsgi] implicit plugin requested python37
Oct 27 22:40:17 controller glance-api[3241]: [uWSGI] getting INI configuration from /etc/glance/glance-api-uwsgi.ini
/root>ss -ntlp | grep 9292
LISTEN 0 100 *:9292 *:* users:(("uwsgi_python37",pid=3248,fd=3),("uwsgi_python37",pid=3247,fd=3),("uwsgi_python37",pid=3246,fd=3),("uwsgi_python37",pid=3245,fd=3),("uwsgi_python37",pid=3241,fd=3))
However, when I run openstack image list, I got an error:
/root>openstack image list
Unable to establish connection to http://controller:9292/v2/images: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
Coul dyou let me know how to fix the error?
How can I "not to run Glance behind WGSI"?
I re-paste the code below:
/root>openstack --debug image list
START with options: ['--debug', 'image', 'list']
options: Namespace(access_key='', access_secret='***', access_token='***', access_token_endpoint='', access_token_type='', application_credential_id='', application_credential_name='', application_credential_secret='***', auth_type='', auth_url='http://controller:35357/v3', cacert=None, cert='', client_id='', client_secret='***', cloud='', code='', consumer_key='', consumer_secret='***', debug=True, default_domain='default', default_domain_id='', default_domain_name='', deferred_help=False, discovery_endpoint='', domain_id='', domain_name='', endpoint='', identity_provider='', identity_provider_url='', insecure=None, interface='', key='', log_file=None, openid_scope='', os_beta_command=False, os_compute_api_version='', os_identity_api_version='3', os_image_api_version='2', os_key_manager_api_version='1', os_network_api_version='', os_object_api_version='', os_project_id=None, os_project_name=None, os_volume_api_version='', passcode='', password='***', profile='', project_domain_id='', project_domain_name='default', project_id='', project_name='admin', protocol='', redirect_uri='', region_name='', remote_project_domain_id='', remote_project_domain_name='', remote_project_id='', remote_project_name='', service_provider='', service_provider_endpoint='', service_provider_entity_id='', system_scope='', timing ...
Please check the Glance API log and the web server logs for more information. Perhaps your WGSI setup causes the problem.
Generally, it is recommended not to run Glance behind WGSI since not all features are supported.
And please try to format the code you post here so that it becomes readable. The button labeled "101010" does the trick.
The Glance API log shows that Glance can't access Keystone's admin endpoint. Is
auth_url = http://controller:35357
correct?/root>hostname controller
The exception EndpointNotFound is raised by the Keystone authentication module when the endpoint is not in the service catalog.
openstack catalog list
orendpoint list
should confirm this.