Hi Tomaz, Looks like I am not sending "tenant-ID" while creating the connection. I fixed it and this issue resolved. Thanks for your help.
Now I can see that some of the fields which the libcloud library is expecting are not present in the openstack object created. For example, the images object created by openstack doesn't have the fields like "progress", "minDisk" and "updated" etc. I think these fields are either changed or deprecated. For example, I don't see "progress" field, where as "updated" is changed to "updated_at", "created" is changed to "created_at" and "minDisk" is changed to "min_disk" etc. So I had to make some changes in compute::driver::openstack.py file to make it working. Similarly there are some changes required in _create_args_to_params method of compute::driver::openstack.py. Now while I am creating a node using OpenStack_1.1_NodeDriver::create_node(), openstack is giving an error asking to specify the network on which the node should be created. So I used ex_list_networks() to get the network list and specified one of the netwok from the list as a parameter for create_node() fuction using "networks" key. But still it is not creating and throwing an error. When I debugged it, it seems libcloud is not creating a port corresponding to the network provided in the create_node() function, so openstack is failing to create a node. I couldn't see any libcloud API for creating the ports. I am using libcloud-0.13.1 code base. Could you please let me know if the following is possible with libcloud. If yes, please let me know the procedure. 1) Creating a port corresponding to a network 2) Create a node using the port created in step 1 and its network. Please also let me know if there is some other way of creating a openstack node using libcloud with out creating a port corresponding to the required network. While getting the network list using ex_network_list(), I had to change the argument of request call (connection.request()) from "os-networksv2" to "networks" to make it work. I can send you the code changes if you want. Please let me know. Thanks, Phani On Fri, Oct 4, 2013 at 12:16 PM, Tomaz Muraus <to...@apache.org> wrote: > It looks like a specified url is still invalid. As you can see in the > debug output, both /v1 and /v2.0 is added to the url > > sent from my mobile > On Oct 4, 2013 8:08 PM, "Venkata Siva Satya" <phanikumar.g...@gmail.com> > wrote: > >> Hi Tamaz, >> >> When I used the api port as 8776, I am getting a response, but it is HTTP >> 300 Multiple choice response. >> >> I got this port from my compute logs when I execute the nova cli command. >> The LIBCLOUD_DEBUG output is as follows. >> >> Thanks, >> Phani >> >> # -------- begin 21091680 request ---------- >> curl -i -X GET -H 'Host: 192.168.216.164:8776' -H 'X-LC-Request-ID: >> 21091680' -H 'Accept-Encoding: gzip,deflate' -H 'X-Auth-Token: >> MIIC8QYJKoZIhvcNAQcCoIIC4jCCAt4CAQExCTAHBgUrDgMCGjCCAUcGCSqGSIb3DQEHAaCCATgEggE0eyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxMy0xMC0wM1QxMDowODozNy44MTQ4MDYiLCAiZXhwaXJlcyI6ICIyMDEzLTEwLTA0VDEwOjA4OjM3WiIsICJpZCI6ICJwbGFjZWhvbGRlciJ9LCAic2VydmljZUNhdGFsb2ciOiBbXSwgInVzZXIiOiB7InVzZXJuYW1lIjogImFkbWluIiwgInJvbGVzX2xpbmtzIjogW10sICJpZCI6ICJhNzBhNDU0YmRhMGI0ZmVkYTQ1ZWU5OGE3NWQ1MmZjZCIsICJyb2xlcyI6IFtdLCAibmFtZSI6ICJhZG1pbiJ9LCAibWV0YWRhdGEiOiB7ImlzX2FkbWluIjogMCwgInJvbGVzIjogW119fX0xggGBMIIBfQIBATBcMFcxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVVbnNldDEOMAwGA1UEBwwFVW5zZXQxDjAMBgNVBAoMBVVuc2V0MRgwFgYDVQQDDA93d3cuZXhhbXBsZS5jb20CAQEwBwYFKw4DAhowDQYJKoZIhvcNAQEBBQAEggEAFki53n5zubaX8Azi9Urc2q1COVvqNE+whd+NMnMjYUzA8L8s3Tg1SCemJmCUIZzDwmc+xU0NWs49HYExEPuEUVQIojYx44GYUWOottx3NcnISfGYOEzoAUhbN3MNJnS7ZUKrBlSXT1W5HkEuMBDFTql2FAk68BEvaBN563kWtxpYYk1mpRj4qbLVZf1vnWDXmOBi7zSzw9TLZidvw-c6zKy95CsJP10u99gAsn+DDgXmWMbakQK50-uXjhx8dHq5umVIvzmpy9Ynyifr2IUwJUXLxuGhnluUGWQMYQkUb5i7ut44dKk5nUmTWDlcQ1Q0856N0eGJlXsJjdF3vuaSew==' >> -H 'Accept: application/json' -H 'User-Agent: libcloud/0.13.1 (OpenStack) ' >> --compress ' >> http://192.168.216.164:8776/v2.0/images/detail?cache-busting=83744bddbe0937e9 >> ' >> # -------- begin 21091680:20542240 response ---------- >> HTTP/1.1 300 Multiple Choices >> Date: Thu, 03 Oct 2013 10:08:37 GMT >> Content-Length: 651 >> Content-Type: application/json >> >> {"choices": [{"status": "CURRENT", "media-types": [{"base": >> "application/xml", "type": >> "application/vnd.openstack.volume+xml;version=1"}, {"base": >> "application/json", "type": >> "application/vnd.openstack.volume+json;version=1"}], "id": "v1.0", "links": >> [{"href": "http://192.168.216.164:8776/v1/v2.0/images/detail", "rel": >> "self"}]}, {"status": "CURRENT", "media-types": [{"base": >> "application/xml", "type": >> "application/vnd.openstack.volume+xml;version=1"}, {"base": >> "application/json", "type": >> "application/vnd.openstack.volume+json;version=1"}], "id": "v2.0", "links": >> [{"href": "http://192.168.216.164:8776/v1/v2.0/images/detail", "rel": >> "self"}]}]} >> >> >> >> On Fri, Oct 4, 2013 at 11:37 AM, Tomaz Muraus <to...@apache.org> wrote: >> >>> What error do you get when you specify ex_force_base_url argument? >>> >>> In your example it looks like you have specified the same url for "auth >>> url" and "api url" argument. >>> >>> Those are two separate services (auth and api) which listen on different >>> ports. Most likely the problem is that ex_force_base_url is not set >>> correctly. >>> >>> Edit (from the IRC) - Yes, this indeed seems to be the problem. >>> >>> [19:09] < Phani> | Hi >>> [19:10] < Phani> | I am facing some issue with creating the nodes >>> using libcloud in local >>> openstack >>> [19:10] < Phani> | can any one please help me ? >>> [19:30] < Phani> | I am callling constructor as - conn = >>> self.driver(self.user, self.key, >>> ex_force_base_url='http://192.168.216.164:5000/v2.0',ex_force_auth_url=' >>> http://192.168.216.164:5000/v2.0', >>> ex_force_auth_version='2.0_password',ex_force_service_type='compute', >>> ex_force_service_name='nova', >>> ex_force_service_region='RegionOne') >>> [19:31] < Phani> | using 'conn' when i am trying to list the >>> images .. i am getting the >>> error resourcce not found >>> >>> >>> On Fri, Oct 4, 2013 at 7:08 PM, Venkata Siva Satya < >>> phanikumar.g...@gmail.com> wrote: >>> >>>> Hi Tomaz, >>>> >>>> I specified the ex_force_base_url, but still no luck. currently the >>>> constructor is executed as follows. >>>> >>>> conn = self.driver(self.user, self.key, ex_force_base_url=' >>>> http://192.168.216.164:5000/v2.0',ex_force_auth_url=' >>>> http://192.168.216.164:5000/v2.0', >>>> ex_force_auth_version='2.0_password',ex_force_service_type='compute', >>>> ex_force_service_name='nova', ex_force_service_region='RegionOne') >>>> >>>> I am able to get the image list using "nova image-list" cli. >>>> >>>> The LIBCLOUD_DEBUG messages are as follows. >>>> >>>> Thanks, >>>> Phani >>>> >>>> # -------- begin 21745032 request ---------- >>>> curl -i -X POST -H 'Host: 192.168.216.164:5000' -H 'Accept-Encoding: >>>> gzip,deflate' -H 'X-LC-Request-ID: 21745032' -H 'Content-Type: >>>> application/json; charset=UTF-8' -H 'Content-Length: 80' -H 'Accept: >>>> application/json' -H 'User-Agent: libcloud/0.13.1 (OpenStack) ' >>>> --data-binary '{"auth": {"passwordCredentials": {"username": "admin", >>>> "password": "password"}}}' --compress >>>> http://192.168.216.164:5000/v2.0/tokens >>>> # -------- begin 21745032:21744960 response ---------- >>>> HTTP/1.1 200 OK >>>> Date: Thu, 03 Oct 2013 09:17:40 GMT >>>> >>>> Content-Type: application/json >>>> Content-Length: 1309 >>>> Vary: X-Auth-Token >>>> >>>> {"access": {"token": {"issued_at": "2013-10-03T09:17:40.813479", >>>> "expires": "2013-10-04T09:17:40Z", "id": >>>> "MIIC8QYJKoZIhvcNAQcCoIIC4jCCAt4CAQExCTAHBgUrDgMCGjCCAUcGCSqGSIb3DQEHAaCCATgEggE0eyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxMy0xMC0wM1QwOToxNzo0MC44MTM0NzkiLCAiZXhwaXJlcyI6ICIyMDEzLTEwLTA0VDA5OjE3OjQwWiIsICJpZCI6ICJwbGFjZWhvbGRlciJ9LCAic2VydmljZUNhdGFsb2ciOiBbXSwgInVzZXIiOiB7InVzZXJuYW1lIjogImFkbWluIiwgInJvbGVzX2xpbmtzIjogW10sICJpZCI6ICJhNzBhNDU0YmRhMGI0ZmVkYTQ1ZWU5OGE3NWQ1MmZjZCIsICJyb2xlcyI6IFtdLCAibmFtZSI6ICJhZG1pbiJ9LCAibWV0YWRhdGEiOiB7ImlzX2FkbWluIjogMCwgInJvbGVzIjogW119fX0xggGBMIIBfQIBATBcMFcxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVVbnNldDEOMAwGA1UEBwwFVW5zZXQxDjAMBgNVBAoMBVVuc2V0MRgwFgYDVQQDDA93d3cuZXhhbXBsZS5jb20CAQEwBwYFKw4DAhowDQYJKoZIhvcNAQEBBQAEggEAQmJR1FRrHYhlL-3f1D0bzbWsPsMjlB2za+okZRdBUcM2-FwYa9GvqYkMPMzZ2MZLlu2Zb9WuBR8Xh8QnxaVP19lSk5msmycivnVmT4lTXJj7U6lA2YAdOSUARvE+CS9mWpx+Hij1Th+TVrWQvdzYGBSDP9HnaViFJgjcUVw87GszYnDUaXFKUfpywEGajllg7LMXGdaIXiws6uDa3KfRWuk6P1nqLdIXaVkvbNeBA+icTuzMW-AgMc1kk3jy-HEJJWmVy2w9yqJUnibJWw17CZW3ngpTL38FDzPqFmYdyabQOoRzxeq9SyhQkQZ-BXSwF57gob87pjmMk+2OVS1WFQ=="}, >>>> "serviceCatalog": [], "user": {"username": "admin", "roles_links": [], >>>> "id": "a70a454bda0b4feda45ee98a75d52fcd", "roles": [], "name": "admin"}, >>>> "metadata": {"is_admin": 0, "roles": []}}} >>>> # -------- end 21745032:21744960 response ---------- >>>> >>>> # -------- begin 21743232 request ---------- >>>> curl -i -X GET -H 'Host: 192.168.216.164:5000' -H 'X-LC-Request-ID: >>>> 21743232' -H 'Accept-Encoding: gzip,deflate' -H 'X-Auth-Token: >>>> MIIC8QYJKoZIhvcNAQcCoIIC4jCCAt4CAQExCTAHBgUrDgMCGjCCAUcGCSqGSIb3DQEHAaCCATgEggE0eyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxMy0xMC0wM1QwOToxNzo0MC44MTM0NzkiLCAiZXhwaXJlcyI6ICIyMDEzLTEwLTA0VDA5OjE3OjQwWiIsICJpZCI6ICJwbGFjZWhvbGRlciJ9LCAic2VydmljZUNhdGFsb2ciOiBbXSwgInVzZXIiOiB7InVzZXJuYW1lIjogImFkbWluIiwgInJvbGVzX2xpbmtzIjogW10sICJpZCI6ICJhNzBhNDU0YmRhMGI0ZmVkYTQ1ZWU5OGE3NWQ1MmZjZCIsICJyb2xlcyI6IFtdLCAibmFtZSI6ICJhZG1pbiJ9LCAibWV0YWRhdGEiOiB7ImlzX2FkbWluIjogMCwgInJvbGVzIjogW119fX0xggGBMIIBfQIBATBcMFcxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVVbnNldDEOMAwGA1UEBwwFVW5zZXQxDjAMBgNVBAoMBVVuc2V0MRgwFgYDVQQDDA93d3cuZXhhbXBsZS5jb20CAQEwBwYFKw4DAhowDQYJKoZIhvcNAQEBBQAEggEAQmJR1FRrHYhlL-3f1D0bzbWsPsMjlB2za+okZRdBUcM2-FwYa9GvqYkMPMzZ2MZLlu2Zb9WuBR8Xh8QnxaVP19lSk5msmycivnVmT4lTXJj7U6lA2YAdOSUARvE+CS9mWpx+Hij1Th+TVrWQvdzYGBSDP9HnaViFJgjcUVw87GszYnDUaXFKUfpywEGajllg7LMXGdaIXiws6uDa3KfRWuk6P1nqLdIXaVkvbNeBA+icTuzMW-AgMc1kk3jy-HEJJWmVy2w9yqJUnibJWw17CZW3ngpTL38FDzPqFmYdyabQOoRzxeq9SyhQkQZ-BXSwF57gob87pjmMk+2OVS1WFQ==' >>>> -H 'Accept: application/json' -H 'User-Agent: libcloud/0.13.1 (OpenStack) ' >>>> --compress ' >>>> http://192.168.216.164:5000/v2.0/images/detail?cache-busting=f02a38579879407f >>>> ' >>>> # -------- begin 21743232:21193504 response ---------- >>>> >>>> >>>> >>>> >>>> >>>> On Fri, Oct 4, 2013 at 12:18 AM, Tomaz Muraus <to...@apache.org> wrote: >>>> >>>>> Hey, >>>>> >>>>> It looks like your service catalog is empty and that is the problem. >>>>> Libcloud can't find compute endpoint in the service catalog. >>>>> >>>>> There are two solutions to the problem: >>>>> >>>>> 1. Populate the service catalog and instruct Libcloud to find the >>>>> corresponding entry with the ex_ arguments. >>>>> >>>>> 2. Specify ex_force_base_url argument. If you specify this argument, >>>>> Libcloud skips service catalog introspection and simply hits and uses the >>>>> URL you specify. >>>>> >>>>> >>>>> On Thu, Oct 3, 2013 at 11:30 PM, Venkata Siva Satya < >>>>> phanikumar.g...@gmail.com> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I am trying to create a openstack node using local openstack >>>>>> provider. The >>>>>> below code snippet shows the way I am creating the openstack driver. >>>>>> I followed the link - >>>>>> >>>>>> http://ci.apache.org/projects/libcloud/docs/compute/examples.html#create-an-openstack-node-using-a-local-openstack-provider >>>>>> >>>>>> self.driver = get_driver(Provider.OPENSTACK) >>>>>> conn = self.driver(self.user, self.key,ex_force_auth_url=' >>>>>> http://192.168.216.164:5000/v2.0', >>>>>> ex_force_auth_version='2.0_password') >>>>>> images = conn.list_images() >>>>>> >>>>>> But when I debugged it using pdb, I see that while executing >>>>>> conn.list_images(), it is throwing the following error. >>>>>> >>>>>> **** LibcloudError: <LibcloudError in None 'Could not find specified >>>>>> endpoint'>* >>>>>> >>>>>> >>>>>> The LIBCLOUD_DEBUG output and pdb output is as shown below. Could you >>>>>> please help me with this error. >>>>>> >>>>>> Thanks, >>>>>> Phani >>>>>> >>>>>> >>>>>> (Pdb) pprint(vars(conn)) >>>>>> {'_ex_force_api_version': 'None', >>>>>> '_ex_force_auth_url': 'http://192.168.216.164:5000/v2.0', >>>>>> '_ex_force_auth_version': '2.0_password', >>>>>> 'api_version': None, >>>>>> 'connection': >>>>>> <libcloud.compute.drivers.openstack.OpenStack_1_1_Connection >>>>>> object at 0x2a40d50>, >>>>>> 'key': 'admin', >>>>>> 'secret': 'password', >>>>>> 'secure': True} >>>>>> (Pdb) p conn.list_images() >>>>>> *** LibcloudError: <LibcloudError in None 'Could not find specified >>>>>> endpoint'> >>>>>> (Pdb) c >>>>>> >>>>>> >>>>>> The LIBCLOUD_DEBUG output is as follows. >>>>>> >>>>>> # -------- begin 21514936 request ---------- >>>>>> curl -i -X POST -H 'Host: 192.168.216.164:5000' -H 'Accept-Encoding: >>>>>> gzip,deflate' -H 'X-LC-Request-ID: 21514936' -H 'Content-Type: >>>>>> application/json; charset=UTF-8' -H 'Content-Length: 80' -H 'Accept: >>>>>> application/json' -H 'User-Agent: libcloud/0.13.1 (OpenStack) ' >>>>>> --data-binary '{"auth": {"passwordCredentials": {"username": "admin", >>>>>> "password": "password"}}}' --compress >>>>>> http://192.168.216.164:5000/v2.0/tokens >>>>>> # -------- begin 21514936:21515656 response ---------- >>>>>> HTTP/1.1 200 OK >>>>>> Date: Thu, 03 Oct 2013 04:05:49 GMT >>>>>> Content-Type: application/json >>>>>> Content-Length: 1309 >>>>>> Vary: X-Auth-Token >>>>>> >>>>>> {"access": {"token": {"issued_at": "2013-10-03T04:05:49.442720", >>>>>> "expires": >>>>>> "2013-10-04T04:05:49Z", "id": >>>>>> >>>>>> "MIIC8QYJKoZIhvcNAQcCoIIC4jCCAt4CAQExCTAHBgUrDgMCGjCCAUcGCSqGSIb3DQEHAaCCATgEggE0eyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxMy0xMC0wM1QwNDowNTo0OS40NDI3MjAiLCAiZXhwaXJlcyI6ICIyMDEzLTEwLTA0VDA0OjA1OjQ5WiIsICJpZCI6ICJwbGFjZWhvbGRlciJ9LCAic2VydmljZUNhdGFsb2ciOiBbXSwgInVzZXIiOiB7InVzZXJuYW1lIjogImFkbWluIiwgInJvbGVzX2xpbmtzIjogW10sICJpZCI6ICJkMWQ2NTlmOTlmMzA0NDdjOTM0YzVhNWI2M2E4NTJkMyIsICJyb2xlcyI6IFtdLCAibmFtZSI6ICJhZG1pbiJ9LCAibWV0YWRhdGEiOiB7ImlzX2FkbWluIjogMCwgInJvbGVzIjogW119fX0xggGBMIIBfQIBATBcMFcxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVVbnNldDEOMAwGA1UEBwwFVW5zZXQxDjAMBgNVBAoMBVVuc2V0MRgwFgYDVQQDDA93d3cuZXhhbXBsZS5jb20CAQEwBwYFKw4DAhowDQYJKoZIhvcNAQEBBQAEggEAYnkp2UpdEDuGje7kulFxmg8f72saVlwkDXnrgwhmJPP5lHjbfofFYq7EBmwYFI1fdFDlzNKw321OVTQKXGPkKMMT76QEHTC1TG-7u8dShBCnDfEumykYXRWL9Qmh-Jjg0bUY41lvjhwUi7fKJxQkYZ1B1aQLAGORnKR9F9Eafvayq8gx7k74TVBas-vuWqhYS0Vk6o5VHUWhK1HNepr79Ay5cuG9CAd7UgRiaMNZXO1LIHziBZZpTA4l1Y34sfaxXdoQqfr3LJpOvViUbOs0PLOaj6fKJPMCQJA68g3c85ZEqr0HI8+qZNVXQejawyTp23vuq5Msj91NaOvgwuPdvA=="}, >>>>>> "serviceCatalog": [], "user": {"username": "admin", "roles_links": [], >>>>>> "id": "d1d659f99f30447c934c5a5b63a852d3", "roles": [], "name": >>>>>> "admin"}, >>>>>> "metadata": {"is_admin": 0, "roles": []}}} >>>>>> >>>>> >>>>> >>>> >>>> >>> >>