Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

openstack image create returned 401 Unauthorized

I followed the openstack install guide for ubuntu14.04 step by step, and when I try to upload an image (openstack image create "cirros" \ --file cirros-0.3.4-x86_64-disk.img \ --disk-format qcow2 --container-format bare \ --public) it returned the following message:

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='admin', 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: {'auth_type': 'password', 'compute_api_version': '2', 'database_api_version': '1.0', 'api_timeout': None, 'baremetal_api_version': '1', 'cacert': None, 'image_api_use_tasks': False, 'floating_ip_source': 'neutron', 'key': None, 'interface': None, 'network_api_version': '2', 'image_format': 'qcow2', 'object_api_version': '1', 'image_api_version': '1', 'verify': True, 'identity_api_version': '2', 'volume_api_version': '1', 'cert': None, 'secgroup_source': 'neutron', 'dns_api_version': '2', 'disable_vendor_agent': {}} cloud cfg: {'auth_type': 'password', 'compute_api_version': '2', 'database_api_version': '1.0', 'interface': None, 'network_api_version': '2', 'image_format': 'qcow2', 'object_api_version': '1', 'image_api_version': '2', 'verify': True, 'timing': False, 'dns_api_version': '2', 'verbose_level': 3, 'region_name': '', 'api_timeout': None, 'baremetal_api_version': '1', 'auth': {'username': 'admin', 'project_name': 'admin', 'tenant_name': 'admin', 'user_domain_name': 'default', 'auth_url': 'http://controller:35357/v3', 'password': 'admin', 'project_domain_name': 'default'}, 'default_domain': 'default', 'image_api_use_tasks': False, 'floating_ip_source': 'neutron', 'key': None, 'cacert': None, 'deferred_help': False, 'identity_api_version': '3', 'volume_api_version': '1', 'cert': None, 'secgroup_source': 'neutron', 'debug': True, '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 1, cmd group openstack.volume.v1 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', 'tenant_name': 'admin', 'user_domain_name': 'default', 'password': 'admin', '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" Starting new HTTP connection (1): controller "GET /v3 HTTP/1.1" 200 250 RESP: [200] Content-Length: 250 Vary: X-Auth-Token Keep-Alive: timeout=5, max=100 Server: Apache/2.4.7 (Ubuntu) Connection: Keep-Alive Date: Wed, 18 May 2016 13:46:57 GMT x-openstack-request-id: req-d723b0df-8bda-43ac-97b2-4236ffd8928d Content-Type: application/json X-Distribution: Ubuntu RESP BODY: {"version": {"status": "stable", "updated": "2015-03-30T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.4", "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 1601 take_action(Namespace(checksum=None, columns=[], container_format='bare', copy_from=None, disk_format='qcow2', file='cirros-0.3.4-x86_64-disk.img', formatter='table', id=None, location=None, max_width=0, min_disk=None, min_ram=None, name='cirros', owner=None, prefix='', private=False, properties=None, protected=False, public=True, size=None, store=None, tags=None, unprotected=False, variables=[])) 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 1601 Instantiating image api: <class 'openstackclient.api.image_v2.apiv2'=""> curl -g -i -X GET -H 'Accept-Encoding: gzip, deflate' -H 'Accept: /' -H 'User-Agent: python-glanceclient' -H 'Connection: keep-alive' -H 'X-Auth-Token: {SHA1}8984810c0763c4e4ac3a8f6c9930a9a8efdb5bc0' -H 'Content-Type: application/octet-stream' http://controller:9292/v2/schemas/image Starting new HTTP connection (1): controller "GET /v2/schemas/image HTTP/1.1" 401 358 Request returned failure status 401. 401 Unauthorized: This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required. (HTTP 401) Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/cliff/app.py", line 374, in run_subcommand result = cmd.run(parsed_args) File "/usr/lib/python2.7/dist-packages/cliff/display.py", line 92, in run column_names, data = self.take_action(parsed_args) File "/usr/lib/python2.7/dist-packages/openstackclient/image/v2/image.py", line 268, in take_action image = image_client.images.create(kwargs) File "/usr/lib/python2.7/dist-packages/glanceclient/v2/images.py", line 228, in create image = self.model() File "/usr/lib/python2.7/dist-packages/glanceclient/common/utils.py", line 447, in _memoized_property setattr(self, attr_name, fn(self)) File "/usr/lib/python2.7/dist-packages/glanceclient/v2/images.py", line 41, in model schema = self.schema_client.get('image') File "/usr/lib/python2.7/dist-packages/glanceclient/v2/schemas.py", line 125, in get _, raw_schema = self.http_client.get(uri) File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 280, in get return self._request('GET', url, *kwargs) File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 272, in _request resp, body_iter = self._handle_response(resp) File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 93, in _handle_response raise exc.from_response(resp, resp.content) HTTPUnauthorized: 401 Unauthorized: This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required. (HTTP 401) clean_up CreateImage: 401 Unauthorized: This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required. (HTTP 401) Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/openstackclient/shell.py", line 108, in run ret_val = super(OpenStackShell, self).run(argv) File "/usr/lib/python2.7/dist-packages/cliff/app.py", line 255, in run result = self.run_subcommand(remainder) File "/usr/lib/python2.7/dist-packages/cliff/app.py", line 374, in run_subcommand result = cmd.run(parsed_args) File "/usr/lib/python2.7/dist-packages/cliff/display.py", line 92, in run column_names, data = self.take_action(parsed_args) File "/usr/lib/python2.7/dist-packages/openstackclient/image/v2/image.py", line 268, in take_action image = image_client.images.create(kwargs) File "/usr/lib/python2.7/dist-packages/glanceclient/v2/images.py", line 228, in create image = self.model() File "/usr/lib/python2.7/dist-packages/glanceclient/common/utils.py", line 447, in _memoized_property setattr(self, attr_name, fn(self)) File "/usr/lib/python2.7/dist-packages/glanceclient/v2/images.py", line 41, in model schema = self.schema_client.get('image') File "/usr/lib/python2.7/dist-packages/glanceclient/v2/schemas.py", line 125, in get _, raw_schema = self.http_client.get(uri) File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 280, in get return self._request('GET', url, *kwargs) File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 272, in _request resp, body_iter = self._handle_response(resp) File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 93, in _handle_response raise exc.from_response(resp, resp.content) HTTPUnauthorized: 401 Unauthorized: This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required. (HTTP 401)

END return value: 1

I checked all the configurations and it seem alright, any suggestions?