not able to execute the openstack api !!

Asked by Naved Ali Shah

I have done setup of the glance and glance-api and registry are running as expected. i am using filesystem to upload an image and thats working fine. Now i have couple of images uploaded on glance (/var/lib/glance/). TO test the openstack api i ran a command cloudservers image-list or flavor-list and came across below error
Traceback (most recent call last):
  File "/usr/local/bin/cloudservers", line 9, in <module>
    load_entry_point('python-cloudservers==1.2', 'console_scripts', 'cloudservers')()
  File "/usr/local/lib/python2.6/dist-packages/python_cloudservers-1.2-py2.6.egg/cloudservers/shell.py", line 551, in main
    CloudserversShell().main(sys.argv[1:])
  File "/usr/local/lib/python2.6/dist-packages/python_cloudservers-1.2-py2.6.egg/cloudservers/shell.py", line 144, in main
    args.func(args)
  File "/usr/local/lib/python2.6/dist-packages/python_cloudservers-1.2-py2.6.egg/cloudservers/shell.py", line 293, in do_image_list
    print_list(self.cs.images.list(), ['ID', 'Name', 'Status'])
  File "/usr/local/lib/python2.6/dist-packages/python_cloudservers-1.2-py2.6.egg/cloudservers/images.py", line 39, in list
    return self._list("/images/detail", "images")
  File "/usr/local/lib/python2.6/dist-packages/python_cloudservers-1.2-py2.6.egg/cloudservers/base.py", line 26, in _list
    resp, body = self.api.client.get(url)
  File "/usr/local/lib/python2.6/dist-packages/python_cloudservers-1.2-py2.6.egg/cloudservers/client.py", line 83, in get
    return self._cs_request(url, 'GET', **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/python_cloudservers-1.2-py2.6.egg/cloudservers/client.py", line 70, in _cs_request
    **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/python_cloudservers-1.2-py2.6.egg/cloudservers/client.py", line 56, in request

I am trying to execute the command from network api server where i have defined the basic properties for glance and set the enviornment variable those are below :-
--osapi_host=10.2.3.150
--osapi_port=8774
--osapi_path=/v1.0/
--allow_project_net_traffic=true
--glance_host=10.2.3.153
--glance_port=9292
--image_service=nova.image.glance.GlanceImageService
and variables :-
export CLOUD_SERVERS_API_KEY="60ddc94f-77b8-4c7f-a493-80239cf0744d"
export CLOUD_SERVERS_USERNAME="admin"
export CLOUD_SERVERS_URL="http://10.2.3.150:8774/v1.0/"
I also have removed ec2 parameters from the nova.conf file and nova-objectstore is not running any more as well (means only 3 services running on network server and 2 glance server in serperate machine).
If i do GET from network server then i get proper response from Glance but if i run cloudservers commands i get exception (mentioned above).
Below is the log messages from nova-api service :-
2011-02-15 02:46:09,645 DEBUG eventlet.wsgi.server [-] 10.2.3.150 - - [15/Feb/2011 02:46:09] "GET /v1.0/ HTTP/1.1" 204 276 0.040602
 from MainProcess (pid=28711) write /usr/local/lib/python2.6/dist-packages/nova-2011.2-py2.6.egg/nova/wsgi.py:55
2011-02-15 02:46:09,666 ERROR nova.api.openstack [-] エラー id openstack のプロジェクトが存在しません。 をキャッチしました。
(nova.api.openstack): TRACE: Traceback (most recent call last):
(nova.api.openstack): TRACE: File "/usr/local/lib/python2.6/dist-packages/nova-2011.2-py2.6.egg/nova/api/openstack/__init__.py", line 52, in __call__
(nova.api.openstack): TRACE: return req.get_response(self.application)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/request.py", line 918, in get_response
(nova.api.openstack): TRACE: application, catch_exc_info=False)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/request.py", line 886, in call_application
(nova.api.openstack): TRACE: app_iter = application(self.environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
(nova.api.openstack): TRACE: resp = self.call_func(req, *args, **self.kwargs)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
(nova.api.openstack): TRACE: return self.func(req, *args, **kwargs)
(nova.api.openstack): TRACE: File "/usr/local/lib/python2.6/dist-packages/nova-2011.2-py2.6.egg/nova/api/openstack/auth.py", line 58, in __call__
(nova.api.openstack): TRACE: project = self.auth.get_project(FLAGS.default_project)
(nova.api.openstack): TRACE: File "/usr/local/lib/python2.6/dist-packages/nova-2011.2-py2.6.egg/nova/auth/manager.py", line 473, in get_project
(nova.api.openstack): TRACE: project_dict = drv.get_project(pid)
(nova.api.openstack): TRACE: File "/usr/local/lib/python2.6/dist-packages/nova-2011.2-py2.6.egg/nova/auth/dbdriver.py", line 58, in get_project
(nova.api.openstack): TRACE: project = db.project_get(context.get_admin_context(), pid)
(nova.api.openstack): TRACE: File "/usr/local/lib/python2.6/dist-packages/nova-2011.2-py2.6.egg/nova/db/api.py", line 882, in project_get
(nova.api.openstack): TRACE: return IMPL.project_get(context, id)
(nova.api.openstack): TRACE: File "/usr/local/lib/python2.6/dist-packages/nova-2011.2-py2.6.egg/nova/db/sqlalchemy/api.py", line 1784, in project_get
(nova.api.openstack): TRACE: raise exception.NotFound(_("No project with id %s") % id)
(nova.api.openstack): TRACE: NotFound: <unprintable NotFound object>
(nova.api.openstack): TRACE:
2011-02-15 02:46:09,671 DEBUG eventlet.wsgi.server [-] 10.2.3.150 - - [15/Feb/2011 02:46:09] "GET /v1.0//images/detail?fresh=1297766769.65 HTTP/1.1" 500 285 0.023622
 from MainProcess (pid=28711) write /usr/local/lib/python2.6/dist-packages/nova-2011.2-py2.6.egg/nova/wsgi.py:55
    raise exceptions.from_response(resp, body)
cloudservers.exceptions.CloudServersException

I am sure some parameter is not been set or value is not been set properly.
nova.conf File :-
--daemonize=1
--dhcpbridge_flagfile=/etc/nova/nova.conf
--dhcpbridge=/home/openstack/nova/bin/nova-dhcpbridge
--logdir=/var/log/nova
--state_path=/var/lib/nova
--networks_path=/var/lib/nova/networks
--sql_connection=mysql://root:nova@10.2.3.150/nova
--scheduler_driver=nova.scheduler.simple.SimpleScheduler
--cc_host=10.2.3.150
--rabbit_host=10.2.3.150
--ec2_url=http://10.2.3.150:8773/services/Cloud
--network_manager=nova.network.manager.VlanManager
--fixed_range=172.16.0.0/24
--network_size=32
--routing_source_ip=10.2.3.150
--verbose
--libvirt_type=kvm
--vlan_interface=eth0
--public_interface=eth1
--default_log_levels=amqplib=INFO, sqlalchemy=INFO, eventlet.wsgi.server=DEBUG
--iscsi_ip_prefix=192.168
--use_ipv6=True
--ec2_prefix=http
--osapi_host=10.2.3.150
--osapi_port=8774
--osapi_path=/v1.0/
--allow_project_net_traffic=true
--glance_host=10.2.3.153
--glance_port=9292
--image_service=nova.image.glance.GlanceImageService

I appriciate any help you can provide to me.

Question information

Language:
English Edit question
Status:
Solved
For:
Glance Edit question
Assignee:
No assignee Edit question
Solved by:
Naved Ali Shah
Solved:
Last query:
Last reply:
Revision history for this message
Naved Ali Shah (naved-shah) said :
#1

Issue was from Nova:- Reason of not running was default project was absent in the DB >> projects and in access key if you see for EC2 there is project id as well present to relate the user and the project but if there is no project id in the access key that time nova code looks for default project and if its nor present in th DB then throws error :-
raise exception.NotFound(_("No project with id %s") % id)
To resolve this i ad to create a project using the same user which access key is been sourced to cloudserver/openstack api.