Ask Your Question

openstack image create returned 401 Unauthorized

asked 2016-05-18 08:54:05 -0600

faith gravatar image

I followed the openstack install guide for Ubuntu 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 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: Making ... (more)

edit retag flag offensive close merge delete

1 answer

Sort by ┬╗ oldest newest most voted

answered 2016-05-19 02:26:25 -0600

Carrot gravatar image

Did you run before glance command ?


 controller# set | grep OS_
edit flag offensive delete link more


I have run before glance command. Here is the result: OS_AUTH_URL=http://controller:35357/v3 OS_IDENTITY_API_VERSION=3 OS_IMAGE_API_VERSION=2 OS_PASSWORD=admin OS_PROJECT_DOMAIN_NAME=default OS_PROJECT_NAME=admin OS_USERNAME=admin OS_USER_DOMAIN_NAME=default

faith gravatar imagefaith ( 2016-05-19 02:55:25 -0600 )edit

'glance image-list' is work?

Carrot gravatar imageCarrot ( 2016-05-19 19:58:07 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools


Asked: 2016-05-18 08:54:05 -0600

Seen: 278 times

Last updated: May 19 '16