Actually , The Cloud module as you said worked very well with Amazon EC2, However we couldn't succeed to make it work
with OpenStack Essex , and actually we think this due too the different way of authentication in Essex, as it introduces new way of authentication by using keystone , and i believe the current way of authentication that is being used in the module will not work with that latest version of openstack , we might be trying different way . unless you might give me some hint that i will try to figure out the development needed for that and i will try to make a patch for this ,or even plan for the modification required .
I made the debugging (using dpm) in your code to figure out how it works , and it gives problem with authentication .
UnauthorizedSignature not provided
That's it, if you can offer any help it will be great .
Thanks again , Best Regards.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | access_key_length-20120725a.patch | 1.62 KB | yas |
| #2 | ec2rc.sh | 918 bytes | amr.abou-elenin |
Comments
Comment #1
yas@amr.abou-elenin,
Could you check the functions that are related to AWS authentication?: aws_hmac and aws_binary_sha1
Those functions are included inin aws.inc at aws module in cloud/modules/aws.
cloud/modules/aws | aws.inc -> aws_header_sign -> aws_hmac -> aws_binary_sha1
--- yas
Comment #2
amr.abou-eleninwell i had checked the functions you mentioned .. and also this one in openstack
def _calc_signature_1(self, params):
"""Generate AWS signature version 1 string."""
keys = params.keys()
keys.sort(cmp=lambda x, y: cmp(x.lower(), y.lower()))
for key in keys:
self.hmac.update(key)
val = self._get_utf8_value(params[key])
self.hmac.update(val)
return base64.b64encode(self.hmac.digest())
in ./common/utils.py
i don't know if this make sense or not .. i didn't know how diablo or cactos is generating the signature but is it different than the way that is essex is doing ..
also i'm attaching my ec2 credential file that i downloaded from openstack essex . if it gives you any hint ..
i had dig more in your code in aws module and the functions you mentioned .. it seems oki . but i am always getting this unauthorized message response ..
if you can guide me in which other areas of code that i shall check .. or even in openstack itself ..
how can i do simple test for the authentication issue ..
Thanks @yas . waiting for your feedback
Comment #3
yas@amr.abou-elenin,
Thank you for your investigating and providing the information.
Apart from the logic of generating the signature, one minor thing that I noticed in your ec2rc.sh is the following:
NOVA_KEY_DIR=${NOVARC%/*}
Is this correct (${NOVARC} looks containing %/* characters.
Also, My current official AWS EC2_ACCESS_KEY is 20 characters long. Your EC2_ACCESS_KEY in ec2rc.sh is too long that ESSEX provides?
--- yas
Comment #4
amr.abou-elenin@yas ..
well i had noticed that the cloud module is cutting my access key to be 20 character length and in this way it is not taking the right access key , so the other parameters to be generated on the fly like the signature version is being send wrong.
i had increased the length of the of the field and the size .. but it is still saving the value with 20 char length ..
i don't know if this would be the fix or not .. i'm trying..
amr
Comment #5
amr.abou-eleninthis the result of the dpm function
GET /services/Cloud/?Action=DescribeAddresses&Version=2012-05-01&AWSAccessKeyId=1f69d5f778704e0089b1&SignatureVersion=1&SignatureMethod=HmacSHA1&Timestamp=2012-07-25T13%3A24%3A56Z&Signature=wMna94MToxxFVVmvAPj9GAezynQ%3D HTTP/1.0 Host: 172.16.16.234:8773 User-Agent: Drupal (+http://drupal.org/)
as you can see my aws key has been cut to 20 char .. however my original one is :
1f69d5f778704e0089b17d0058d71424
Comment #6
yas@amr
Thank you for your investigation. I found that Cloud module restricts the length of AWS access Key (in a field and "database schema"). Please find the attached patch. It expands up to 32 length characters. It should be fine with your ESSEX credential (According to AWS specification. the length should be 16-32 characters).
Comment #7
yas@amr
I have one thing that I forgot to mention --- That patch will only work in a new installation. I think you need to change the database schema field directly. The field is 'aws_access_key' in a 'cloud_aws_cloud_details' table. The length of varchar should be 32.
Comment #8
amr.abou-elenin@yas ..
Thank you very much .. it is now working fine ..
amr
Comment #9
amr.abou-eleninand by the way .. i had seen this video in youtube ..
http://www.youtube.com/watch?v=j-yGt5s1ZEE
it 's seems very cool .. is the features in this module are available in the cloud/clanvai module .. as i can see from the video that the module is providing a gui like drag drop to provide the functionality needed ..
i had done my search and i didn't found the source code .
any idea ..
Thanks ..
amr
Comment #10
yas@amr
I am happy to hear that ! Now Cloud module is supporting ESSEX ^ ^ I updated 6.x-1.x-dev and 7.x-1.x-dev.
Regarding SimCloud, that is my friends work; I don't believe that he is publishing his code. You can directly ask him about that thru his YouTube account.
Thanks,
Yas Naoi
Comment #11
amr.abou-elenindear Yas ,
small issue .. when i make refresh in the instances page i got this error .
user warning: Duplicate entry 'default-itsyn_openstack234' for key 'PRIMARY' query: INSERT INTO cloud_aws_security_groups ( `owner_id` , `cloud_type`, `group_name` , `group_id` , `group_description` , `permissions` ) values ( '3584fb8c2c7c467abec414a6a9918919', 'itsyn_openstack234', 'Apache', '', 'Allow HTTP(S) access' , '') , ( '3584fb8c2c7c467abec414a6a9918919', 'itsyn_openstack234', 'ETrack', '', 'Allow Attendance devices traffic' , '') , ( '3584fb8c2c7c467abec414a6a9918919', 'itsyn_openstack234', 'OpenERP', '', 'Allow access to OpenERP Service' , '') , ( '3584fb8c2c7c467abec414a6a9918919', 'itsyn_openstack234', 'RDP', '', 'Allow RDP connections for Windows machines' , '') , ( '3584fb8c2c7c467abec414a6a9918919', 'itsyn_openstack234', 'VoIP', '', 'Allow VoIP traffic' , '') , ( '3584fb8c2c7c467abec414a6a9918919', 'itsyn_openstack234', 'default', '', 'default' , '') , ( '3584fb8c2c7c467abec414a6a9918919', 'itsyn_openstack234', 'new_group', '', 'this is a new one' , '') , ( '58fb8b48db5449548250c956fdb2184c', 'itsyn_openstack234', 'default', '', 'default' , '') , ( 'ab1b5021ea3b455fb69f2da0f3d0079b', 'itsyn_openstack234', 'Apache', '', 'Allowing HTTP(S) access' , '') , ( 'ab1b5021ea3b455fb69f2da0f3d0079b', 'itsyn_openstack234', 'ETrack', '', 'Allows Attendance devices traffic' , '') , ( 'ab1b5021ea3b455fb69f2da0f3d0079b', 'itsyn_openstack234', 'OpenERP', '', 'Allow access to OpenERP' , '') , ( 'ab1b5021ea3b455fb69f2da0f3d0079b', 'itsyn_openstack234', 'RDP', '', 'Enable RDP Connections for Windows Machines' , '') , ( 'ab1b5021ea3b455fb69f2da0f3d0079b', 'itsyn_openstack234', 'VoIP', '', 'Allow VoIP Traffic' , '') , ( 'ab1b5021ea3b455fb69f2da0f3d0079b', 'itsyn_openstack234', 'default', '', 'default' , '') , ( 'cfba35763ac94bac9eea49558b660083', 'itsyn_openstack234', 'default', '', 'default' , '') , ( 'e85fa2a891564712b73b9af26a322fea', 'itsyn_openstack234', 'Apache', '', 'Allow HTTP(S) Access' , '') , ( 'e85fa2a891564712b73b9af26a322fea', 'itsyn_openstack234', 'Etrack', '', 'Allow IT Syn E-Track Traffic' , '') , ( 'e85fa2a891564712b73b9af26a322fea', 'itsyn_openstack234', 'MySQL', '', 'Allowing access to MySQL DBM' , '') , ( 'e85fa2a891564712b73b9af26a322fea', 'itsyn_openstack234', 'OpenERP', '', 'OpenERP' , '') , ( 'e85fa2a891564712b73b9af26a322fea', 'itsyn_openstack234', 'RDP', '', 'Enable RDP Connections for Windows Machines' , '') , ( 'e85fa2a891564712b73b9af26a322fea', 'itsyn_openstack234', 'VoIP', '', 'Allow VoIP Traffic' , '') , ( 'e85fa2a891564712b73b9af26a322fea', 'itsyn_openstack234', 'default', '', 'default' , '') , ( 'e85fa2a891564712b73b9af26a322fea', 'itsyn_openstack234', 'test', '', 'test' , '') in /var/www/itsyn_cloud/sites/all/modules/aws/modules/aws_ec2/aws_ec2_lib_security_groups_db.inc on line 237.
BR
Comment #12
yas@amr,
The error occurred in a different module in: AWS Web Services API - http://drupal.org/project/aws.
Could you please raise the issue to the issue queue in that module project page?
--- yas
Comment #14
yasFYI, here is the solution: http://drupal.org/node/1729788