boto connect to HP Cloud

157 views
Skip to first unread message

sajuptpm

unread,
Jun 7, 2012, 9:17:31 AM6/7/12
to boto-users, saju...@gmail.com
Hi,

I tried to connect to CP cloud using boto, but could not.
Have any one tried it before

I could connect to HP cloud via Euca2ools.
================================
EC2_URL = https://az-1.region-a.geo-1.ec2-compute.hpcloudsvc.com/services/Cloud
EC2_ACCESS_KEY = <tenant_id>:<access_key_id>
EC2_SECRET_KEY = <secret_key>

If i use boto, what should be the value of
endpoint : ??
port : ??
path : ??

I tried with following data, but not working.
endpoint :https://az-1.region-a.geo-1.ec2-compute.hpcloudsvc.com
port : 8773
path : /services/Cloud


Thanks

sajuptpm

unread,
Jun 7, 2012, 9:30:40 AM6/7/12
to boto-users
Hi,

I could connect to HP colud with following settings. :) :)

region = boto.ec2.regioninfo.RegionInfo(name="az-1.region-a.geo-1",
endpoint="az-1.region-a.geo-1.ec2-compute.hpcloudsvc.com")
conn = boto.connect_ec2(aws_access_key_id="xxxxxxxxxxxxxxxxx",

aws_secret_access_key="xxxxxxxxxxxxxxx",
is_secure=True,
region=region,
port=None,
path="/services/Cloud")


Mitchell Garnaat

unread,
Jun 7, 2012, 10:10:15 AM6/7/12
to boto-...@googlegroups.com
I think something like this should work:

import boto
from boto.regioninfo import RegionInfo

region = RegionInfo(name='hpcloud', endpoint='az-1.region-a.geo-1.ec2-compute.hpcloudsvc.com')
conn = boto.connect_ec2('<tenant_id:access_key_id>', '<secret_key>', path='/services/Cloud')

I haven't tried that but I think that should work.

Mitch


--
You received this message because you are subscribed to the Google Groups "boto-users" group.
To post to this group, send email to boto-...@googlegroups.com.
To unsubscribe from this group, send email to boto-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/boto-users?hl=en.


Patrick Dunnigan

unread,
Jun 7, 2012, 11:04:18 AM6/7/12
to boto-...@googlegroups.com
I've tried Boto with HP Cloud / OpenStack and it works fine. The following is what I use:

Mitch is correct, the access_key is the tenant id + colon + access key. The port is 443. 

access_key = <tenantid:accesskey>
secret_key = <secretkey>
is_secure = True
port = 443
path='/services/Cloud/'
(there are a handful of endpoints)

I use api version '2010-08-31' but I am not sure if this matters OpenStack. WIth Eucalyptus 3 you need to specify the api version or else Boto won't be able to parse the results. 

endpoint = 
            region = boto.ec2.regioninfo.RegionInfo(name='hpcloud', endpoint='az-1.region-a.geo-1.ec2-compute.hpcloudsvc.com')
            self.conn = boto.connect_ec2(access_key, secret_key,
                is_secure=True,
                region=region,
                port=443,
                path='/services/Cloud/',
                debug=2)
            self.conn.APIVersion = '2010-08-31'

sajuptpm

unread,
Jun 7, 2012, 11:37:56 AM6/7/12
to boto-users
Hi,
Thanks, its working for me

I have another issue

* After connection we are (In our appication) doing get_all_region and
creating new connection (using endpoint of region) for each region and
fetching zones, templates, etc--


* Connect to each region failing, Since region.endpont returning
somethin like "http://15.185.76.240:8773/services/Cloud". It should be
"az-1.region-a.geo-1.ec2-compute.hpcloudsvc.com"


* I also tried to make connection using following settings (with
is_secure True and False), but not working.
server : 15.185.76.240
port : 8773
path : /services/Cloud


* It is working, if we set end point to domain "az-1.region-
a.geo-1.ec2-compute.hpcloudsvc.com"


* Following are the attributes of region object "nova"

* Example-1
{'item': '', 'connection': EC2Connection:az-1.region-a.geo-1.ec2-
compute.hpcloudsvc.com, 'endpoint': u'http://15.185.76.240:8773/
services/Cloud', 'name': u'nova', 'connection_cls': <class
'boto.ec2.connection.EC2Connection'>}


* Example-2
{'item': '', 'connection': EC2Connection:az-1.region-a.geo-1.ec2-
compute.hpcloudsvc.com, 'endpoint': u'http://15.185.76.96:8773/
services/Cloud', 'name': u'nova', 'connection_cls': <class
'boto.ec2.connection.EC2Connection'>}



* Note: Example-1 and Example-2 are showing different endpoint, that
is endpoint of nova region object changing dynamically.

Enis Afgan

unread,
Aug 27, 2012, 1:41:29 AM8/27/12
to boto-...@googlegroups.com
Has anyone figured out what are the settings for connecting to the HP cloud's object store?

I've tried varying the following options but am either getting a '404 Not Found' or '401 Unauthorized' errors:
>>> import boto
>>> calling_format = boto.s3.connection.OrdinaryCallingFormat()
>>> c = boto.connect_s3(aws_access_key_id=<tenant_id:access_key>,
                        aws_secret_access_key=<secret_key>,
                        calling_format=calling_format,
                        is_secure=True,
                        host='region-a.geo-1.objects.hpcloudsvc.com',
                        port=443,
                        path='/' OR '/v1.0' OR '/v1.0/<tenant_id>')
>>> c.get_all_buckets()
ERR

The same code works fine for another OpenStack-based cloud whose connection properties are known.

Thanks,
Enis
Reply all
Reply to author
Forward
0 new messages