Ask Your Question
0

openstack image create returned 401 Unauthorized

asked 2016-05-18 08:58:37 -0500

faith gravatar image

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 ... (more)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-05-18 11:35:08 -0500

Vinoth gravatar image

Try to upload the image from admin tenant if it works. Then the issue is you are trying to create the public image using demo user (user role) which is not allowed. Only admin role user can create the public image.

Thanks, Vinoth

edit flag offensive delete link more

Comments

before I execute ($ openstack image create "cirros" \ --file cirros-0.3.4-x86_64-disk.img \ --disk-format qcow2 --container-format bare \ --public) , I have executed ($ . admin-openrc) So I'm surely using the admin role user to create the public image. But still come out the same error

faith gravatar imagefaith ( 2016-05-18 20:04:36 -0500 )edit

Did you try this ?.... (without public)

openstack image create "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare

Vinoth gravatar imageVinoth ( 2016-05-19 15:09:35 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2016-05-18 08:58:37 -0500

Seen: 149 times

Last updated: May 18 '16