Uploaded image for project: 'Libcloud'
  1. Libcloud
  2. LIBCLOUD-962

Not able to connect to openstackusing libcloud

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Blocker
    • Resolution: Unresolved
    • 0.13.0
    • None
    • Compute
    • working on linux

    • Important

    Description

      I am trying to use the lib cloud library to connect to my local openstack installation.

      below is the code I am trying to execute:

      from libcloud.compute.types import Provider
      from libcloud.compute.providers import get_driver

      1. Authentication information so you can authenticate to DreamCompute
      2. copy the details from the OpenStack RC file
      3. https://dashboard.dreamcompute.com/project/access_and_security/api_access/openrc/

      auth_username = 'admin'
      auth_password = 'f882e2f4eaad434c'
      TENANT_NAME = 'admin'
      project_name = 'admin'
      auth_url = 'http://192.168.56.101:5000'
      #auth_url = 'http://192.168.56.101:5000'
      region_name = 'RegionOne'

      OpenStack = get_driver(Provider.OPENSTACK)
      driver = OpenStack('auth_username',
      'auth_password',
      ex_force_auth_url=auth_url,
      ex_force_base_url='http://192.168.56.101',
      ex_force_auth_version='2.0_password',
      ex_tenant_name='admin',
      ex_force_service_name='nova',
      ex_force_service_region=region_name)

      print(dir(driver.list_nodes))
      print(driver.api_name)
      print(driver.VOLUME_STATE_MAP)
      #print(driver.connection.auth_user_info)
      images = driver.name
      print(driver.list_volumes())
      """for image in images:
      print(image)
      """

      However I keep getting the error message resource not found:

      C:\Python dev\website\music\openstack>python openstack.py
      ['__call__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__func__', '__ge__', '__get__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
      openstack

      {'creating': 'creating', 'available': 'available', 'attaching': 'attaching', 'in-use': 'inuse', 'deleting': 'deleting', 'error': 'error', 'error_deleting': 'error', 'backing-up': 'backup', 'restoring-backup': 'backup', 'error_restoring': 'error', 'error_extending': 'error'}

      Traceback (most recent call last):
      File "openstack.py", line 31, in <module>
      print(driver.list_volumes())
      File "C:\Users\C5265680\AppData\Local\Programs\Python\Python36\lib\site-packages\libcloud\compute\drivers\openstack.py", line 265, in list_volumes
      self.connection.request('/os-volumes').object)
      File "C:\Users\C5265680\AppData\Local\Programs\Python\Python36\lib\site-packages\libcloud\common\openstack.py", line 223, in request
      raw=raw)
      File "C:\Users\C5265680\AppData\Local\Programs\Python\Python36\lib\site-packages\libcloud\common\base.py", line 536, in request
      action = self.morph_action_hook(action)
      File "C:\Users\C5265680\AppData\Local\Programs\Python\Python36\lib\site-packages\libcloud\common\openstack.py", line 290, in morph_action_hook
      self._populate_hosts_and_request_paths()
      File "C:\Users\C5265680\AppData\Local\Programs\Python\Python36\lib\site-packages\libcloud\common\openstack.py", line 324, in _populate_hosts_and_request_paths
      osa = osa.authenticate(**kwargs) # may throw InvalidCreds
      File "C:\Users\C5265680\AppData\Local\Programs\Python\Python36\lib\site-packages\libcloud\common\openstack_identity.py", line 855, in authenticate
      return self._authenticate_2_0_with_password()
      File "C:\Users\C5265680\AppData\Local\Programs\Python\Python36\lib\site-packages\libcloud\common\openstack_identity.py", line 880, in _authenticate_2_0_with_password
      return self._authenticate_2_0_with_body(reqbody)
      File "C:\Users\C5265680\AppData\Local\Programs\Python\Python36\lib\site-packages\libcloud\common\openstack_identity.py", line 885, in _authenticate_2_0_with_body
      method='POST')
      File "C:\Users\C5265680\AppData\Local\Programs\Python\Python36\lib\site-packages\libcloud\common\base.py", line 637, in request
      response = responseCls(**kwargs)
      File "C:\Users\C5265680\AppData\Local\Programs\Python\Python36\lib\site-packages\libcloud\common\base.py", line 157, in _init_
      message=self.parse_error())
      libcloud.common.exceptions.BaseHTTPError: {"error": {"message": "The resource could not be found.", "code": 404, "title": "Not Found"}}

      C:\Python dev\website\music\openstack>

      Attachments

        Activity

          People

            Unassigned Unassigned
            Farooq Kadri farooq
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 48h
                48h
                Remaining:
                Remaining Estimate - 48h
                48h
                Logged:
                Time Spent - Not Specified
                Not Specified